Skip to content

Commit

Permalink
Reintroduce LegacyJSONLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarcos committed Jul 26, 2024
1 parent a1fde99 commit bbe1a1d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/loaders/ObjectLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,21 @@ class ObjectLoader extends Loader {
geometry = bufferGeometryLoader.parse( data );
break;

case 'Geometry':

if ( 'THREE' in window && 'LegacyJSONLoader' in THREE ) {

var geometryLoader = new THREE.LegacyJSONLoader();
geometry = geometryLoader.parse( data, this.resourcePath ).geometry;


} else {

console.error( 'THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".' );

}
break;

default:

if ( data.type in Geometries ) {
Expand Down

0 comments on commit bbe1a1d

Please sign in to comment.