You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class GLTFCubicSplineInterpolant extends THREE.Interpolant {
constructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {
super( parameterPositions, sampleValues, sampleSize, resultBuffer );
}
copySampleValue_( index ) {
// Copies a sample value to the result buffer. See description of glTF
// CUBICSPLINE values layout in interpolate_() function below.
const result = this.resultBuffer,
values = this.sampleValues,
valueSize = this.valueSize,
offset = index * valueSize * 3 + valueSize;
for ( let i = 0; i !== valueSize; i ++ ) {
result[ i ] = values[ offset + i ];
}
return result;
}
function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {
// Add unknown glTF extensions to an object's userData.
for ( const name in objectDef.extensions ) {
if ( knownExtensions[ name ] === undefined ) {
object.userData.gltfExtensions = object.userData.gltfExtensions || {};
object.userData.gltfExtensions[ name ] = objectDef.extensions[ name ];
}
}
mesh.updateMorphTargets();
if ( meshDef.weights !== undefined ) {
for ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) {
mesh.morphTargetInfluences[ i ] = meshDef.weights[ i ];
}
} // .extras has user-defined data, so check that .extras.targetNames is an array.
if ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) {
const targetNames = meshDef.extras.targetNames;
if ( mesh.morphTargetInfluences.length === targetNames.length ) {
mesh.morphTargetDictionary = {};
for ( let i = 0, il = targetNames.length; i < il; i ++ ) {
mesh.morphTargetDictionary[ targetNames[ i ] ] = i;
}
} else {
console.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' );
}
}
let attributesKey = '';
const keys = Object.keys( attributes ).sort();
for ( let i = 0, il = keys.length; i < il; i ++ ) {
attributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';';
}
return attributesKey;
}
function getNormalizedComponentScale( constructor ) {
// Reference:
// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data
switch ( constructor ) {
case Int8Array:
return 1 / 127;
case Uint8Array:
return 1 / 255;
case Int16Array:
return 1 / 32767;
case Uint16Array:
return 1 / 65535;
default:
throw new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' );
}
}
/* GLTF PARSER */
class GLTFParser {
constructor( json = {}, options = {} ) {
this.json = json;
this.extensions = {};
this.plugins = {};
this.options = options; // loader object cache
this.cache = new GLTFRegistry(); // associations between Three.js objects and glTF elements
this.associations = new Map(); // THREE.BufferGeometry caching
this.primitiveCache = {}; // THREE.Object3D instance caches
this.meshCache = {
refs: {},
uses: {}
};
this.cameraCache = {
refs: {},
uses: {}
};
this.lightCache = {
refs: {},
uses: {}
};
this.textureCache = {}; // Track node names, to ensure no duplicates
this.nodeNamesUsed = {}; // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the
// expensive work of uploading a texture to the GPU off the main thread.
if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {
this.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );
} else {
this.textureLoader = new THREE.TextureLoader( this.options.manager );
}
this.textureLoader.setCrossOrigin( this.options.crossOrigin );
this.textureLoader.setRequestHeader( this.options.requestHeader );
this.fileLoader = new THREE.FileLoader( this.options.manager );
this.fileLoader.setResponseType( 'arraybuffer' );
if ( this.options.crossOrigin === 'use-credentials' ) {
this.fileLoader.setWithCredentials( true );
}
}
setExtensions( extensions ) {
this.extensions = extensions;
}
setPlugins( plugins ) {
this.plugins = plugins;
}
parse( onLoad, onError ) {
const parser = this;
const json = this.json;
const extensions = this.extensions; // Clear the loader cache
this.cache.removeAll(); // Mark the special nodes/meshes in json for efficient parse
this._invokeAll( function ( ext ) {
return ext._markDefs && ext._markDefs();
} );
Promise.all( this._invokeAll( function ( ext ) {
return ext.beforeRoot && ext.beforeRoot();
} ) ).then( function () {
return Promise.all( [ parser.getDependencies( 'scene' ), parser.getDependencies( 'animation' ), parser.getDependencies( 'camera' ) ] );
} ).then( function ( dependencies ) {
const result = {
scene: dependencies[ 0 ][ json.scene || 0 ],
scenes: dependencies[ 0 ],
animations: dependencies[ 1 ],
cameras: dependencies[ 2 ],
asset: json.asset,
parser: parser,
userData: {}
};
addUnknownExtensionsToUserData( extensions, result, json );
assignExtrasToUserData( result, json );
Promise.all( parser._invokeAll( function ( ext ) {
return ext.afterRoot && ext.afterRoot( result );
} ) ).then( function () {
onLoad( result );
} );
} ).catch( onError );
}
/**
Marks the special nodes/meshes in json for efficient parse.
*/
_markDefs() {
const nodeDefs = this.json.nodes || [];
const skinDefs = this.json.skins || [];
const meshDefs = this.json.meshes || []; // Nothing in the node definition indicates whether it is a THREE.Bone or an
// THREE.Object3D. Use the skins' joint references to mark bones.
for ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) {
const joints = skinDefs[ skinIndex ].joints;
for ( let i = 0, il = joints.length; i < il; i ++ ) {
nodeDefs[ joints[ i ] ].isBone = true;
}
} // Iterate over all nodes, marking references to shared resources,
// as well as skeleton joints.
for ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {
const nodeDef = nodeDefs[ nodeIndex ];
if ( nodeDef.mesh !== undefined ) {
this._addNodeRef( this.meshCache, nodeDef.mesh ); // Nothing in the mesh definition indicates whether it is
// a THREE.SkinnedMesh or THREE.Mesh. Use the node's mesh reference
// to mark THREE.SkinnedMesh if node has skin.
if ( nodeDef.skin !== undefined ) {
meshDefs[ nodeDef.mesh ].isSkinnedMesh = true;
}
}
if ( nodeDef.camera !== undefined ) {
this._addNodeRef( this.cameraCache, nodeDef.camera );
}
}
}
/**
Counts references to shared node / THREE.Object3D resources. These resources
can be reused, or "instantiated", at multiple nodes in the scene
hierarchy. THREE.Mesh, Camera, and Light instances are instantiated and must
be marked. Non-scenegraph resources (like Materials, Geometries, and
Textures) can be reused directly and are not marked here.
Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
*/
_addNodeRef( cache, index ) {
if ( index === undefined ) return;
if ( cache.refs[ index ] === undefined ) {
cache.refs[ index ] = cache.uses[ index ] = 0;
}
cache.refs[ index ] ++;
}
/** Returns a reference to a shared resource, cloning it if necessary. */
_getNodeRef( cache, index, object ) {
if ( cache.refs[ index ] <= 1 ) return object;
const ref = object.clone(); // Propagates mappings to the cloned object, prevents mappings on the
// original object from being lost.
const updateMappings = ( original, clone ) => {
const mappings = this.associations.get( original );
if ( mappings != null ) {
this.associations.set( clone, mappings );
}
for ( const [ i, child ] of original.children.entries() ) {
updateMappings( child, clone.children[ i ] );
}
};
updateMappings( object, ref );
ref.name += '_instance_' + cache.uses[ index ] ++;
return ref;
}
_invokeOne( func ) {
const extensions = Object.values( this.plugins );
extensions.push( this );
for ( let i = 0; i < extensions.length; i ++ ) {
const result = func( extensions[ i ] );
if ( result ) return result;
}
return null;
}
_invokeAll( func ) {
const extensions = Object.values( this.plugins );
extensions.unshift( this );
const pending = [];
for ( let i = 0; i < extensions.length; i ++ ) {
const result = func( extensions[ i ] );
if ( result ) pending.push( result );
}
return pending;
}
/**
Requests the specified dependency asynchronously, with caching.
}
/** When THREE.Object3D instances are targeted by animation, they need unique names. */
createUniqueName( originalName ) {
const sanitizedName = THREE.PropertyBinding.sanitizeNodeName( originalName || '' );
let name = sanitizedName;
for ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) {
name = sanitizedName + '_' + i;
}
this.nodeNamesUsed[ name ] = true;
return name;
function computeBounds( geometry, primitiveDef, parser ) {
const attributes = primitiveDef.attributes;
const box = new THREE.Box3();
if ( attributes.POSITION !== undefined ) {
const accessor = parser.json.accessors[ attributes.POSITION ];
const min = accessor.min;
const max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.
if ( min !== undefined && max !== undefined ) {
box.set( new THREE.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), new THREE.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) );
if ( accessor.normalized ) {
const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );
box.min.multiplyScalar( boxScale );
box.max.multiplyScalar( boxScale );
}
} else {
console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );
return;
}
} else {
return;
}
const targets = primitiveDef.targets;
if ( targets !== undefined ) {
const maxDisplacement = new THREE.Vector3();
const vector = new THREE.Vector3();
for ( let i = 0, il = targets.length; i < il; i ++ ) {
const target = targets[ i ];
if ( target.POSITION !== undefined ) {
const accessor = parser.json.accessors[ target.POSITION ];
const min = accessor.min;
const max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.
if ( min !== undefined && max !== undefined ) {
// we need to get max of absolute components because target weight is [-1,1]
vector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) );
vector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) );
vector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) );
if ( accessor.normalized ) {
const boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );
vector.multiplyScalar( boxScale );
} // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative
// to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets
// are used to implement key-frame animations and as such only two are active at a time - this results in very large
// boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size.
maxDisplacement.max( vector );
} else {
console.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );
}
}
} // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets.
box.expandByVector( maxDisplacement );
}
geometry.boundingBox = box;
const sphere = new THREE.Sphere();
box.getCenter( sphere.center );
sphere.radius = box.min.distanceTo( box.max ) / 2;
geometry.boundingSphere = sphere;
function toTrianglesDrawMode( geometry, drawMode ) {
let index = geometry.getIndex(); // generate index if not present
if ( index === null ) {
const indices = [];
const position = geometry.getAttribute( 'position' );
if ( position !== undefined ) {
for ( let i = 0; i < position.count; i ++ ) {
indices.push( i );
}
geometry.setIndex( indices );
index = geometry.getIndex();
} else {
console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );
return geometry;
}
} //
const numberOfTriangles = index.count - 2;
const newIndices = [];
if ( drawMode === THREE.TriangleFanDrawMode ) {
// gl.TRIANGLE_FAN
for ( let i = 1; i <= numberOfTriangles; i ++ ) {
newIndices.push( index.getX( 0 ) );
newIndices.push( index.getX( i ) );
newIndices.push( index.getX( i + 1 ) );
}
} else {
// gl.TRIANGLE_STRIP
for ( let i = 0; i < numberOfTriangles; i ++ ) {
if ( i % 2 === 0 ) {
newIndices.push( index.getX( i ) );
newIndices.push( index.getX( i + 1 ) );
newIndices.push( index.getX( i + 2 ) );
} else {
newIndices.push( index.getX( i + 2 ) );
newIndices.push( index.getX( i + 1 ) );
newIndices.push( index.getX( i ) );
}
}
}
if ( newIndices.length / 3 !== numberOfTriangles ) {
console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );
} // build final geometry
const newGeometry = geometry.clone();
newGeometry.setIndex( newIndices );
return newGeometry;
}
THREE.GLTFLoader = GLTFLoader;
} )();
The text was updated successfully, but these errors were encountered:
Hi! This appears to be a copy of THREE.GLTFLoader? I'm assuming this was opened mistake, but if you had intended to ask a question feel free to reopen.
( function () {
Punctual Lights Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual
*/
class GLTFLightsExtension {
}
/**
Unlit Materials Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit
*/
class GLTFMaterialsUnlitExtension {
}
/**
Clearcoat Materials Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat
*/
class GLTFMaterialsClearcoatExtension {
}
/**
Transmission Materials Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission
Draft: KHR_materials_transmission KhronosGroup/glTF#1698
*/
class GLTFMaterialsTransmissionExtension {
}
/**
Materials Volume Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume
*/
class GLTFMaterialsVolumeExtension {
}
/**
Materials ior Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior
*/
class GLTFMaterialsIorExtension {
}
/**
Materials specular Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular
*/
class GLTFMaterialsSpecularExtension {
}
/**
BasisU THREE.Texture Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu
*/
class GLTFTextureBasisUExtension {
}
/**
WebP THREE.Texture Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp
*/
class GLTFTextureWebPExtension {
}
/**
meshopt BufferView Compression Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression
*/
class GLTFMeshoptCompression {
}
/* BINARY EXTENSION */
const BINARY_EXTENSION_HEADER_MAGIC = 'glTF';
const BINARY_EXTENSION_HEADER_LENGTH = 12;
const BINARY_EXTENSION_CHUNK_TYPES = {
JSON: 0x4E4F534A,
BIN: 0x004E4942
};
class GLTFBinaryExtension {
}
/**
DRACO THREE.Mesh Compression Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression
*/
class GLTFDracoMeshCompressionExtension {
}
/**
THREE.Texture Transform Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform
*/
class GLTFTextureTransformExtension {
}
/**
Specular-Glossiness Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
*/
/**
A sub class of StandardMaterial with some of the functionality
changed via the
onBeforeCompile
callback@pailhead
*/
class GLTFMeshStandardSGMaterial extends THREE.MeshStandardMaterial {
}
class GLTFMaterialsPbrSpecularGlossinessExtension {
}
/**
THREE.Mesh Quantization Extension
Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization
*/
class GLTFMeshQuantizationExtension {
}
/*********************************/
/********** INTERPOLATION ********/
/*********************************/
// Spline Interpolation
// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation
class GLTFCubicSplineInterpolant extends THREE.Interpolant {
}
GLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;
GLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;
GLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) {
};
const _q = new THREE.Quaternion();
class GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant {
}
/*********************************/
/********** INTERNALS ************/
/*********************************/
/* CONSTANTS */
const WEBGL_CONSTANTS = {
FLOAT: 5126,
//FLOAT_MAT2: 35674,
FLOAT_MAT3: 35675,
FLOAT_MAT4: 35676,
FLOAT_VEC2: 35664,
FLOAT_VEC3: 35665,
FLOAT_VEC4: 35666,
LINEAR: 9729,
REPEAT: 10497,
SAMPLER_2D: 35678,
POINTS: 0,
LINES: 1,
LINE_LOOP: 2,
LINE_STRIP: 3,
TRIANGLES: 4,
TRIANGLE_STRIP: 5,
TRIANGLE_FAN: 6,
UNSIGNED_BYTE: 5121,
UNSIGNED_SHORT: 5123
};
const WEBGL_COMPONENT_TYPES = {
5120: Int8Array,
5121: Uint8Array,
5122: Int16Array,
5123: Uint16Array,
5125: Uint32Array,
5126: Float32Array
};
const WEBGL_FILTERS = {
9728: THREE.NearestFilter,
9729: THREE.LinearFilter,
9984: THREE.NearestMipmapNearestFilter,
9985: THREE.LinearMipmapNearestFilter,
9986: THREE.NearestMipmapLinearFilter,
9987: THREE.LinearMipmapLinearFilter
};
const WEBGL_WRAPPINGS = {
33071: THREE.ClampToEdgeWrapping,
33648: THREE.MirroredRepeatWrapping,
10497: THREE.RepeatWrapping
};
const WEBGL_TYPE_SIZES = {
'SCALAR': 1,
'VEC2': 2,
'VEC3': 3,
'VEC4': 4,
'MAT2': 4,
'MAT3': 9,
'MAT4': 16
};
const ATTRIBUTES = {
POSITION: 'position',
NORMAL: 'normal',
TANGENT: 'tangent',
TEXCOORD_0: 'uv',
TEXCOORD_1: 'uv2',
COLOR_0: 'color',
WEIGHTS_0: 'skinWeight',
JOINTS_0: 'skinIndex'
};
const PATH_PROPERTIES = {
scale: 'scale',
translation: 'position',
rotation: 'quaternion',
weights: 'morphTargetInfluences'
};
const INTERPOLATION = {
CUBICSPLINE: undefined,
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
// keyframe track will be initialized with a default interpolation type, then modified.
LINEAR: THREE.InterpolateLinear,
STEP: THREE.InterpolateDiscrete
};
const ALPHA_MODES = {
OPAQUE: 'OPAQUE',
MASK: 'MASK',
BLEND: 'BLEND'
};
/* UTILITY FUNCTIONS */
function resolveURL( url, path ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material
*/
function createDefaultMaterial( cache ) {
}
function addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {
}
/**
@param {Object3D|Material|BufferGeometry} object
@param {GLTF.definition} gltfDef
*/
function assignExtrasToUserData( object, gltfDef ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets
@param {BufferGeometry} geometry
@param {Array<GLTF.Target>} targets
@param {GLTFParser} parser
@return {Promise}
*/
function addMorphTargets( geometry, targets, parser ) {
}
/**
@param {Mesh} mesh
@param {GLTF.Mesh} meshDef
*/
function updateMorphTargets( mesh, meshDef ) {
}
function createPrimitiveKey( primitiveDef ) {
}
function createAttributesKey( attributes ) {
}
function getNormalizedComponentScale( constructor ) {
}
/* GLTF PARSER */
class GLTFParser {
Marks the special nodes/meshes in json for efficient parse.
*/
_markDefs() {
}
/**
Counts references to shared node / THREE.Object3D resources. These resources
can be reused, or "instantiated", at multiple nodes in the scene
hierarchy. THREE.Mesh, Camera, and Light instances are instantiated and must
be marked. Non-scenegraph resources (like Materials, Geometries, and
Textures) can be reused directly and are not marked here.
Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
*/
_addNodeRef( cache, index ) {
}
/** Returns a reference to a shared resource, cloning it if necessary. */
_getNodeRef( cache, index, object ) {
}
_invokeOne( func ) {
}
_invokeAll( func ) {
}
/**
Requests the specified dependency asynchronously, with caching.
@param {string} type
@param {number} index
@return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
*/
getDependency( type, index ) {
}
/**
Requests all dependencies of the specified type asynchronously, with caching.
@param {string} type
@return {Promise<Array>}
*/
getDependencies( type ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
@param {number} bufferIndex
@return {Promise}
*/
loadBuffer( bufferIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
@param {number} bufferViewIndex
@return {Promise}
*/
loadBufferView( bufferViewIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors
@param {number} accessorIndex
@return {Promise<BufferAttribute|InterleavedBufferAttribute>}
*/
loadAccessor( accessorIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
@param {number} textureIndex
@return {Promise<THREE.Texture>}
*/
loadTexture( textureIndex ) {
}
loadTextureImage( textureIndex, source, loader ) {
}
/**
Asynchronously assigns a texture to the given material parameters.
@param {Object} materialParams
@param {string} mapName
@param {Object} mapDef
@return {Promise}
*/
assignTexture( materialParams, mapName, mapDef ) {
}
/**
Assigns final material to a THREE.Mesh, THREE.Line, or THREE.Points instance. The instance
already has a material (generated from the glTF material options alone)
but reuse of the same glTF material may require multiple threejs materials
to accommodate different primitive types, defines, etc. New materials will
be created if necessary, and reused from a cache.
@param {Object3D} mesh THREE.Mesh, THREE.Line, or THREE.Points instance.
*/
assignFinalMaterial( mesh ) {
}
getMaterialType() {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@param {number} materialIndex
@return {Promise}
*/
loadMaterial( materialIndex ) {
}
/** When THREE.Object3D instances are targeted by animation, they need unique names. */
createUniqueName( originalName ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry
Creates BufferGeometries from primitives.
@param {Array<GLTF.Primitive>} primitives
@return {Promise<Array>}
*/
loadGeometries( primitives ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
@param {number} meshIndex
@return {Promise<Group|Mesh|SkinnedMesh>}
*/
loadMesh( meshIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras
@param {number} cameraIndex
@return {Promise<THREE.Camera>}
*/
loadCamera( cameraIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@param {number} skinIndex
@return {Promise}
*/
loadSkin( skinIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations
@param {number} animationIndex
@return {Promise}
*/
loadAnimation( animationIndex ) {
}
createNodeMesh( nodeIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy
@param {number} nodeIndex
@return {Promise}
*/
loadNode( nodeIndex ) {
}
/**
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
@param {number} sceneIndex
@return {Promise}
*/
loadScene( sceneIndex ) {
}
}
function buildNodeHierarchy( nodeId, parentObject, json, parser ) {
}
/**
@param {BufferGeometry} geometry
@param {GLTF.Primitive} primitiveDef
@param {GLTFParser} parser
*/
function computeBounds( geometry, primitiveDef, parser ) {
}
/**
@param {BufferGeometry} geometry
@param {GLTF.Primitive} primitiveDef
@param {GLTFParser} parser
@return {Promise}
*/
function addPrimitiveAttributes( geometry, primitiveDef, parser ) {
}
/**
@param {BufferGeometry} geometry
@param {Number} drawMode
@return {BufferGeometry}
*/
function toTrianglesDrawMode( geometry, drawMode ) {
}
THREE.GLTFLoader = GLTFLoader;
} )();
The text was updated successfully, but these errors were encountered: