TriMesh class

TriMesh class

A TriMesh contains raw data that can be used by GPU directly. This class is a utility to help to construct a mesh that only contains per-vertex data.

Inheritance: TriMeshEntitySceneObjectA3DObject

The TriMesh type exposes the following members:

Constructors

ConstructorDescription
initInitialize an instance of TriMesh

Properties

PropertyDescription
nameGets or sets the name.
propertiesGets the collection of all properties.
sceneGets the scene that this object belongs to
parent_nodesGets all parent nodes, an entity can be attached to multiple parent nodes for geometry instancing
excludedGets or sets whether to exclude this entity during exporting.
parent_nodeGets or sets the first parent node, if set the first parent node, this entity will be detached from other parent nodes.
vertex_declarationThe vertex layout of the TriMesh.
vertices_countThe count of vertices in this TriMesh
indices_countThe count of indices in this TriMesh
unmerged_vertices_countThe count of unmerged vertices that passed in by TriMesh.begin_vertex and TriMesh.end_vertex.
capacityThe capacity of pre-allocated vertices.
vertices_size_in_bytesThe total size of all vertices in bytes

Methods

MethodDescription
remove_propertyRemoves a dynamic property.
remove_propertyRemove the specified property identified by name
from_meshCreate a TriMesh from given mesh object with given vertex layout.
from_meshCreate a TriMesh from given mesh object, the vertex declaration are based on the input mesh’s structure.
indices_to_array
indices_to_array
get_propertyGet the value of specified property
set_propertySets the value of specified property
find_propertyFinds the property.
It can be a dynamic property (Created by CreateDynamicProperty/SetProperty)
or native property(Identified by its name)
get_bounding_boxGets the bounding box of current entity in its object space coordinate system.
get_entity_renderer_keyGets the key of the entity renderer registered in the renderer
copy_fromCopy the TriMesh from input with new vertex layout
begin_vertexBegin adding vertex
end_vertexEnd adding vertex
write_vertices_toWrite vertices data to the specified stream
write_16b_indices_toWrite the indices data as 16bit integer to the stream
write_32b_indices_toWrite the indices data as 32bit integer to the stream
vertices_to_arrayConvert the vertices data to byte array
from_raw_dataCreate TriMesh from raw data
load_vertices_from_bytesLoad vertices from bytes, the length of bytes must be an integer multiple of vertex size.
read_vector4Read the vector4 field
read_f_vector4Read the vector4 field
read_vector3Read the vector3 field
read_f_vector3Read the vector3 field
read_vector2Read the vector2 field
read_f_vector2Read the vector2 field
read_doubleRead the double field
read_floatRead the float field

See Also