Skip to main content

Class: MeshManager

Creates and updates meshes.

Constructors

Constructor

new MeshManager(): MeshManager;

Returns

MeshManager

Methods

Create()

Call Signature

static Create(): Promise<number>;

Creates a mesh.

Returns

Promise<number>

A promise that resolves to the created Mesh.

Call Signature

static Create(entity): Promise<number>;

Creates a mesh and assigns it to an entity.

Parameters
ParameterTypeDescription
entitynumberThe Entity to assign the mesh to.
Returns

Promise<number>

A promise that resolves to the created Mesh.


Destroy()

static Destroy(handle): Promise<boolean>;

Destroys a mesh.

Parameters

ParameterTypeDescription
handlenumberThe Mesh to destroy.

Returns

Promise<boolean>

A promise that resolves to true if the mesh was destroyed, or false otherwise.


SetVertices()

Call Signature

static SetVertices(handle, vertices): Promise<void>;

Sets the vertex positions of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
verticesFloat32ArrayVertex positions.
Returns

Promise<void>

A promise that resolves when the vertex positions have been changed.

Call Signature

static SetVertices(handle, base64Vertices): Promise<void>;

Sets the vertex positions of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
base64VerticesstringBase64-encoded vertex positions.
Returns

Promise<void>

A promise that resolves when the vertex positions have been changed.


SetTriangles()

Call Signature

static SetTriangles(handle, indices): Promise<void>;

Sets the triangle indices of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
indicesUint16ArrayTriangle indices.
Returns

Promise<void>

A promise that resolves when the triangle indices have been changed.

Call Signature

static SetTriangles(handle, base64Indices): Promise<void>;

Sets the triangle indices of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
base64IndicesstringBase64-encoded triangle indices.
Returns

Promise<void>

A promise that resolves when the triangle indices have been changed.


SetUVs()

Call Signature

static SetUVs(handle, uvs): Promise<void>;

Sets the UV coordinates of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
uvsFloat32ArrayUV coordinates.
Returns

Promise<void>

A promise that resolves when the UV coordinates have been changed.

Call Signature

static SetUVs(handle, base64Uvs): Promise<void>;

Sets the UV coordinates of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
base64UvsstringBase64-encoded UV coordinates.
Returns

Promise<void>

A promise that resolves when the UV coordinates have been changed.


SetNormals()

Call Signature

static SetNormals(handle, normals): Promise<void>;

Sets the normals of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
normalsFloat32ArrayNormal vectors.
Returns

Promise<void>

A promise that resolves when the normals have been changed.

Call Signature

static SetNormals(handle, base64Normals): Promise<void>;

Sets the normals of a mesh.

Parameters
ParameterTypeDescription
handlenumberThe Mesh to update.
base64NormalsstringBase64-encoded normal vectors.
Returns

Promise<void>

A promise that resolves when the normals have been changed.


RecalcNormals()

static RecalcNormals(handle): Promise<void>;

Recalculates the normals of a mesh.

Parameters

ParameterTypeDescription
handlenumberThe Mesh to update.

Returns

Promise<void>

A promise that resolves when the normals have been recalculated.


RecalcBounds()

static RecalcBounds(handle): Promise<void>;

Recalculates the bounds of a mesh.

Parameters

ParameterTypeDescription
handlenumberThe Mesh to update.

Returns

Promise<void>

A promise that resolves when the bounds have been recalculated.


BlendShapeCount()

static BlendShapeCount(handle): Promise<number>;

Gets the number of blend shapes in a mesh.

Parameters

ParameterTypeDescription
handlenumberThe Mesh to inspect.

Returns

Promise<number>

A promise that resolves to the number of blend shapes. Throw if the mesh does not exist.