Class TriMeshT

TriMesh<T> class

Generic version of TriMesh for user’s static-defined vertex type

public class TriMesh<T> : TriMesh
    where T : struct
ParameterDescription
T

Constructors

NameDescription
TriMesh(string)Initialize an instance of TriMesh

Properties

NameDescription
Capacity { get; }The capacity of pre-allocated vertices.
Excluded { get; set; }Gets or sets whether to exclude this entity during exporting.
IndicesCount { get; }The count of indices in this TriMesh
virtual Name { get; set; }Gets or sets the name.
ParentNode { get; set; }Gets or sets the first parent node, if set the first parent node, this entity will be detached from other parent nodes.
ParentNodes { get; }Gets all parent nodes, an entity can be attached to multiple parent nodes for geometry instancing
Properties { get; }Gets the collection of all properties.
Scene { get; }Gets the scene that this object belongs to
UnmergedVerticesCount { get; }The count of unmerged vertices that passed in by BeginVertex and EndVertex.
VertexDeclaration { get; }The vertex layout of the TriMesh.
VerticesCount { get; }The count of vertices in this TriMesh
VerticesSizeInBytes { get; }The total size of all vertices in bytes

Methods

NameDescription
static FromMesh(Mesh)Create a TriMesh from given mesh object with automatically generated vertex layout.
AddTriangle(int, int, int)Add a new triangle
BeginVertex()Begin adding vertex
EndVertex()End adding vertex
FindProperty(string)Finds the property. It can be a dynamic property (Created by CreateDynamicProperty/SetProperty) or native property(Identified by its name)
GetBoundingBox()Gets the bounding box of current entity in its object space coordinate system.
virtual GetEntityRendererKey()Gets the key of the entity renderer registered in the renderer
GetEnumerator()Get the enumerator to enumerate Vertex
GetProperty(string)Get the value of specified property
IndicesToArray(out int[])
IndicesToArray(out ushort[])
LoadVerticesFromBytes(byte[])Load vertices from bytes, the length of bytes must be an integer multiple of vertex size.
ReadDouble(int, VertexField)Read the double field
ReadFloat(int, VertexField)Read the float field
ReadFVector2(int, VertexField)Read the vector2 field
ReadFVector3(int, VertexField)Read the vector3 field
ReadFVector4(int, VertexField)Read the vector4 field
ReadVector2(int, VertexField)Read the vector2 field
ReadVector3(int, VertexField)Read the vector3 field
ReadVector4(int, VertexField)Read the vector4 field
RemoveProperty(Property)Removes a dynamic property.
RemoveProperty(string)Remove the specified property identified by name
SetProperty(string, object)Sets the value of specified property
override ToString()Gets the string representation of TriMesh
VerticesToArray()Convert the vertices data to byte array
VerticesToTypedArray()Convert the vertices data to typed array
Write16bIndicesTo(Stream)Write the indices data as 16bit integer to the stream
Write32bIndicesTo(Stream)Write the indices data as 32bit integer to the stream
WriteVerticesTo(Stream)Write vertices data to the specified stream

See Also