Skip to content

Mesh

extends AssetObject

The Mesh class is used to represent the data structure of a mesh, which describes the geometric shape of a 3D model. A mesh is composed of a series of vertices, triangular faces, and other properties.

Instance Properties

Mesh.bonesPerVertex : BonesPerVertex
The number of bones associated with each vertex.
Mesh.isReadable : boolean
Whether the current mesh is enabled for read/write.
Mesh.subMeshCount : number
The number of submeshes in a Mesh object.
Mesh.uv6 : Vector2[]
The sixth set of mesh UV coordinate arrays.
Mesh.isDynamic : boolean
Checks if the current object is marked as a dynamic mesh.
Mesh.indexCount : number
Index count.
Mesh.indexFormat : IndexFormat
The format of the mesh index buffer data.
Mesh.bounds : Bounds
The bounding box of the mesh.
Mesh.vertexCount : number
The number of vertices in the mesh.
Mesh.triangles : number[]
The triangle index array of the mesh.
Mesh.vertices : Vector3[]
Array of mesh vertices.
Mesh.normals : Vector3[]
An array of normal vectors for the vertices of the mesh.
Mesh.tangents : Vector4[]
An array of tangent vectors for the mesh.
Mesh.colors : Color[]
An array of vertex colors for the mesh.
Mesh.uv1 : Vector2[]
The first set of mesh UV coordinate arrays.
Mesh.uv2 : Vector2[]
The second set of mesh UV coordinate arrays.
Mesh.uv3 : Vector2[]
The third set of mesh UV coordinate arrays.
Mesh.uv4 : Vector2[]
The fourth set of mesh UV coordinate arrays.
Mesh.uv5 : Vector2[]
The fifth set of mesh UV coordinate arrays.
Mesh.uv7 : Vector2[]
The seventh set of mesh UV coordinate arrays.
Mesh.uv8 : Vector2[]
The eighth set of mesh UV coordinate arrays.
Mesh.boneWeights : BoneWeight[]
The weight information of the mesh vertices associated with bones.
Mesh.bindPoses : Matrix4x4[]
Mesh bind pose information.
Mesh.bindPoseIndices : number[]
Mesh bind pose index information.
Mesh.subMeshes : SubMeshDescriptor[]
Information about a submesh of a mesh.

Instance Method

Mesh.MarkDynamic ( dynamic : boolean ) : void
Marks the mesh as dynamic.
Mesh.Update ( no_longer_readable : boolean ) : void
Uploads the previously made mesh modifications to the graphics API.
Mesh.RecalculateBounds ( ) : void
Recalculates the bounding volume of the mesh from its vertices.
Mesh.RecalculateNormals ( ) : void
Recalculates the normals of a mesh based on the triangles and vertices.