#include <move_container.h>
Inheritance diagram for NLPACS::CMoveContainer:
Nevrax France
Definition at line 56 of file move_container.h.
Public Member Functions | |
UMovePrimitive * | addCollisionablePrimitive (uint8 firstWorldImage, uint8 numWorldImage, const UMovePrimitive *copyFrom=NULL) |
Add a collisionable primitive in the container. Return the pointer on the primitive. | |
void | addCollisionnablePrimitiveBlock (UPrimitiveBlock *pb, uint8 firstWorldImage, uint8 numWorldImage, std::vector< UMovePrimitive * > *primitives, float orientation, const NLMISC::CVector &position, bool dontSnapToGround=false, const NLMISC::CVector &scale=NLMISC::CVector(1.0f, 1.0f, 1.0f)) |
Add a block of collsionnable primitives. | |
UMovePrimitive * | addNonCollisionablePrimitive (const UMovePrimitive *copyFrom=NULL) |
Add a noncollisionable primitive in the container. Return the pointer on the primitive. | |
CMoveElement * | allocateMoveElement () |
Allocate a move element. | |
CMoveContainer (CGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) | |
Init the container with a global retriever. | |
CMoveContainer (double xmin, double ymin, double xmax, double ymax, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) | |
Constructor. | |
void | duplicateWorldImage (uint8 source, uint8 dest) |
Duplicate world image. | |
void | evalCollision (double deltaTime, uint8 worldImage) |
Evaluation of the collision system. | |
bool | evalNCPrimitiveCollision (double deltaTime, UMovePrimitive *primitive, uint8 worldImage) |
void | freeMoveElement (CMoveElement *element) |
Free move element. | |
CGlobalRetriever * | getGlobalRetriever () const |
Get the retriever. | |
uint | getNumTriggerInfo () const |
Get number of trigger informations. | |
virtual void | getPrimitives (std::vector< const UMovePrimitive * > &dest) const |
Get all the primitives in the container. | |
const UTriggerInfo & | getTriggerInfo (uint id) const |
Get the n-th trigger informations. | |
void | init (CGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) |
Init the container with a global retriever. | |
void | init (double xmin, double ymin, double xmax, double ymax, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) |
Init the container without global retriever. | |
bool | loadCollisionablePrimitiveBlock (const char *filename, uint8 firstWorldImage, uint8 numWorldImage, std::vector< UMovePrimitive * > *primitives, float orientation, const NLMISC::CVector &position, bool dontSnapToGround=false) |
Load a block of collisionable primitive. | |
void | removePrimitive (UMovePrimitive *primitive) |
Remove a primitive from the container. | |
void | setAsStatic (uint8 worldImage) |
Set world image as static world image. | |
bool | testMove (UMovePrimitive *primitive, const NLMISC::CVectorD &speed, double deltaTime, uint8 worldImage, NLMISC::CVectorD *contactNormal) |
Make a move test. | |
virtual | ~CMoveContainer () |
Destructor. | |
Static Public Member Functions | |
Create methods. | |
UMoveContainer * | createMoveContainer (UGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage=1, uint maxIteration=100, uint otSize=100) |
UMoveContainer * | createMoveContainer (double xmin, double ymin, double xmax, double ymax, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage=1, uint maxIteration=100, uint otSize=100) |
void | deleteMoveContainer (UMoveContainer *container) |
void | getPACSCoordsFromMatrix (NLMISC::CVector &pos, float &angle, const NLMISC::CMatrix &mat) |
Create methods. | |
UMoveContainer * | createMoveContainer (UGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage=1, uint maxIteration=100, uint otSize=100) |
UMoveContainer * | createMoveContainer (double xmin, double ymin, double xmax, double ymax, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage=1, uint maxIteration=100, uint otSize=100) |
void | deleteMoveContainer (UMoveContainer *container) |
void | getPACSCoordsFromMatrix (NLMISC::CVector &pos, float &angle, const NLMISC::CMatrix &mat) |
Private Member Functions | |
CCollisionOTDynamicInfo * | allocateOTDynamicInfo () |
CCollisionOTStaticInfo * | allocateOTStaticInfo () |
CMovePrimitive * | allocatePrimitive (uint8 firstWorldImage, uint8 numWorldImage) |
CPrimitiveWorldImage * | allocateWorldImage () |
CPrimitiveWorldImage ** | allocateWorldImagesPtrs (uint numPtrs) |
void | changed (CMovePrimitive *primitive, uint8 worldImage) |
void | checkOT () |
void | checkSortedList () |
void | clear () |
void | clearModifiedList (uint8 worldImage) |
void | clearOT () |
void | evalAllCollisions (double beginTime, uint8 worldImage) |
bool | evalOnePrimitiveCollision (double beginTime, CMovePrimitive *primitive, uint8 worldImage, uint8 primitiveWorldImage, bool testMove, bool secondIsStatic, bool &testMoveValid, CCollisionOTDynamicInfo *dynamicColInfo, NLMISC::CVectorD *contactNormal) |
bool | evalOneTerrainCollision (double beginTime, CMovePrimitive *primitive, uint8 primitiveWorldImage, bool testMove, bool &testMoveValid, CCollisionOTStaticInfo *staticColInfo, NLMISC::CVectorD *contactNormal) |
bool | evalPrimAgainstPrimCollision (double beginTime, CMovePrimitive *primitive, CMovePrimitive *otherPrimitive, CPrimitiveWorldImage *wI, CPrimitiveWorldImage *otherWI, bool testMove, uint8 firstWorldImage, uint8 secondWorldImage, bool secondIsStatic, CCollisionOTDynamicInfo *dynamicColInfo, NLMISC::CVectorD *contactNormal) |
void | freeAllOTInfo () |
void | freePrimitive (CMovePrimitive *primitive) |
void | freeWorldImage (CPrimitiveWorldImage *worldImage) |
void | freeWorldImagesPtrs (CPrimitiveWorldImage **ptrs) |
void | getCells (CMovePrimitive *primitive, uint8 worldImage, uint8 primitiveWorldImage, CMoveElement **elementArray) |
void | newCollision (CMovePrimitive *first, const CCollisionSurfaceDesc &desc, uint8 worldImage, double beginTime, CCollisionOTStaticInfo *staticColInfo) |
void | newCollision (CMovePrimitive *first, CMovePrimitive *second, const CCollisionDesc &desc, bool collision, bool enter, bool exit, bool inside, uint firstWorldImage, uint secondWorldImage, bool secondIsStatic, CCollisionOTDynamicInfo *dynamicColInfo) |
void | newTrigger (CMovePrimitive *first, CMovePrimitive *second, const CCollisionDesc &desc, uint triggerType) |
void | reaction (const CCollisionOTInfo &first) |
void | removeFromModifiedList (CMovePrimitive *primitive, uint8 worldImage) |
void | removeModifiedFromOT (uint8 worldImage) |
void | removeNCFromModifiedList (CMovePrimitive *primitive, uint8 worldImage) |
void | unlinkMoveElement (CMoveElement *element, uint8 worldImage) |
void | updateCells (CMovePrimitive *primitive, uint8 worldImage) |
void | updatePrimitives (double deltaTime, uint8 worldImage) |
Private Attributes | |
NLMISC::CPoolMemory< CCollisionOTDynamicInfo > | _AllocOTDynamicInfo |
NLMISC::CPoolMemory< CCollisionOTStaticInfo > | _AllocOTStaticInfo |
uint | _CellCountHeight |
uint | _CellCountWidth |
Cells count. | |
double | _CellHeight |
double | _CellWidth |
Cells width and height. | |
std::vector< CMovePrimitive * > | _ChangedRoot |
Root of modified primitive for each world image. | |
double | _DeltaTime |
Current deltaTime. | |
uint32 | _MaxTestIteration |
Max test iterations. | |
uint | _OtSize |
The time ordered table size. | |
CCollisionOT * | _PreviousCollisionNode |
Previous collision node in the OT. | |
double | _PrimitiveMaxSize |
Max primitive size. | |
std::set< CMovePrimitive * > | _PrimitiveSet |
Set of primitives. | |
CGlobalRetriever * | _Retriever |
Retriver pointner. | |
std::set< uint8 > | _StaticWorldImage |
Set of primitives. | |
CCollisionSurfaceTemp | _SurfaceTemp |
uint32 | _TestTime |
Current test time. | |
std::vector< CCollisionOT > | _TimeOT |
The time ordered table. | |
std::vector< UTriggerInfo > | _Triggers |
Memory manager for CCollisionOTInfo. | |
std::vector< std::vector< CMoveCell > > | _VectorCell |
Cells array. | |
double | _Xmax |
double | _Xmin |
Area size. | |
double | _Ymax |
double | _Ymin |
Friends | |
class | CMovePrimitive |
class | CPrimitiveWorldImage |
|
Constructor.
Definition at line 62 of file move_container.h. References init(), uint, and uint8.
00064 { 00065 init (xmin, ymin, xmax, ymax, widthCellCount, heightCellCount, primitiveMaxSize, numWorldImage, maxIteration, otSize); 00066 } |
|
Init the container with a global retriever.
Definition at line 69 of file move_container.h. References init(), uint, and uint8.
00071 { 00072 init (retriever, widthCellCount, heightCellCount, primitiveMaxSize, numWorldImage, maxIteration, otSize); 00073 } |
|
Destructor.
|
|
Add a collisionable primitive in the container. Return the pointer on the primitive.
Implements NLPACS::UMoveContainer. |
|
Add a block of collsionnable primitives.
Implements NLPACS::UMoveContainer. |
|
Add a noncollisionable primitive in the container. Return the pointer on the primitive.
Implements NLPACS::UMoveContainer. |
|
Allocate a move element.
Referenced by NLPACS::CPrimitiveWorldImage::addMoveElement(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 36 of file move_container_inline.h. References _ChangedRoot, NLPACS::CMovePrimitive::getWorldImage(), NLPACS::CMovePrimitive::isCollisionable(), NLPACS::CPrimitiveWorldImage::isInModifiedListFlag(), NLPACS::CPrimitiveWorldImage::linkInModifiedList(), NLPACS::CPrimitiveWorldImage::setInModifiedListFlag(), and uint8. Referenced by NLPACS::CPrimitiveWorldImage::dirtBB().
00037 { 00038 // Primitive noncollisionable ? 00039 if (primitive->isCollisionable()) 00040 { 00041 // Get the world image 00042 CPrimitiveWorldImage *wI; 00043 00044 wI=primitive->getWorldImage (worldImage); 00045 00046 // Not yet in the list ? 00047 if (!wI->isInModifiedListFlag ()) 00048 { 00049 // Flag it 00050 wI->setInModifiedListFlag (true); 00051 00052 // Link it 00053 wI->linkInModifiedList (_ChangedRoot[worldImage]); 00054 00055 // Change root list 00056 _ChangedRoot[worldImage]=primitive; 00057 } 00058 } 00059 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Duplicate world image.
Implements NLPACS::UMoveContainer. |
|
|
|
Evaluation of the collision system.
Implements NLPACS::UMoveContainer. |
|
Evaluation of a single non collisionable primitive. The method test first collisions against the terrai, then test collisions against primitives inserted in the world images declared as static, then test the collision against the primitives inserted in the world image to evaluate.
Implements NLPACS::UMoveContainer. |
|
|
|
|
|
|
|
|
|
Free move element.
Referenced by NLPACS::CPrimitiveWorldImage::removeMoveElement(). |
|
|
|
|
|
|
|
|
|
Get the retriever.
Definition at line 124 of file move_container.h. Referenced by NLPACS::CPrimitiveWorldImage::setGlobalPosition().
00125 { 00126 return _Retriever; 00127 } |
|
Get number of trigger informations.
Implements NLPACS::UMoveContainer. Definition at line 130 of file move_container.h. References _Triggers, and uint.
00131 { 00132 return _Triggers.size(); 00133 } |
|
Get a pacs position and an orientation from a matrix |
|
Get all the primitives in the container.
Implements NLPACS::UMoveContainer. |
|
Get the n-th trigger informations.
Implements NLPACS::UMoveContainer. Definition at line 136 of file move_container.h. References _Triggers, nlassert, and uint.
|
|
Init the container with a global retriever.
|
|
Init the container without global retriever.
Referenced by CMoveContainer(). |
|
Load a block of collisionable primitive.
Implements NLPACS::UMoveContainer. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove a primitive from the container.
Implements NLPACS::UMoveContainer. |
|
Set world image as static world image.
Implements NLPACS::UMoveContainer. |
|
Make a move test.
Implements NLPACS::UMoveContainer. |
|
Referenced by NLPACS::CPrimitiveWorldImage::removeMoveElement(). |
|
|
|
|
|
Definition at line 58 of file move_container.h. |
|
Definition at line 59 of file move_container.h. |
|
Definition at line 201 of file move_container.h. |
|
Definition at line 202 of file move_container.h. |
|
Definition at line 190 of file move_container.h. |
|
Cells count.
Definition at line 189 of file move_container.h. |
|
Definition at line 186 of file move_container.h. |
|
Cells width and height.
Definition at line 185 of file move_container.h. |
|
Root of modified primitive for each world image.
Definition at line 158 of file move_container.h. Referenced by changed(). |
|
Current deltaTime.
Definition at line 173 of file move_container.h. |
|
Max test iterations.
Definition at line 152 of file move_container.h. |
|
The time ordered table size.
Definition at line 164 of file move_container.h. |
|
Previous collision node in the OT.
Definition at line 170 of file move_container.h. |
|
Max primitive size.
Definition at line 176 of file move_container.h. |
|
Set of primitives.
Definition at line 155 of file move_container.h. |
|
Retriver pointner.
Definition at line 196 of file move_container.h. |
|
Set of primitives.
Definition at line 161 of file move_container.h. |
|
Definition at line 197 of file move_container.h. |
|
Current test time.
Definition at line 149 of file move_container.h. |
|
The time ordered table.
Definition at line 167 of file move_container.h. |
|
Memory manager for CCollisionOTInfo.
Definition at line 200 of file move_container.h. Referenced by getNumTriggerInfo(), and getTriggerInfo(). |
|
Cells array.
Definition at line 193 of file move_container.h. |
|
Definition at line 181 of file move_container.h. |
|
Area size.
Definition at line 179 of file move_container.h. |
|
Definition at line 182 of file move_container.h. |
|
Definition at line 180 of file move_container.h. |