class
render::Mesh
Render thread portion of a Mesh.
Public
Constructors
Mesh
Methods
~Mesh
Initialize
Called on the render thread when the object is first created.
GetVertexDescription
Returns a structure that describes how are the vertices stored in the mesh's vertex buffer.
GetSkeleton
Returns a skeleton that can be used for animating the mesh.
GetMorphShapes
Returns an object containing all shapes used for morph animation, if any are available.
WriteData
Updates the current mesh with the provided data.
- data
- Data to update the mesh with.
- discardEntireBuffer
- When true the existing contents of the resource you are updating will be discarded. This can make the operation faster. Resources with certain buffer types might require this flag to be in a specific state otherwise the operation will fail.
- updateBounds
- If true the internal bounds of the mesh will be recalculated based on the provided data.
- commandBuffer
- Command buffer on which to issue a copy operation, in case the internal buffers aren't directly writeable.
ReadData
Reads the current mesh data into the provided parameter.
Data buffer needs to be pre-allocated.
- data
- Pre-allocated buffer of proper vertex/index format and size where data will be read to. You can use Mesh::allocBuffer() to allocate a buffer of a correct format and size.
- commandBuffer
- Command buffer on which to issue a copy operation, in case the internal buffers aren't directly readable.
staticCreate
Creates a new empty mesh.
Created mesh will have no sub-meshes.
- vertexCount
- Number of vertices in the mesh.
- indexCount
- Number of indices in the mesh.
- vertexDescription
- Vertex description structure that describes how are vertices organized in the vertex buffer. When binding a mesh to the pipeline you must ensure vertex description at least partially matches the input description of the currently bound vertex GPU program.
- flags
- Flags to control various mesh options.
- primitiveType
- Determines how should the provided indices be interpreted by the pipeline. Default option is a triangle list, where three indices represent a single triangle.
- indexType
- Size of indices, use smaller size for better performance, however be careful not to go over the number of vertices limited by the size.
staticCreate
Creates a new empty mesh.
- meshCreateInformation
- Descriptor containing the properties of the mesh to create.
- deviceMask
- Mask that determines on which GPU devices should the object be created on.
staticCreate
Creates a new mesh from an existing mesh data.
Created mesh will match the vertex and index buffers described by the mesh data exactly.
- initialData
- Vertex and index data to initialize the mesh with.
- meshCreateInformation
- Descriptor containing the properties of the mesh to create. Vertex and index count, vertex descriptor and index type properties are ignored and are read from provided mesh data instead.
staticCreate
Creates a new mesh from an existing mesh data.
Created mesh will match the vertex and index buffers described by the mesh data exactly. Mesh will have no sub-meshes.
- initialData
- Vertex and index data to initialize the mesh with.
- flags
- Flags to control various mesh options.
- drawOp
- Determines how should the provided indices be interpreted by the pipeline. Default option is a triangle strip, where three indices represent a single triangle.
Protected
Methods
UpdateBounds
Updates bounds by calculating them from the vertices in the provided mesh data object.