![]() |
Public API Reference |
![]() |
Helper class to extract triangles from an index buffer. More...
#include <csgfx/trianglestream.h>
Public Member Functions | |
void | BeginTriangulate (const uint8 *indexStart, const uint8 *indexEnd, size_t stride, csRenderBufferComponentType compType, csRenderMeshType meshtype) |
Begin triangulation of an index buffer. | |
void | BeginTriangulate (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0) |
Begin triangulation of an index buffer. | |
size_t | GetRemainingComponents () const |
Get the remaining components in the buffer. | |
bool | HasNext () const |
Returns whether a triangle is available. | |
TriangleT< T > | Next () |
Fetches the next triangle from the buffer. | |
TriangleIndicesStream () | |
Construct uninitialized triangle stream. | |
TriangleIndicesStream (iRenderBuffer *indices, csRenderMeshType meshtype, size_t indexStart=0, size_t indexEnd=(size_t)~0) | |
Construct triangle stream with an index buffer. | |
Protected Member Functions | |
T | GetIndex (size_t idx, const uint8 *index) const |
Get element idx, based on index. | |
T | GetNextIndex () |
Fetch the next index from the index buffer. |
Helper class to extract triangles from an index buffer.
Automatically handles tristrips, quads etc. as well.
Definition at line 48 of file trianglestream.h.
CS::TriangleIndicesStream< T >::TriangleIndicesStream | ( | ) | [inline] |
Construct uninitialized triangle stream.
Definition at line 130 of file trianglestream.h.
CS::TriangleIndicesStream< T >::TriangleIndicesStream | ( | iRenderBuffer * | indices, |
csRenderMeshType | meshtype, | ||
size_t | indexStart = 0 , |
||
size_t | indexEnd = (size_t)~0 |
||
) | [inline] |
Construct triangle stream with an index buffer.
indices | Index buffer to triangulate. |
meshtype | Mesh type of the index data. |
indexStart | Element of the index buffer to start iterating at. |
indexEnd | Element of the index buffer to stop iterating at. (size_t)~0 means last element. |
Definition at line 139 of file trianglestream.h.
void CS::TriangleIndicesStream< T >::BeginTriangulate | ( | const uint8 * | indexStart, |
const uint8 * | indexEnd, | ||
size_t | stride, | ||
csRenderBufferComponentType | compType, | ||
csRenderMeshType | meshtype | ||
) | [inline] |
Begin triangulation of an index buffer.
index | Pointer to start of the indices. |
indexEnd | Pointer to end of the indices. |
stride | Distance between index elements in bytes. |
compType | Type of component contained in the data. |
meshtype | Mesh type of the index data. |
Reimplemented in CS::TriangleIndicesStreamRandom< T >.
Definition at line 159 of file trianglestream.h.
void CS::TriangleIndicesStream< T >::BeginTriangulate | ( | iRenderBuffer * | indices, |
csRenderMeshType | meshtype, | ||
size_t | indexStart = 0 , |
||
size_t | indexEnd = (size_t)~0 |
||
) | [inline] |
Begin triangulation of an index buffer.
indices | Index buffer to triangulate. |
meshtype | Mesh type of the index data. |
indexStart | Element of the index buffer to start iterating at. |
indexEnd | Element of the index buffer to stop iterating at. (size_t)~0 means last element. |
Reimplemented in CS::TriangleIndicesStreamRandom< T >.
Definition at line 193 of file trianglestream.h.
T CS::TriangleIndicesStream< T >::GetIndex | ( | size_t | idx, |
const uint8 * | index | ||
) | const [inline, protected] |
Get element idx, based on index.
Definition at line 99 of file trianglestream.h.
T CS::TriangleIndicesStream< T >::GetNextIndex | ( | ) | [inline, protected] |
Fetch the next index from the index buffer.
Definition at line 63 of file trianglestream.h.
size_t CS::TriangleIndicesStream< T >::GetRemainingComponents | ( | ) | const [inline] |
Get the remaining components in the buffer.
Note that this number does't have to correspond with the remaining number of triangles, especially when dealing with strips or fans.
Definition at line 292 of file trianglestream.h.
bool CS::TriangleIndicesStream< T >::HasNext | ( | ) | const [inline] |
Returns whether a triangle is available.
Reimplemented in CS::TriangleIndicesStreamRandom< T >.
Definition at line 212 of file trianglestream.h.
TriangleT<T> CS::TriangleIndicesStream< T >::Next | ( | ) | [inline] |
Fetches the next triangle from the buffer.
Reimplemented in CS::TriangleIndicesStreamRandom< T >.
Definition at line 219 of file trianglestream.h.