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, Mesh parameters and so on.

Loading Features

  • Accessors
    • Sparse accessors
  • Buffers
  • BufferViews
  • Images
  • Meshes
  • Nodes
  • Primitives
  • Samplers
  • Textures
  • Animations
  • Cameras
  • Materials
  • Skins

Example

const gltfLoader = new GLTFLoader()
const gltf = await gltfLoader.loadFromUrl('path/to/model.gltf')

// create a gltfScenesManager from the resulting 'gltf' object
// assuming 'renderer' is a valid camera renderer or curtains instance
const gltfScenesManager = new GLTFScenesManager({ renderer, gltf })
gltfScenesManager.addMeshes()

Constructors

Properties

renderer: CameraRenderer

The CameraRenderer used.

The gltf object used.

scenesManager: ScenesManager

The ScenesManager containing all the useful data.

#primitiveInstances: PrimitiveInstances

The PrimitiveInstances Map, to group similar Mesh by instances.

Methods

  • Get an attribute type, bufferFormat and size from its accessor type.

    Parameters

    Returns {
        type: string;
        bufferFormat: GPUVertexFormat;
        size: number;
    }

    • corresponding type, bufferFormat and size.
    • type: string

      Corresponding attribute type

    • bufferFormat: GPUVertexFormat

      Corresponding attribute bufferFormat

    • size: number

      Corresponding attribute size