GLTFScenesManager constructor.
parameters used to create our GLTFScenesManager.
our CameraRenderer class object.
The gltf object used.
The CameraRenderer used.
The gltf object used.
The ScenesManager containing all the useful data.
Static
getGet an attribute type, bufferFormat and size from its accessor type.
accessor type to use.
Corresponding attribute type
Corresponding attribute bufferFormat
Corresponding attribute size
Static
getGet the corresponding typed array constructor based on the accessor component type.
accessor component type to use.
Static
gpuGet the GPUPrimitiveTopology based on the WebGL primitive mode.
WebGL primitive mode to use.
Static
gpuGet the GPUAddressMode based on the WebGL texture wrap mode.
WebGL texture wrap mode to use.
Create the scenesManager TargetsAnimationsManager if any animation is present in the gltf.
Create the lights defined by the KHR_lights_punctual
extension if any.
Create the Sampler and add them to the scenesManager samplers array.
Create a MediaTexture based on the options.
material using that texture.
image source of the texture.
name of the texture.
Whether the MediaTexture should handle transformations.
Create the {ScenesManager.materialsTextures | scenesManager materialsTextures array} and each associated MaterialTexture and their respective Texture.
Get the MeshDescriptorMaterialParams for a given glTF primitive material index.
Optional label to use for the RenderMaterial created.
Create all the MeshDescriptorMaterialParams from the glTF materials.
Create a ChildDescriptor from a parent ChildDescriptor and a glTF Node
parent ChildDescriptor to use.
glTF Node to use.
Index of the glTF Node to use.
Static
getSort an array of VertexBufferAttributeParams by an array of attribute names.
array of attribute names to use for sorting.
VertexBufferAttributeParams array to sort.
Create the mesh Geometry based on the given gltf primitive and PrimitiveInstanceDescriptor.
PrimitiveInstanceDescriptor to use to create the Geometry.
Create the skins definitions for each gltf skins.
Create the mesh material parameters based on the given gltf primitive and PrimitiveInstanceDescriptor.
gltf primitive to use to create the material parameters.
PrimitiveInstanceDescriptor to use to create the material parameters.
Create the ScenesManager scenes based on the gltf object.
Add all the needed LitMesh based on the ScenesManager meshesDescriptors array.
allow to optionally patch the LitMesh parameters before creating it (can be used to add custom shaders chunks, uniforms or storages, change rendering options, etc.)
Destroy the current ScenesManager by removing all created meshes and destroying all the Object3D nodes.
Used to create a GLTFScenesManager from a given gltf object.
Parse the gltf object, create all the Sampler and Texture, create all the Object3D nodes to compute the correct transformations and parent -> child relationships, create all the needed MeshDescriptor containing the Geometry, LitMesh parameters and so on.
Loading Features
Extensions
Example