3es
0.7
|
Defines the set of messages used to construct mesh objects. More...
Classes | |
struct | tes::MeshCreateMessage |
MeshResource creation message. More... | |
struct | tes::MeshRedefineMessage |
MeshResource redefinition message. More... | |
struct | tes::MeshDestroyMessage |
MeshResource destruction message. More... | |
struct | tes::MeshComponentMessage |
Message structure for adding vertices, colours, indices, or UVs. More... | |
struct | tes::Material |
Not ready for use. More... | |
struct | tes::MeshFinaliseMessage |
Message to finalise a mesh, ready for use. More... | |
Enumerations | |
enum | tes::MeshBuildFlags { tes::MbfCalculateNormals = (1<<0) } |
The set of valid flags used in finalise messages. More... | |
enum | tes::MeshMessageType { MmtInvalid, MmtDestroy, MmtCreate, tes::MmtVertex, tes::MmtIndex, tes::MmtVertexColour, tes::MmtNormal, tes::MmtUv, tes::MmtSetMaterial, tes::MmtRedefine, tes::MmtFinalise } |
Defines the messageIDs for mesh message routing. More... | |
enum | tes::DrawType { DtPoints, DtLines, DtTriangles, tes::DtVoxels } |
Defines the primitives for a mesh. More... | |
Defines the set of messages used to construct mesh objects.
A mesh object is defined via a series of messages. This allows meshes to be defined over a number of updates, limiting per frame communications.
MeshResource instantiation supports the following messages:
Within a PacketHeader
, the mesh message is arranged as follows:
MtMesh
MeshMessageType
A valid mesh definition requires at least the following messages: Create, Vertex, Index, Finalise. Additional vertex streams, normals, etc can be added with the complete set of messages.
Each mesh definition specifies one of the following draw modes or primitive types:
A mesh object defined through the MeshHandler
doe snot support any child or sub-objects. These sorts of relationships are defined in the mesh renderer.
Message | Data Type | Semantics |
---|---|---|
Create | uint32 | Unique mesh ID |
uint32 | Vertex count | |
uint32 | Index count | |
uint8 | Draw type | |
uint32 | MeshResource tint | |
float32[3] | Position part of the mesh transform | |
float32[4] | Quaternion rotation for mesh transform | |
float32[3] | Scale factor part of mesh transform | |
Destroy | uint32 | MeshResource ID |
Finalise | uint32 | MeshResource ID |
Component | uint32 | MeshResource ID |
uint32 | Offset of the first data item | |
uint32 | Reserved (e.g., stream index support) | |
uint16 | Count | |
element* | Array of count elements. Type varies. | |
Material | uint32 | MeshResource ID |
uint32 | Material ID |
Component
message above refers to of the data content messages. The offset specicifies the first index of the incomping data, which allows the data streams to be sent in blocks. The element type matches the component type as follows:Component Message | Element type |
---|---|
Vertex | 32-bit float triples |
Vertex colour | 32-bit uint |
Index | 32-bit uint |
Normal | 32-bit float triples |
UV | 32-bit float pairs |
By default, one of the following materials are chosen:
enum tes::DrawType |
enum tes::MeshBuildFlags |
enum tes::MeshMessageType |
Defines the messageIDs for mesh message routing.