A mesh in a SceneModel.

See @xeokit/sdk/scene for usage.

Properties

destroyed: boolean = false
geometry: SceneGeometry

SceneGeometry used by this SceneMesh.

id: string

Unique ID of this SceneMesh.

SceneMesh is stored by this ID in SceneModel.meshes.

model: SceneModel

The SceneModel that contains this SceneMesh.

object: SceneObject

The SceneObject that uses this SceneMesh.

textureSet?: SceneTextureSet

SceneTextureSet used by this SceneMesh.

Accessors

  • get geometryId(): string

    Gets the ID of the SceneGeometry used by this SceneMesh.

    Returns string

  • set geometryId(value: string): void

    Sets the SceneGeometry used by this SceneMesh.

    The SceneMesh will already have the SceneGeometry it was created with, and then you can change it to a different SceneGeometry using this setter.

    This mechanism allows you to dynamically switch the geometric representation of a SceneMesh at runtime.

    When the switch succeeds, SceneMesh.geometry will reference the new SceneGeometry and an SceneEvents.onSceneMeshGeometryChanged event is dispatched on the Scene.

    If the given geometryId is invalid, such as when the SceneGeometry does not exist in the SceneModel, an error will be logged and the SceneGeometry will not be changed.

    Note that you cannot destroy a SceneGeometry that is currently in use by a SceneMesh.

    Parameters

    • value: string

      The ID of the new SceneGeometry to use. Must exist in the SceneModel.

    Returns void

  • get parentTransform(): SceneTransform

    Gets the parent SceneTransform of this SceneMesh, or null if this SceneMesh is not parented.

    Returns SceneTransform

Methods

  • Sets the parent transform for this mesh.

    Parameters

    • next: SceneTransform

      The new parent transform or null to detach.

    • Optionalopts: { preserveWorld?: boolean }

      Options to preserve world transformation.

    Returns void