a quadgrid of list of edge chain. More...
#include <edge_quad.h>
Public Member Functions | |
| CEdgeQuad () | |
| Constructor. | |
| CEdgeQuad (const CEdgeQuad &o) | |
| Copy Constructor. | |
| ~CEdgeQuad () | |
| Destructor. | |
| CEdgeQuad & | operator= (const CEdgeQuad &o) |
| operator=. | |
| void | clear () |
| clear | |
| void | build (const CExteriorMesh &em, const CGlobalRetriever &global, CCollisionSurfaceTemp &cst, uint32 thisInstance) |
| build a chain quad, with a list of exterior Edges and the global retriever | |
| sint | selectEdges (const NLMISC::CAABBox &bbox, CCollisionSurfaceTemp &cst) const |
| look in the quad to select a list of chain from a bbox. | |
| sint | selectEdges (CVector start, CVector end, CCollisionSurfaceTemp &cst) const |
| look in the quad to select a list of chain from a line. | |
| const std::vector < CExteriorEdgeEntry > & | getEdgeEntries () const |
| Get the whole set of edge entries. | |
| const CExteriorEdgeEntry & | getEdgeEntry (uint entry) const |
| Get a single edge entry. | |
| void | serial (NLMISC::IStream &f) |
| serial. | |
| void | removeLinks (sint32 instanceId) |
| void | removeLinks () |
Private Member Functions | |
| void | getGridBounds (sint32 &x0, sint32 &y0, sint32 &x1, sint32 &y1, const CVector &minP, const CVector &maxP) const |
Private Attributes | |
| std::vector< uint8 * > | _Quad |
| W*H pointers on array of CExteriorEdgeEntry indexes. | |
| std::vector< CExteriorEdgeEntry > | _EdgeEntries |
| The real exterior edge entries. | |
| uint32 | _Width |
| Width of the quadgrid. | |
| uint32 | _Height |
| Height of the quadgrid. | |
| sint32 | _X |
| Postion of the chainquad. | |
| sint32 | _Y |
| uint8 * | _QuadData |
| Single memory block of CExteriorEdgeEntry chains. | |
| uint32 | _QuadDataLen |
| size (in byte) of _QuadData. | |
Static Private Attributes | |
| static const float | _QuadElementSize = 4 |
a quadgrid of list of edge chain.
Definition at line 59 of file edge_quad.h.
| NLPACS::CEdgeQuad::CEdgeQuad | ( | ) |
| NLPACS::CEdgeQuad::CEdgeQuad | ( | const CEdgeQuad & | o | ) |
Copy Constructor.
Definition at line 53 of file edge_quad.cpp.
References _QuadData, and _QuadDataLen.
| NLPACS::CEdgeQuad::~CEdgeQuad | ( | ) |
| void NLPACS::CEdgeQuad::build | ( | const CExteriorMesh & | em, | |
| const CGlobalRetriever & | global, | |||
| CCollisionSurfaceTemp & | cst, | |||
| uint32 | thisInstance | |||
| ) |
build a chain quad, with a list of exterior Edges and the global retriever
Definition at line 128 of file edge_quad.cpp.
References _EdgeEntries, _Height, _Quad, _QuadData, _QuadDataLen, _QuadElementSize, _Width, _X, _Y, NLPACS::CCollisionSurfaceDesc::ContactSurface, NLPACS::CCollisionSurfaceDesc::ContactTime, NLMISC::contReset(), NLMISC::CAABBox::extend(), NLPACS::CExteriorMesh::getEdges(), getGridBounds(), NLPACS::CGlobalRetriever::getInstance(), NLPACS::CExteriorMesh::getLink(), NLMISC::CAABBox::getMax(), NLMISC::CAABBox::getMin(), NLPACS::CRetrieverInstance::getOrigin(), NLPACS::UGlobalPosition::InstanceId, NLPACS::UGlobalPosition::LocalPosition, NLMISC::CVector::maxof(), NLMISC::CVector::minof(), nlerror, nlinfo, nlwarning, NLPACS::CGlobalRetriever::retrievePosition(), NLPACS::CSurfaceIdent::RetrieverInstanceId, NLMISC::CAABBox::setCenter(), NLPACS::ULocalPosition::Surface, NLPACS::CSurfaceIdent::SurfaceId, NLPACS::CGlobalRetriever::testCylinderMove(), NLPACS::CGlobalRetriever::updateHeight(), NLMISC::CVector::x, and NLMISC::CVector::y.
Referenced by NLPACS::CRetrieverInstance::initEdgeQuad().
| void NLPACS::CEdgeQuad::clear | ( | void | ) |
clear
Definition at line 98 of file edge_quad.cpp.
References _EdgeEntries, _Height, _Quad, _QuadData, _QuadDataLen, _Width, _X, and _Y.
Referenced by NLPACS::CRetrieverInstance::reset(), and ~CEdgeQuad().
| const std::vector<CExteriorEdgeEntry>& NLPACS::CEdgeQuad::getEdgeEntries | ( | ) | const [inline] |
Get the whole set of edge entries.
Definition at line 102 of file edge_quad.h.
References _EdgeEntries.
Referenced by NLPACS::CRetrieverInstance::linkEdgeQuad().
| const CExteriorEdgeEntry& NLPACS::CEdgeQuad::getEdgeEntry | ( | uint | entry | ) | const [inline] |
Get a single edge entry.
Definition at line 104 of file edge_quad.h.
References _EdgeEntries.
Referenced by NLPACS::CRetrieverInstance::testExteriorCollision().
| void NLPACS::CEdgeQuad::getGridBounds | ( | sint32 & | x0, | |
| sint32 & | y0, | |||
| sint32 & | x1, | |||
| sint32 & | y1, | |||
| const CVector & | minP, | |||
| const CVector & | maxP | |||
| ) | const [private] |
Definition at line 113 of file edge_quad.cpp.
References _Height, _QuadElementSize, _Width, _X, _Y, min, NLMISC::CVector::x, and NLMISC::CVector::y.
Referenced by build(), and selectEdges().
operator=.
Definition at line 60 of file edge_quad.cpp.
References _EdgeEntries, _Height, _Quad, _QuadData, _QuadDataLen, _Width, _X, and _Y.
| void NLPACS::CEdgeQuad::removeLinks | ( | ) | [inline] |
Definition at line 125 of file edge_quad.h.
References _EdgeEntries.
| void NLPACS::CEdgeQuad::removeLinks | ( | sint32 | instanceId | ) | [inline] |
Definition at line 111 of file edge_quad.h.
References _EdgeEntries.
Referenced by NLPACS::CRetrieverInstance::resetLinks().
| sint NLPACS::CEdgeQuad::selectEdges | ( | CVector | start, | |
| CVector | end, | |||
| CCollisionSurfaceTemp & | cst | |||
| ) | const |
look in the quad to select a list of chain from a line.
NB: The outpout do not contains any redundant edge. An edge appears only one time in the result.
| start | the starting point of the selection segment. | |
| end | the ending point of the selection segment. | |
| cst | the array of CExteriorEdgeEntry to fill. contain also OChainLUT, an array for internal use. In: must be filled with 0xFFFF. Out: still filled with 0xFFFF. |
Definition at line 463 of file edge_quad.cpp.
References _Height, _Quad, _QuadElementSize, _Width, _X, _Y, NLPACS::CCollisionSurfaceTemp::ExteriorEdgeIndexes, NLPACS::CCollisionSurfaceTemp::OChainLUT, NLMISC::CVector::x, and NLMISC::CVector::y.
| sint NLPACS::CEdgeQuad::selectEdges | ( | const NLMISC::CAABBox & | bbox, | |
| CCollisionSurfaceTemp & | cst | |||
| ) | const |
look in the quad to select a list of chain from a bbox.
NB: The outpout do not contains any redundant edge. An edge appears only one time in the result.
| bbox | the area of interest. | |
| cst | the array of CExteriorEdgeEntry to fill. contain also OChainLUT, an array for internal use. In: must be filled with 0xFFFF. Out: still filled with 0xFFFF. |
Definition at line 408 of file edge_quad.cpp.
References _Quad, _Width, NLPACS::CCollisionSurfaceTemp::ExteriorEdgeIndexes, getGridBounds(), NLMISC::CAABBox::getMax(), NLMISC::CAABBox::getMin(), and NLPACS::CCollisionSurfaceTemp::OChainLUT.
Referenced by NLPACS::CRetrieverInstance::testExteriorCollision().
| void NLPACS::CEdgeQuad::serial | ( | NLMISC::IStream & | f | ) |
serial.
Definition at line 569 of file edge_quad.cpp.
References _EdgeEntries, _Height, _Quad, _QuadData, _QuadDataLen, _Width, _X, _Y, NLMISC::contReset(), NLMISC::IStream::isReading(), NLMISC::IStream::serial(), NLMISC::IStream::serialCont(), NLMISC::IStream::serialVersion(), and void().
std::vector<CExteriorEdgeEntry> NLPACS::CEdgeQuad::_EdgeEntries [private] |
The real exterior edge entries.
Definition at line 143 of file edge_quad.h.
Referenced by build(), clear(), getEdgeEntries(), getEdgeEntry(), operator=(), removeLinks(), and serial().
uint32 NLPACS::CEdgeQuad::_Height [private] |
Height of the quadgrid.
Definition at line 147 of file edge_quad.h.
Referenced by build(), clear(), getGridBounds(), operator=(), selectEdges(), and serial().
std::vector<uint8*> NLPACS::CEdgeQuad::_Quad [private] |
W*H pointers on array of CExteriorEdgeEntry indexes.
NULL if no edge in this quad. Each array is 1xuint16(LEN) + LEN*CExteriorEdgeEntryIndex(16 bits).
Definition at line 141 of file edge_quad.h.
Referenced by build(), clear(), operator=(), selectEdges(), and serial().
uint8* NLPACS::CEdgeQuad::_QuadData [private] |
Single memory block of CExteriorEdgeEntry chains.
Definition at line 151 of file edge_quad.h.
Referenced by build(), CEdgeQuad(), clear(), operator=(), and serial().
uint32 NLPACS::CEdgeQuad::_QuadDataLen [private] |
size (in byte) of _QuadData.
Definition at line 153 of file edge_quad.h.
Referenced by build(), CEdgeQuad(), clear(), operator=(), and serial().
const float NLPACS::CEdgeQuad::_QuadElementSize = 4 [static, private] |
Definition at line 156 of file edge_quad.h.
Referenced by build(), getGridBounds(), and selectEdges().
uint32 NLPACS::CEdgeQuad::_Width [private] |
Width of the quadgrid.
Definition at line 145 of file edge_quad.h.
Referenced by build(), clear(), getGridBounds(), operator=(), selectEdges(), and serial().
sint32 NLPACS::CEdgeQuad::_X [private] |
Postion of the chainquad.
Definition at line 149 of file edge_quad.h.
Referenced by build(), clear(), getGridBounds(), operator=(), selectEdges(), and serial().
sint32 NLPACS::CEdgeQuad::_Y [private] |
Definition at line 149 of file edge_quad.h.
Referenced by build(), clear(), getGridBounds(), operator=(), selectEdges(), and serial().
1.6.1