"L. Spiro Engine"
Public Member Functions | Protected Member Functions | Protected Attributes

lsg::CTriangleStripper Class Reference

Creates a single one-sided triangle strip. More...

#include <LSGTriangleStripper.h>

List of all members.

Public Member Functions

LSBOOL LSE_CALL InitTriangleStripper (LSUINT32 _ui32Faces=0UL, const LSUINT32 *_pui32Faces=NULL, const LSUINT16 *_pui16Faces=NULL)
LSBOOL LSE_CALL Compute ()
LSE_INLINE LSUINT32 LSE_CALL TotalIndices () const
LSE_INLINE const LSUINT16 *LSE_CALL IndicesAsWords () const
LSE_INLINE const LSUINT32 *LSE_CALL IndicesAsDoubleWords () const

Protected Member Functions

LSUINT32 LSE_CALL GetStripLength (LSUINT32 _ui32Face, LSUINT32 _ui32Oldest, LSUINT32 _ui32Middle, LSUINT32 *_pui32Strip, LSUINT32 *_pui32Faces, LSUINT8 *_pui8Tags)
LSUINT32 LSE_CALL GetBestStrip (LSUINT32 _ui32Face, LSUINT32 *_pui32TempFaceBuffer, LSUINT32 *_pui32BestFaceBuffer, LSUINT32 *_pui32TempStripBuffer, LSUINT32 *_pui32BestStripBuffer, LSUINT8 *_pui8TempTagsBuffer, LSUINT8 *_pui8Tags, LSUINT32 &_ui32StripLen)
LSBOOL LSE_CALL ConnectStrip (CVectorPoD< LSUINT32, LSUINT32, 1024UL > &_vLeft, LSUINT32 *_pui32Right, LSUINT32 _ui32RightLen)

Protected Attributes

CStripAdjacency m_saAdj
CVectorPoD< LSUINT8, LSUINT32 > m_vVerts
LSBOOL m_bWords

Detailed Description

Creates a single one-sided triangle strip.

Class CTriangleStripper Description: Creates a single one-sided triangle strip. Code based on Pierre Terdiman's original work.


Member Function Documentation

LSBOOL LSE_CALL lsg::CTriangleStripper::Compute ( )

Create the triangle strip. After a successful call to this function, the created triangle strip can be read directly.

Returns:
Returns true if there were no memory failures during the operation.
LSBOOL LSE_CALL lsg::CTriangleStripper::ConnectStrip ( CVectorPoD< LSUINT32, LSUINT32, 1024UL > &  _vLeft,
LSUINT32 *  _pui32Right,
LSUINT32  _ui32RightLen 
) [protected]

Connect one strip to another.

Parameters:
_vLeftThe first strip to connect to the second.
_pui32RightSecond strip to connect.
_ui32RightLenLength of the second strip to connect.
Returns:
Returns false if there was not enough memory to perform the operation.
LSUINT32 LSE_CALL lsg::CTriangleStripper::GetBestStrip ( LSUINT32  _ui32Face,
LSUINT32 *  _pui32TempFaceBuffer,
LSUINT32 *  _pui32BestFaceBuffer,
LSUINT32 *  _pui32TempStripBuffer,
LSUINT32 *  _pui32BestStripBuffer,
LSUINT8 *  _pui8TempTagsBuffer,
LSUINT8 *  _pui8Tags,
LSUINT32 &  _ui32StripLen 
) [protected]

Determine the best strip starting at the given face.

Parameters:
_ui32FaceThe face where to start searching.
_pui32TempFaceBufferBuffer to hold faces for checking strip lengths.
_pui32BestFaceBufferBest face buffer found. Output.
_pui32TempStripBufferBuffer to hold strips for checking strip lengths.
_pui32BestStripBufferBest strip buffer found. Output.
_pui8TempTagsBufferBuffer to hold tags for checking strip lengths.
_pui8TagsThe master copy of the tags buffer. Updated with the longest strip's details.
_ui32StripLenThe length of the longest strip. Output.
Returns:
Returns the number of faces in the strip.
LSUINT32 LSE_CALL lsg::CTriangleStripper::GetStripLength ( LSUINT32  _ui32Face,
LSUINT32  _ui32Oldest,
LSUINT32  _ui32Middle,
LSUINT32 *  _pui32Strip,
LSUINT32 *  _pui32Faces,
LSUINT8 *  _pui8Tags 
) [protected]

Get the length of a triangle if extended from the given face in the given direction.

Parameters:
_ui32FaceIndex of the face where to start checking.
_ui32OldestFirst index of the strip.
_ui32MiddleSecond index of the strip.
_pui32StripBuffer in which to store the strip.
_pui32FacesBuffer in which to store the faces.
_pui8TagsBuffer to use to keep track of tagged faces.
Returns:
Returns the length of the strip.
LSE_INLINE const LSUINT32 *LSE_CALL lsg::CTriangleStripper::IndicesAsDoubleWords ( ) const

Get the indices as a double-word size.

Returns:
Returns the indices as a double-word size.
LSE_INLINE const LSUINT16 *LSE_CALL lsg::CTriangleStripper::IndicesAsWords ( ) const

Get the indices as a word size.

Returns:
Returns the indices as a word size.
LSBOOL LSE_CALL lsg::CTriangleStripper::InitTriangleStripper ( LSUINT32  _ui32Faces = 0UL,
const LSUINT32 *  _pui32Faces = NULL,
const LSUINT16 *  _pui16Faces = NULL 
)

Initialize the triangle stripper.

Parameters:
_ui32FacesNumber of triangles.
_pui32FacesPointer to the triangles with 32-bit indices or NULL.
_pui16FacesPointer to the triangles with 16-bit indices or NULL.
Returns:
Returns false if there are not enough resources to complete the setup.
LSE_INLINE LSUINT32 LSE_CALL lsg::CTriangleStripper::TotalIndices ( ) const

Get the total indices.

Returns:
Returns the total indices.

Member Data Documentation

Use words?

The adjacency information.

CVectorPoD<LSUINT8, LSUINT32> lsg::CTriangleStripper::m_vVerts [protected]

The final vertices.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator