An encapsulated definition of a mesh. It manages all its own vertices, indices, etc.
More...
|
| SimpleMesh (uint32_t id, unsigned vertexCount=0, unsigned indexCount=0, DrawType drawType=DtTriangles, unsigned components=Vertex|Index) |
| Construct a SimpleMesh resource. More...
|
|
| ~SimpleMesh () |
| Destructor.
|
|
virtual void | clear () |
| Reset this mesh to a simple mesh with only Vertex and Index components.
|
|
virtual void | clearData () |
| Clear only the data arrays. Memory is preserved.s.
|
|
virtual uint32_t | id () const override |
| The resource ID. More...
|
|
virtual Matrix4f | transform () const override |
|
void | setTransform (const Matrix4f &transform) |
| Set the object transformation matrix for this mesh. More...
|
|
virtual uint32_t | tint () const override |
|
void | setTint (uint32_t tint) |
| Set the colour tint value for the mesh. More...
|
|
SimpleMesh * | clone () const override |
| Performs a shallow copy of this mesh. More...
|
|
virtual uint8_t | drawType (int stream) const override |
|
DrawType | getDrawType () const |
| Get the drawType() as a DrawType value.
|
|
void | setDrawType (DrawType type) |
| Set the draw type as a DrawType value. More...
|
|
unsigned | components () const |
| Query the ComponentFlag components used by this mesh. More...
|
|
void | setComponents (unsigned components) |
| Set the ComponentFlag components for this mesh. More...
|
|
void | addComponents (unsigned components) |
| Add ComponentFlag values to the existing set. More...
|
|
unsigned | vertexCount () const |
|
virtual unsigned | vertexCount (int stream) const override |
| Returns the number of vertices in the mesh. More...
|
|
void | setVertexCount (unsigned count) |
|
void | reserveVertexCount (unsigned count) |
|
unsigned | addVertex (const Vector3f &v) |
|
unsigned | addVertices (const Vector3f *v, unsigned count) |
|
bool | setVertex (unsigned at, const Vector3f &v) |
|
unsigned | setVertices (unsigned at, const Vector3f *v, const unsigned count) |
|
const Vector3f * | vertices () const |
|
virtual const float * | vertices (unsigned &stride, int stream=0) const override |
| Returns a pointer to the vertex stream. More...
|
|
unsigned | indexCount () const |
|
virtual unsigned | indexCount (int stream) const override |
| Returns the number of indices in the mesh. More...
|
|
void | setIndexCount (unsigned count) |
|
void | reserveIndexCount (unsigned count) |
|
void | addIndex (uint32_t i) |
|
void | addIndices (const uint32_t *idx, unsigned count) |
|
bool | setIndex (unsigned at, uint32_t i) |
|
unsigned | setIndices (unsigned at, const uint32_t *idx, unsigned count) |
|
const uint32_t * | indices () const |
|
virtual const uint8_t * | indices (unsigned &stride, unsigned &width, int stream=0) const override |
| Returns a pointer to the index stream. More...
|
|
bool | setNormal (unsigned at, const Vector3f &n) |
|
unsigned | setNormals (unsigned at, const Vector3f *n, const unsigned count) |
|
const Vector3f * | normals () const |
|
virtual const float * | normals (unsigned &stride, int stream) const override |
| Returns a pointer to the normal stream. More...
|
|
bool | setColour (unsigned at, uint32_t c) |
|
unsigned | setColours (unsigned at, const uint32_t *c, unsigned count) |
|
const uint32_t * | colours () const |
|
virtual const uint32_t * | colours (unsigned &stride, int stream) const override |
| Returns a pointer to the colour stream. More...
|
|
bool | setUv (unsigned at, float u, float v) |
|
unsigned | setUvs (unsigned at, const float *uvs, const unsigned count) |
|
const float * | uvs () const |
|
virtual const float * | uvs (unsigned &stride, int stream) const override |
| Returns a pointer to the UV 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() .
|
|
|
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...
|
|
An encapsulated definition of a mesh. It manages all its own vertices, indices, etc.