|
|
Note that the primitive groups stored in a sub mesh are rendered in the order they were added to the sub mesh. This also implies that if e.g. the first primitive group has an associated state set and the rest of the primitive groups do not, the state set of that first primitive group determines the states for all other primitive groups of the sub mesh. To put it another way, for efficiency reasons it is advisable to group primitive groups according to their materials (= render states) and then for each material add the primitive groups with that material in sequence to the sub mesh where the first primitive group has the appropriate state set associated with it.
Public Member Functions | |
| SubMesh () | |
| Constructs an empty sub mesh. | |
| SubMesh (const VertexBufferStreamMapping &vertexBufferStreams, const boost::shared_ptr< IndexBuffer > &pIndexBuffer) | |
| Constructs an empty sub mesh using the given vertex buffer streams and index buffer. | |
| template<typename InputIteratorT> | |
| SubMesh (const VertexBufferStreamMapping &vertexBufferStreams, const boost::shared_ptr< IndexBuffer > &pIndexBuffer, InputIteratorT itPrimitiveGroupFirst, InputIteratorT itPrimitiveGroupLast) | |
| Constructs a sub mesh with the given primitive groups using the given vertex buffer streams and index buffer. | |
| void | SetVertexBufferStreamMapping (const VertexBufferStreamMapping &mapping) |
| Sets the vertex buffer stream mapping of this sub mesh. | |
| VertexBufferStreamMapping & | GetVertexBufferStreamMapping () |
| Returns the vertex buffer stream mapping used by this sub mesh allowing direct modification. | |
| const VertexBufferStreamMapping & | GetVertexBufferStreamMapping () const |
| Returns the vertex buffer stream mapping used by this sub mesh. | |
| void | SetIndexBuffer (const boost::shared_ptr< IndexBuffer > &pIndexBuffer) |
| Sets the index buffer used by this sub mesh. | |
| const boost::shared_ptr< IndexBuffer > & | GetIndexBuffer () const |
| Returns the index buffer used by this sub mesh. | |
| void | AddPrimitiveGroup (const PrimitiveGroup &primitives) |
| Adds a primitive group to this sub mesh. | |
| template<typename InputIteratorT> | |
| void | AddPrimitiveGroups (InputIteratorT itFirst, InputIteratorT itLast) |
| Adds multiple primitive groups to this sub mesh. | |
| void | ReplacePrimitiveGroup (size_t index, const PrimitiveGroup &primitives) |
| Replaces a specific primitive group of this sub mesh. | |
| size_t | GetPrimitiveGroupCount () const |
| Returns the number of primitive groups stored in this object. | |
| const PrimitiveGroup & | GetPrimitiveGroup (size_t index) const |
| Returns a specific primitive group of this sub mesh. | |
| const std::vector< PrimitiveGroup > & | GetPrimitiveGroups () const |
| Returns all primitive groups stored in this sub mesh. | |
| template<typename OutputIteratorT> | |
| void | GetPrimitiveGroups (OutputIteratorT it) const |
| Returns all primitive groups stored in this sub mesh. | |
|
|
Constructs an empty sub mesh. |
|
||||||||||||
|
Constructs an empty sub mesh using the given vertex buffer streams and index buffer. |
|
||||||||||||||||||||
|
Constructs a sub mesh with the given primitive groups using the given vertex buffer streams and index buffer. |
|
|
Adds a primitive group to this sub mesh. |
|
||||||||||||
|
Adds multiple primitive groups to this sub mesh. The given input iterator must deliver objects of type BufferMesh::PrimitiveGroup. |
|
|
Returns the index buffer used by this sub mesh. |
|
|
Returns a specific primitive group of this sub mesh. |
|
|
Returns the number of primitive groups stored in this object. |
|
|
Returns all primitive groups stored in this sub mesh. |
|
|
Returns all primitive groups stored in this sub mesh. |
|
|
Returns the vertex buffer stream mapping used by this sub mesh. |
|
|
Returns the vertex buffer stream mapping used by this sub mesh allowing direct modification. |
|
||||||||||||
|
Replaces a specific primitive group of this sub mesh. |
|
|
Sets a new index buffer to be used by this sub mesh. The new index buffer must have the same render context as the previous index buffer. Furthermore, the number of indices must be equal to or greater than the previous number of indices. |
|
|
Sets a new vertex buffer stream mapping for this sub mesh. Note that the new vertex buffers must have the same render context as the previous vertex buffers and the number of vertices must be equal to or greater than the previous number of vertices. |
|
Copyright © by Martin Ecker |