From bbe1a1d536534b444cdb565916bbe9d948c4a5b1 Mon Sep 17 00:00:00 2001 From: Diego Marcos Date: Wed, 25 Nov 2020 16:50:11 -0800 Subject: [PATCH] Reintroduce LegacyJSONLoader --- src/loaders/ObjectLoader.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/loaders/ObjectLoader.js b/src/loaders/ObjectLoader.js index b72a17ee7a93cb..bb96f3d011b843 100644 --- a/src/loaders/ObjectLoader.js +++ b/src/loaders/ObjectLoader.js @@ -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 ) {