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
| Parameter | Type | Description |
|---|---|---|
entity | number | The 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
vertices | Float32Array | Vertex 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
base64Vertices | string | Base64-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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
indices | Uint16Array | Triangle 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
base64Indices | string | Base64-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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
uvs | Float32Array | UV 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
base64Uvs | string | Base64-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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
normals | Float32Array | Normal 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to update. |
base64Normals | string | Base64-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
| Parameter | Type | Description |
|---|---|---|
handle | number | The 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The 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
| Parameter | Type | Description |
|---|---|---|
handle | number | The Mesh to inspect. |
Returns
Promise<number>
A promise that resolves to the number of blend shapes. Throw if the mesh does not exist.