未验证 提交 1a6bcc9b 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #15336 from Mugen87/dev19

ObjectLoader: Add fallback for Geometry
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* @author alteredq / http://alteredqualia.com/ * @author alteredq / http://alteredqualia.com/
*/ */
THREE.JSONLoader = ( function () { THREE.LegacyJSONLoader = ( function () {
function JSONLoader( manager ) { function LegacyJSONLoader( manager ) {
if ( typeof manager === 'boolean' ) { if ( typeof manager === 'boolean' ) {
...@@ -20,7 +20,7 @@ THREE.JSONLoader = ( function () { ...@@ -20,7 +20,7 @@ THREE.JSONLoader = ( function () {
} }
Object.assign( JSONLoader.prototype, { Object.assign( LegacyJSONLoader.prototype, {
crossOrigin: 'anonymous', crossOrigin: 'anonymous',
...@@ -573,6 +573,6 @@ THREE.JSONLoader = ( function () { ...@@ -573,6 +573,6 @@ THREE.JSONLoader = ( function () {
} ); } );
return JSONLoader; return LegacyJSONLoader;
} )(); } )();
...@@ -422,7 +422,17 @@ Object.assign( ObjectLoader.prototype, { ...@@ -422,7 +422,17 @@ Object.assign( ObjectLoader.prototype, {
case 'Geometry': case 'Geometry':
console.error( 'THREE.ObjectLoader: "Geometry" is no longer supported.' ); 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; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册