class
MeshData
Contains mesh vertex and index data used for initializing, updating and reading mesh data from Mesh.
Public
Constructors
MeshData
Constructs a new object that can hold number of vertices described by the provided vertex data description.
As well as a number of indices of the provided type.
Methods
~MeshData
SetVertexData
Copies data from parameter into the internal buffer for the specified semantic.
- semantic
- Semantic that allows the engine to connect the data to a shader input slot.
- data
- Vertex data, containing at least bytes.
- size
- The size of the data. Must be the size of the vertex element type * number of vertices.
- semanticIndex
- (optional) If there are multiple semantics with the same name, use different index to differentiate between them.
- streamIndex
- (optional) Zero-based index of the stream. Each stream will internally be represented as a single vertex buffer.
GetVertexData
Copies data from the internal buffer to the pre-allocated buffer for the specified semantic.
- semantic
- Semantic that allows the engine to connect the data to a shader input slot.
- data
- Buffer that will receive vertex data, of at least bytes.
- size
- The size of the data. Must be the size of the vertex element type * number of vertices.
- semanticIndex
- (optional) If there are multiple semantics with the same name, use different index to differentiate between them.
- streamIndex
- (optional) Zero-based index of the stream. Each stream will internally be represented as a single vertex buffer.
GetVec2DataIter
Returns an iterator you can use for easily retrieving or setting Vector2 vertex elements.
This is the preferred method of assigning or reading vertex data.
GetVec3DataIter
Returns an iterator you can use for easily retrieving or setting Vector3 vertex elements.
This is the preferred method of assigning or reading vertex data.
GetVec4DataIter
Returns an iterator you can use for easily retrieving or setting Vector4 vertex elements.
This is the preferred method of assigning or reading vertex data.
GetDwordDataIter
Returns an iterator you can use for easily retrieving or setting DWORD vertex elements.
This is the preferred method of assigning or reading vertex data.
GetVertexCount
Returns the total number of vertices this object can hold.
GetIndexCount
Returns the total number of indices this object can hold.
GetIndices16
Returns a 16-bit pointer to the start of the internal index buffer.
GetIndices32
Returns a 32-bit pointer to the start of the internal index buffer.
GetIndexElementSize
Returns the size of an index element in bytes.
GetElementData
Returns the pointer to the first element of the specified type.
If you want to iterate over all elements you need to call getVertexStride() to get the number of bytes you need to advance between each element.
- semantic
- Semantic that allows the engine to connect the data to a shader input slot.
- semanticIndex
- (optional) If there are multiple semantics with the same name, use different index to differentiate between them.
- streamIndex
- (optional) Zero-based index of the stream. Each stream will internally be represented as a single vertex buffer.
Returns: null if it fails, else the element data.
GetElementOffset
Returns an offset into the internal buffer where this element with the provided semantic starts.
Offset is provided in number of bytes.
- semantic
- Semantic that allows the engine to connect the data to a shader input slot.
- semanticIndex
- (optional) If there are multiple semantics with the same name, use different index to differentiate between them.
- streamIndex
- (optional) Zero-based index of the stream. Each stream will internally be represented as a single vertex buffer.
GetIndexData
Returns a pointer to the start of the index buffer.
GetStreamData
Returns a pointer to the start of the specified vertex stream.
GetStreamSize
Returns the size of the specified stream in bytes.
GetStreamSize
Returns the size of all the streams in bytes.
GetVertexDescription
Returns an object that describes data contained in a single vertex.
GetSize
Return the size (in bytes) of the entire buffer.
CalculateBounds
Calculates the bounds of all vertices stored in the internal buffer.
staticCombine
Combines a number of submeshes and their mesh data into one large mesh data buffer.
- elements
- Data containing vertices and indices referenced by the submeshes. Number of elements must be the same as number of submeshes.
- allSubMeshes
- Submeshes representing vertex and index range to take from mesh data and combine. Number of submeshes must match the number of provided MeshData elements.
- subMeshes
- Outputs all combined sub-meshes with their new index and vertex offsets referencing the newly created MeshData.
Returns: Combined mesh data containing all vertices and indexes references by the provided sub-meshes.
staticCreate
Constructs a new object that can hold number of vertices described by the provided vertex data description.
As well as a number of indices of the provided type.
staticGetRttiStatic
Protected
Methods
GetInternalBufferSize
Returns the size of the internal buffer in bytes.
Private
Constructors
MeshData
*********************************************************************
Methods
GetIndexBufferOffset
Returns an offset in bytes to the start of the index buffer from the start of the internal buffer.
GetStreamOffset
Returns an offset in bytes to the start of the stream from the start of the internal buffer.
GetIndexBufferSize
Returns the size of the index buffer in bytes.
GetDataForIterator
Returns the data needed for iterating over the requested vertex element.
- semantic
- Semantic of the element we are looking for.
- semanticIndex
- If there are multiple semantics with the same name, use different index to differentiate between them.
- streamIndex
- Zero-based index of the stream the element resides in.
- data
- Pointer to the start of this elements data.
- stride
- Number of bytes between vertex elements of this type.