3es
0.7
|
A placeholder for a mesh resource, carrying only a mesh ID. More...
#include <3esmeshplaceholder.h>
Public Member Functions | |
MeshPlaceholder (uint32_t id) | |
Create a placeholder mesh resource for the given id . More... | |
void | setId (uint32_t newId) |
Changes the ID the placeholder publishes. More... | |
uint32_t | id () const override |
Returns the ID the placeholder was constructed with. | |
Matrix4f | transform () const override |
uint32_t | tint () const override |
uint8_t | drawType (int stream=0) const override |
Returns the DrawType of the mesh. More... | |
unsigned | vertexCount (int stream=0) const override |
Returns the number of vertices in the mesh. More... | |
unsigned | indexCount (int stream=0) const override |
Returns the number of indices in the mesh. More... | |
const float * | vertices (unsigned &stride, int stream=0) const override |
Returns a pointer to the vertex stream. More... | |
const uint8_t * | indices (unsigned &stride, unsigned &width, int stream=0) const override |
Returns a pointer to the index stream. More... | |
const float * | normals (unsigned &stride, int stream=0) const override |
Returns a pointer to the normal stream. More... | |
const float * | uvs (unsigned &stride, int stream=0) const override |
Returns a pointer to the UV stream. More... | |
const uint32_t * | colours (unsigned &stride, int stream=0) const override |
Returns a pointer to the colour stream. More... | |
![]() | |
virtual | ~MeshResource () |
Virtual destructor. | |
uint16_t | typeId () const override |
Returns MtMesh . | |
int | create (PacketWriter &packet) const override |
Populate a mesh creation packet. More... | |
int | destroy (PacketWriter &packet) const override |
Populate a mesh destroy packet. More... | |
int | transfer (PacketWriter &packet, int byteLimit, TransferProgress &progress) const override |
Populate the next mesh data packet. More... | |
*tes::PacketWriter | packet () |
Compose a mesh index component message in packet . More... | |
* | while (offset< mesh->indexCount()) * |
![]() | |
virtual | ~Resource () |
Virtual destructor (empty). | |
uint64_t | uniqueKey () const |
Returns a unique key for this resource, based on the typeId() and id() . | |
virtual Resource * | clone () const =0 |
Clone the resource. More... | |
Additional Inherited Members | |
![]() | |
static int | estimateTransferCount (size_t elementSize, unsigned byteLimit, int overhead=0) |
Estimate the number of elements which can be transferred at the given byteLimit . More... | |
*</code > **param packet Packet to write to *param meshId The mesh to which the data belong *param offset An index count offset to start writing from See remarks *param byteLimit A hard limit on the number of bytes to write *param dataSource Base pointer for the index data *param dataStride Number of bytes between indices *param indexByteWidth The byte size of a single index Generally equal to p dataStride *param componentCount The total number of indices *return The number of indices written *static unsigned | writeIndices (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, unsigned indexByteWidth, uint32_t componentCount) |
*</code > **param packet Packet to write to *param meshId The mesh to which the data belong *param offset An vertex count offset to start writing from See remarks *param byteLimit A hard limit on the number of bytes to write *param dataSource Base pointer for the vertex data *param dataStride Number of bytes between indices *param componentCount The total number of indices *return The number of indices written *static unsigned | writeVectors3 (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) |
static unsigned | writeVectors2 (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) |
Compose a mesh float vector 2 component message in packet . More... | |
static unsigned | writeColours (PacketWriter &packet, uint32_t meshId, uint32_t offset, unsigned byteLimit, const uint8_t *dataSource, unsigned dataStride, uint32_t componentCount) |
Compose a mesh component message for writing colour data in packet . More... | |
![]() | |
*const tes::MeshResource * | mesh = |
*uint32_t | offset = 0 |
*unsigned | dataStride |
*unsigned | indexByteWidth |
*const uint8_t * | indicesPtr = reinterpret_cast<const uint8_t *>(indices(dataStride, indexByteWidth)) |
* | offset |
Compose a mesh float vector 3 component message in packet . More... | |
![]() | |
virtual void | nextPhase (TransferProgress &progress) const |
A placeholder for a mesh resource, carrying only a mesh ID.
All other fields and data manipulations are null and void.
This can be use to reference an existing mesh resource, primarily when using the macro interface to release a mesh set such as with the tesmacros
.
tes::MeshPlaceholder::MeshPlaceholder | ( | uint32_t | id | ) |
Create a placeholder mesh resource for the given id
.
id | The ID this placeholder publishes. |
|
overridevirtual |
Returns a pointer to the colour stream.
Each element is taken 32-bit integer. Expects vertexCount(stream)
elements or null if no vertex colours.
[out] | stride | The stride between colour elements (bytes). This would be 4 for a contiguous array of uint32_t colours. |
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns the DrawType
of the mesh.
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns the number of indices in the mesh.
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns a pointer to the index stream.
Supports different index widths. Expects indexCount(stream)
elements or null if no indices.
[out] | stride | Specifies the stride between index elements (bytes). This would be 4 for a contiguous array of uint32_t indices. |
[out] | Specifies | the index byte width. Supports [1, 2, 4]. |
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns a pointer to the normal stream.
Each element is taken as a triple of single precision floats: (x, y, z). Expects vertexColour(stream)
elements or null if no normals.
[out] | stride | The stride between normal elements (bytes). This would be 12 for a contiguous array of float triples. |
stream | Reserved for future use. |
Implements tes::MeshResource.
void tes::MeshPlaceholder::setId | ( | uint32_t | newId | ) |
|
overridevirtual |
Implements tes::MeshResource.
|
overridevirtual |
Implements tes::MeshResource.
|
overridevirtual |
Returns a pointer to the UV stream.
Each element is taken as a pair of single precision floats: (u, v). Expects vertexCount(stream)
elements or null if no UVs.
[out] | stride | The stride between UV elements (bytes). This would be 8 for a contiguous array of float pairs. |
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns the number of vertices in the mesh.
stream | Reserved for future use. |
Implements tes::MeshResource.
|
overridevirtual |
Returns a pointer to the vertex stream.
Each element is taken as a triple of single precision floats: (x, y, z).
[out] | stride | The stride between vertex elements (bytes). This would be 12 for a contiguous array of float triples. |
stream | Reserved for future use. |
Implements tes::MeshResource.