Skip to content

Commit

Permalink
Reintroduce LegacyJSONLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarcos committed Apr 1, 2024
1 parent acc6c9c commit 40bba57
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 @@ -282,6 +282,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 40bba57

Please sign in to comment.