From 40bba57affb1a594e78a3b459f42e31adda6e9f9 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 d430386baac682..3d7efc01a8a8b0 100644 --- a/src/loaders/ObjectLoader.js +++ b/src/loaders/ObjectLoader.js @@ -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 ) {