MeshDataComponent

MeshDataComponent

Holds the mesh data, like vertices, normals, indices etc. Also defines the local bounding volume.

Constructor

new MeshDataComponent(meshData)

Parameters:
Name Type Description
meshData MeshData

Target mesh data for this component.

Members

currentPose :SkeletonPose

meshData :MeshData

modelBound :BoundingVolume

Bounding volume in local space.

modelBoundDirty :boolean

Default Value:
  • true

Methods

clone(optionsopt) → {MeshDataComponent}

Returns a clone of this mesh data component

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
shareMeshData boolean <optional>
false

Cloning this component clones the mesh data by default

computeBoundFromPoints()

Compute bounding center and bounds for this mesh.

ensureCanReplaceComponent(sourceEntity)

Validate if the entity contains this meshDataComponent can be replaced

Parameters:
Name Type Description
sourceEntity Entity
Throws:
  • Error if the component does not have meshData or modelBound

  • Error if this component contains skeleton (temporarily [SUMERIAN-1248])

setModelBound(modelBound, setBoundsDirtyopt)

Set the bounding volume type (sphere, box etc).

Parameters:
Name Type Attributes Default Description
modelBound BoundingVolume

Bounding to apply to this meshdata component.

setBoundsDirty boolean <optional>
true

Whether to set modelBoundDirty=true.