|
@@ -40697,17 +40697,15 @@ const TYPED_ARRAYS = {
|
|
|
Float64Array: Float64Array
|
|
|
};
|
|
|
|
|
|
-function ObjectLoader( manager ) {
|
|
|
+class ObjectLoader extends Loader {
|
|
|
|
|
|
- Loader.call( this, manager );
|
|
|
-
|
|
|
-}
|
|
|
+ constructor( manager ) {
|
|
|
|
|
|
-ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
+ super( manager );
|
|
|
|
|
|
- constructor: ObjectLoader,
|
|
|
+ }
|
|
|
|
|
|
- load: function ( url, onLoad, onProgress, onError ) {
|
|
|
+ load( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
const scope = this;
|
|
|
|
|
@@ -40748,9 +40746,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
}, onProgress, onError );
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parse: function ( json, onLoad ) {
|
|
|
+ parse( json, onLoad ) {
|
|
|
|
|
|
const shapes = this.parseShape( json.shapes );
|
|
|
const geometries = this.parseGeometries( json.geometries, shapes );
|
|
@@ -40780,9 +40778,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return object;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseShape: function ( json ) {
|
|
|
+ parseShape( json ) {
|
|
|
|
|
|
const shapes = {};
|
|
|
|
|
@@ -40800,9 +40798,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return shapes;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseGeometries: function ( json, shapes ) {
|
|
|
+ parseGeometries( json, shapes ) {
|
|
|
|
|
|
const geometries = {};
|
|
|
let geometryShapes;
|
|
@@ -41082,9 +41080,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return geometries;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseMaterials: function ( json, textures ) {
|
|
|
+ parseMaterials( json, textures ) {
|
|
|
|
|
|
const cache = {}; // MultiMaterial
|
|
|
const materials = {};
|
|
@@ -41138,9 +41136,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return materials;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseAnimations: function ( json ) {
|
|
|
+ parseAnimations( json ) {
|
|
|
|
|
|
const animations = [];
|
|
|
|
|
@@ -41158,9 +41156,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return animations;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseImages: function ( json, onLoad ) {
|
|
|
+ parseImages( json, onLoad ) {
|
|
|
|
|
|
const scope = this;
|
|
|
const images = {};
|
|
@@ -41228,9 +41226,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return images;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseTextures: function ( json, images ) {
|
|
|
+ parseTextures( json, images ) {
|
|
|
|
|
|
function parseConstant( value, type ) {
|
|
|
|
|
@@ -41315,9 +41313,9 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
return textures;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
- parseObject: function ( data, geometries, materials ) {
|
|
|
+ parseObject( data, geometries, materials ) {
|
|
|
|
|
|
let object;
|
|
|
|
|
@@ -41616,7 +41614,16 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
-} );
|
|
|
+ /* DEPRECATED */
|
|
|
+
|
|
|
+ setTexturePath( value ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().' );
|
|
|
+ return this.setResourcePath( value );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
|
|
|
const TEXTURE_MAPPING = {
|
|
|
UVMapping: UVMapping,
|
|
@@ -49232,17 +49239,6 @@ function BinaryTextureLoader( manager ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
-Object.assign( ObjectLoader.prototype, {
|
|
|
-
|
|
|
- setTexturePath: function ( value ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().' );
|
|
|
- return this.setResourcePath( value );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-} );
|
|
|
-
|
|
|
//
|
|
|
|
|
|
Object.assign( Box2.prototype, {
|