GLTFParser class
Methods
addNodeRef (Map <String , dynamic > cache , int ? index )
→ void
Counts references to shared node / Object3D resources. These resources
can be reused, or "instantiated", at multiple nodes in the scene
hierarchy. 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.
assignFinalMaterial (Object3D mesh )
→ void
Assigns final material to a Mesh, Line, or 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 accomodate different primitive types, defines, etc. New materials will
be created if necessary, and reused from a cache.
@param {Object3D} mesh Mesh, Line, or Points instance.
assignTexture (dynamic materialParams , dynamic mapName , Map <String , dynamic > mapDef , [String ? colorSpace ])
→ Future <Texture? >
Asynchronously assigns a texture to the given material parameters.
@param {Object} materialParams
@param {string} mapName
@param {Object} mapDef
@return {Promise}
buildNodeHierarchy (int nodeId , Object3D? parentObject , Map <String , dynamic > json )
→ Future <void >
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
@param {number} sceneIndex
@return {Promise
createMaterialType (dynamic materialType , Map <String , dynamic > materialParams )
→ Material
createNodeMesh (int nodeIndex )
→ Future <Object3D? >
createUniqueName (String ? originalName )
→ String
When Object3D instances are targeted by animation, they need unique names.
getDependencies (String type )
→ Future <List >
Requests all dependencies of the specified type asynchronously, with caching.
@param {string} type
@return {Promise<Array
getDependency (String type , int index )
→ Future
Requests the specified dependency asynchronously, with caching.
@param {string} type
@param {number} index
@return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
getMaterialType (int materialIndex )
→ Type
getNodeRef (Map <String , dynamic > cache , int index , Object3D object )
→ Object3D
Returns a reference to a shared resource, cloning it if necessary.
loadAccessor (dynamic accessorIndex )
→ dynamic
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors
@param {number} accessorIndex
@return {Promise<BufferAttribute|InterleavedBufferAttribute>}
loadAnimation (dynamic animationIndex )
→ Future <AnimationClip >
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations
@param {number} animationIndex
@return {Promise
loadBuffer (int bufferIndex )
→ dynamic
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
@param {number} bufferIndex
@return {Promise
loadBufferView2 (int bufferViewIndex )
→ Future <ByteBuffer ? >
loadCamera (dynamic cameraIndex )
→ Camera?
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras
@param {number} cameraIndex
@return {Promise
loadGeometries (dynamic primitives )
→ Future <List <BufferGeometry > >
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry
loadImageSource (dynamic sourceIndex , TextureLoader loader )
→ Future <Texture? >
loadMaterial (dynamic materialIndex )
→ Future <Material >
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@param {number} materialIndex
@return {Promise
loadMesh (int meshIndex )
→ Future <Object3D >
Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
@param {number} meshIndex
@return {Promise<Group|Mesh|SkinnedMesh>}
loadNode (int nodeIndex )
→ Future <Object3D >
loadNodeShallow (int nodeIndex )
→ Future <Object3D >
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy
@param {number} nodeIndex
@return {Promise
loadScene (int sceneIndex )
→ Future <Group >
loadScene_new (int sceneIndex )
→ Future
loadSkin (dynamic skinIndex )
→ dynamic
loadSkin_new (dynamic skinIndex )
→ Future
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@param {number} skinIndex
@return {Promise
loadTexture (dynamic textureIndex )
→ Future <Texture? >
Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures
@param {number} textureIndex
@return {Promise<THREE.Texture>}
loadTextureImage (int textureIndex , int sourceIndex , TextureLoader loader )
→ Future <Texture? >
markDefs ()
→ void
Marks the special nodes/meshes in json for efficient parse.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse ()
→ Future <GLTFData >
setExtensions (Map <String , dynamic > extensions )
→ void
setPlugins (Map <String , dynamic > plugins )
→ void
toString ()
→ String
A string representation of this object.
inherited