|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NLPACS::CMoveContainer Class ReferenceA container for movable objects Some constraints: * The move bounding box must be lower than the cell size.
More...
#include <move_container.h>
Inheritance diagram for NLPACS::CMoveContainer:
List of all members.
Public Methods |
| CMoveContainer (double xmin, double ymin, double xmax, double ymax, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) |
| Constructor. More...
|
| CMoveContainer (CGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) |
| Init the container with a global retriever. More...
|
virtual | ~CMoveContainer () |
| Destructor. More...
|
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. More...
|
void | init (CGlobalRetriever *retriever, uint widthCellCount, uint heightCellCount, double primitiveMaxSize, uint8 numWorldImage, uint maxIteration, uint otSize) |
| Init the container with a global retriever. More...
|
UMovePrimitive * | addCollisionablePrimitive (uint8 firstWorldImage, uint8 numWorldImage, const UMovePrimitive *copyFrom=NULL) |
| Add a collisionable primitive in the container. Return the pointer on the primitive. More...
|
UMovePrimitive * | addNonCollisionablePrimitive (const UMovePrimitive *copyFrom=NULL) |
| Add a noncollisionable primitive in the container. Return the pointer on the primitive. More...
|
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. More...
|
void | addCollisionnablePrimitiveBlock (UPrimitiveBlock *pb, uint8 firstWorldImage, uint8 numWorldImage, std::vector< UMovePrimitive * > *primitives, float orientation, const NLMISC::CVector &position, bool dontSnapToGround=false) |
| Add a block of collsionnable primitives. More...
|
void | setAsStatic (uint8 worldImage) |
| Raise Trigger ! For collisionnable primitives, trigger are raised here (in reaction) because this is the moment we are sure the collision happened. More...
|
void | duplicateWorldImage (uint8 source, uint8 dest) |
| Duplicate world image. More...
|
void | removePrimitive (UMovePrimitive *primitive) |
| Remove a primitive from the container. More...
|
void | evalCollision (double deltaTime, uint8 worldImage) |
| Evaluation of the collision system. More...
|
bool | evalNCPrimitiveCollision (double deltaTime, UMovePrimitive *primitive, uint8 worldImage) |
| Evaluation of a single non collisionable primitive. More...
|
bool | testMove (UMovePrimitive *primitive, const NLMISC::CVectorD &speed, double deltaTime, uint8 worldImage, NLMISC::CVectorD *contactNormal) |
| Make a move test. More...
|
CMoveElement * | allocateMoveElement () |
| Allocate a move element. More...
|
void | freeMoveElement (CMoveElement *element) |
| Free move element. More...
|
CGlobalRetriever * | getGlobalRetriever () const |
| Get the retriever. More...
|
uint | getNumTriggerInfo () const |
| Get number of trigger informations. More...
|
const UTriggerInfo & | getTriggerInfo (uint id) const |
| Get the n-th trigger informations. More...
|
virtual void | getPrimitives (std::vector< const UMovePrimitive * > &dest) const |
| Get all the primitives in the container. More...
|
Private Methods |
void | clear () |
void | updatePrimitives (double deltaTime, uint8 worldImage) |
void | updateCells (CMovePrimitive *primitive, uint8 worldImage) |
void | getCells (CMovePrimitive *primitive, uint8 worldImage, uint8 primitiveWorldImage, CMoveElement **elementArray) |
void | clearOT () |
void | checkOT () |
bool | evalOneTerrainCollision (double beginTime, CMovePrimitive *primitive, uint8 primitiveWorldImage, bool testMove, bool &testMoveValid, CCollisionOTStaticInfo *staticColInfo, NLMISC::CVectorD *contactNormal) |
bool | evalOnePrimitiveCollision (double beginTime, CMovePrimitive *primitive, uint8 worldImage, uint8 primitiveWorldImage, bool testMove, bool secondIsStatic, bool &testMoveValid, CCollisionOTDynamicInfo *dynamicColInfo, 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 | evalAllCollisions (double beginTime, uint8 worldImage) |
| Raise Trigger ! For collisionnable primitives, trigger are raised here (in reaction) because this is the moment we are sure the collision happened. More...
|
void | newCollision (CMovePrimitive *first, CMovePrimitive *second, const CCollisionDesc &desc, bool collision, bool enter, bool exit, uint firstWorldImage, uint secondWorldImage, bool secondIsStatic, CCollisionOTDynamicInfo *dynamicColInfo) |
void | newCollision (CMovePrimitive *first, const CCollisionSurfaceDesc &desc, uint8 worldImage, double beginTime, CCollisionOTStaticInfo *staticColInfo) |
void | newTrigger (CMovePrimitive *first, CMovePrimitive *second, const CCollisionDesc &desc, uint triggerType) |
void | clearModifiedList (uint8 worldImage) |
void | removeModifiedFromOT (uint8 worldImage) |
void | checkSortedList () |
CCollisionOTDynamicInfo * | allocateOTDynamicInfo () |
CCollisionOTStaticInfo * | allocateOTStaticInfo () |
void | freeAllOTInfo () |
CMovePrimitive * | allocatePrimitive (uint8 firstWorldImage, uint8 numWorldImage) |
void | freePrimitive (CMovePrimitive *primitive) |
CPrimitiveWorldImage ** | allocateWorldImagesPtrs (uint numPtrs) |
void | freeWorldImagesPtrs (CPrimitiveWorldImage **ptrs) |
CPrimitiveWorldImage * | allocateWorldImage () |
void | freeWorldImage (CPrimitiveWorldImage *worldImage) |
void | changed (CMovePrimitive *primitive, uint8 worldImage) |
void | removeFromModifiedList (CMovePrimitive *primitive, uint8 worldImage) |
void | removeNCFromModifiedList (CMovePrimitive *primitive, uint8 worldImage) |
void | unlinkMoveElement (CMoveElement *element, uint8 worldImage) |
void | reaction (const CCollisionOTInfo &first) |
Private Attributes |
uint32 | _TestTime |
| Current test time. More...
|
uint32 | _MaxTestIteration |
| Max test iterations. More...
|
std::set< CMovePrimitive * > | _PrimitiveSet |
| Set of primitives. More...
|
std::vector< CMovePrimitive * > | _ChangedRoot |
| Root of modified primitive for each world image. More...
|
std::set< uint8 > | _StaticWorldImage |
| Set of primitives. More...
|
uint | _OtSize |
| The time ordered table size. More...
|
std::vector< CCollisionOT > | _TimeOT |
| The time ordered table. More...
|
CCollisionOT * | _PreviousCollisionNode |
| Previous collision node in the OT. More...
|
double | _DeltaTime |
| Current deltaTime. More...
|
double | _PrimitiveMaxSize |
| Max primitive size. More...
|
double | _Xmin |
| Area size. More...
|
double | _Ymin |
double | _Xmax |
double | _Ymax |
double | _CellWidth |
| Cells width and height. More...
|
double | _CellHeight |
uint | _CellCountWidth |
| Cells count. More...
|
uint | _CellCountHeight |
std::vector< std::vector<
CMoveCell > > | _VectorCell |
| Cells array. More...
|
CGlobalRetriever * | _Retriever |
| Retriver pointner. More...
|
CCollisionSurfaceTemp | _SurfaceTemp |
std::vector< UTriggerInfo > | _Triggers |
| Memory manager for CCollisionOTInfo. More...
|
NLMISC::CPoolMemory< CCollisionOTDynamicInfo > | _AllocOTDynamicInfo |
NLMISC::CPoolMemory< CCollisionOTStaticInfo > | _AllocOTStaticInfo |
Friends |
class | CMovePrimitive |
class | CPrimitiveWorldImage |
Detailed Description
A container for movable objects Some constraints: * The move bounding box must be lower than the cell size.
-
Author:
-
Cyril 'Hulud' Corvazier , Nevrax France
-
Date:
-
2001
Definition at line 56 of file move_container.h.
Constructor & Destructor Documentation
NLPACS::CMoveContainer::CMoveContainer |
( |
double |
xmin, |
|
|
double |
ymin, |
|
|
double |
xmax, |
|
|
double |
ymax, |
|
|
uint |
widthCellCount, |
|
|
uint |
heightCellCount, |
|
|
double |
primitiveMaxSize, |
|
|
uint8 |
numWorldImage, |
|
|
uint |
maxIteration, |
|
|
uint |
otSize |
|
) |
[inline] |
|
NLPACS::CMoveContainer::CMoveContainer |
( |
CGlobalRetriever * |
retriever, |
|
|
uint |
widthCellCount, |
|
|
uint |
heightCellCount, |
|
|
double |
primitiveMaxSize, |
|
|
uint8 |
numWorldImage, |
|
|
uint |
maxIteration, |
|
|
uint |
otSize |
|
) |
[inline] |
|
NLPACS::CMoveContainer::~CMoveContainer |
( |
|
) |
[virtual] |
|
Member Function Documentation
CMoveElement * NLPACS::CMoveContainer::allocateMoveElement |
( |
|
) |
|
|
void NLPACS::CMoveContainer::changed |
( |
CMovePrimitive * |
primitive, |
|
|
uint8 |
worldImage |
|
) |
[inline, private] |
|
void NLPACS::CMoveContainer::checkOT |
( |
|
) |
[private] |
|
void NLPACS::CMoveContainer::checkSortedList |
( |
|
) |
[private] |
|
void NLPACS::CMoveContainer::clear |
( |
|
) |
[private] |
|
void NLPACS::CMoveContainer::clearModifiedList |
( |
uint8 |
worldImage |
) |
[private] |
|
void NLPACS::CMoveContainer::clearOT |
( |
|
) |
[private] |
|
void NLPACS::CMoveContainer::duplicateWorldImage |
( |
uint8 |
source, |
|
|
uint8 |
dest |
|
) |
[virtual] |
|
void NLPACS::CMoveContainer::evalAllCollisions |
( |
double |
beginTime, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
|
Raise Trigger ! For collisionnable primitives, trigger are raised here (in reaction) because this is the moment we are sure the collision happened.
For non collisionable primitves, the trigger is raised at collision time because without OT, we can't stop evaluating collision on triggers.
Definition at line 908 of file move_container.cpp.
References _ChangedRoot, _DeltaTime, _Retriever, _StaticWorldImage, _SurfaceTemp, CMovePrimitive, CPrimitiveWorldImage, evalOnePrimitiveCollision, evalOneTerrainCollision, and nlassert.
Referenced by evalCollision. |
void NLPACS::CMoveContainer::evalCollision |
( |
double |
deltaTime, |
|
|
uint8 |
worldImage |
|
) |
[virtual] |
|
|
Evaluation of the collision system.
Implements NLPACS::UMoveContainer.
Definition at line 158 of file move_container.cpp.
References _ChangedRoot, _DeltaTime, _PreviousCollisionNode, _TestTime, _TimeOT, _Triggers, checkOT, clearModifiedList, evalAllCollisions, freeAllOTInfo, nlassert, reaction, removeModifiedFromOT, and updatePrimitives. |
bool NLPACS::CMoveContainer::evalNCPrimitiveCollision |
( |
double |
deltaTime, |
|
|
UMovePrimitive * |
primitive, |
|
|
uint8 |
worldImage |
|
) |
[virtual] |
|
|
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. -
Parameters:
-
deltaTime |
is the delta time of the system evaluation. |
primitive |
is the prmitive pointer |
worldImage |
is the world image to eval. |
-
Returns:
-
false if the primitive is a collisionable primitive.
Implements NLPACS::UMoveContainer.
Definition at line 1826 of file move_container.cpp.
References _DeltaTime, _Retriever, _StaticWorldImage, _SurfaceTemp, _TestTime, _Triggers, CMovePrimitive, CPrimitiveWorldImage, evalOnePrimitiveCollision, evalOneTerrainCollision, nlassert, and reaction. |
|
Definition at line 616 of file move_container.cpp.
References _DeltaTime, _MaxTestIteration, _Retriever, _SurfaceTemp, _TestTime, CPrimitiveWorldImage, newCollision, nlassert, and NLPACS::TCollisionSurfaceDescVector.
Referenced by evalAllCollisions, evalNCPrimitiveCollision, and testMove. |
bool NLPACS::CMoveContainer::evalPrimAgainstPrimCollision |
( |
double |
beginTime, |
|
|
CMovePrimitive * |
primitive, |
|
|
CMovePrimitive * |
otherPrimitive, |
|
|
CPrimitiveWorldImage * |
wI, |
|
|
CPrimitiveWorldImage * |
otherWI, |
|
|
bool |
testMove, |
|
|
uint8 |
firstWorldImage, |
|
|
uint8 |
secondWorldImage, |
|
|
bool |
secondIsStatic, |
|
|
CCollisionOTDynamicInfo * |
dynamicColInfo, |
|
|
NLMISC::CVectorD * |
contactNormal |
|
) |
[private] |
|
void NLPACS::CMoveContainer::freeAllOTInfo |
( |
|
) |
[private] |
|
void NLPACS::CMoveContainer::freeMoveElement |
( |
CMoveElement * |
element |
) |
|
|
void NLPACS::CMoveContainer::freePrimitive |
( |
CMovePrimitive * |
primitive |
) |
[private] |
|
|
Definition at line 488 of file move_container.cpp.
References _CellCountHeight, _CellCountWidth, _CellHeight, _CellWidth, _VectorCell, _Xmin, _Ymin, CPrimitiveWorldImage, min, nlassert, nlwarning, x, and y.
Referenced by evalOnePrimitiveCollision. |
uint NLPACS::CMoveContainer::getNumTriggerInfo |
( |
|
) |
const [inline, virtual] |
|
void NLPACS::CMoveContainer::getPrimitives |
( |
std::vector< const UMovePrimitive * > & |
dest |
) |
const [virtual] |
|
const UTriggerInfo& NLPACS::CMoveContainer::getTriggerInfo |
( |
uint |
id |
) |
const [inline, virtual] |
|
void NLPACS::CMoveContainer::init |
( |
CGlobalRetriever * |
retriever, |
|
|
uint |
widthCellCount, |
|
|
uint |
heightCellCount, |
|
|
double |
primitiveMaxSize, |
|
|
uint8 |
numWorldImage, |
|
|
uint |
maxIteration, |
|
|
uint |
otSize |
|
) |
|
|
void NLPACS::CMoveContainer::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.
Definition at line 83 of file move_container.cpp.
References _CellCountHeight, _CellCountWidth, _CellHeight, _CellWidth, _ChangedRoot, _MaxTestIteration, _OtSize, _PrimitiveMaxSize, _Retriever, _TestTime, _TimeOT, _Triggers, _VectorCell, _Xmax, _Xmin, _Ymax, _Ymin, clear, clearOT, and NELPACS_CONTAINER_TRIGGER_DEFAULT_SIZE.
Referenced by CMoveContainer, and init. |
bool NLPACS::CMoveContainer::loadCollisionablePrimitiveBlock |
( |
const char * |
filename, |
|
|
uint8 |
firstWorldImage, |
|
|
uint8 |
numWorldImage, |
|
|
std::vector< UMovePrimitive * > * |
primitives, |
|
|
float |
orientation, |
|
|
const NLMISC::CVector & |
position, |
|
|
bool |
dontSnapToGround = false |
|
) |
[virtual] |
|
|
Definition at line 1027 of file move_container.cpp.
References _DeltaTime, _OtSize, _PreviousCollisionNode, _Retriever, _SurfaceTemp, _TimeOT, allocateOTStaticInfo, CPrimitiveWorldImage, index, NELPACS_DIST_BACK, nlassert, and nlassertex. |
void NLPACS::CMoveContainer::reaction |
( |
const CCollisionOTInfo & |
first |
) |
[private] |
|
void NLPACS::CMoveContainer::removeFromModifiedList |
( |
CMovePrimitive * |
primitive, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
void NLPACS::CMoveContainer::removeModifiedFromOT |
( |
uint8 |
worldImage |
) |
[private] |
|
void NLPACS::CMoveContainer::removeNCFromModifiedList |
( |
CMovePrimitive * |
primitive, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
void NLPACS::CMoveContainer::removePrimitive |
( |
UMovePrimitive * |
primitive |
) |
[virtual] |
|
void NLPACS::CMoveContainer::setAsStatic |
( |
uint8 |
worldImage |
) |
[virtual] |
|
|
Raise Trigger ! For collisionnable primitives, trigger are raised here (in reaction) because this is the moment we are sure the collision happened.
For non collisionable primitves, the trigger is raised at collision time because without OT, we can't stop evaluating collision on triggers.
Implements NLPACS::UMoveContainer.
Definition at line 1558 of file move_container.cpp.
References _StaticWorldImage. |
|
Make a move test.
Implements NLPACS::UMoveContainer.
Definition at line 248 of file move_container.cpp.
References _DeltaTime, _PreviousCollisionNode, _StaticWorldImage, _TestTime, checkOT, CMovePrimitive, CPrimitiveWorldImage, evalOnePrimitiveCollision, evalOneTerrainCollision, freeAllOTInfo, nlassert, and updateCells.
Referenced by evalOnePrimitiveCollision, and evalPrimAgainstPrimCollision. |
void NLPACS::CMoveContainer::unlinkMoveElement |
( |
CMoveElement * |
element, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
void NLPACS::CMoveContainer::updateCells |
( |
CMovePrimitive * |
primitive, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
|
Definition at line 383 of file move_container.cpp.
References _CellCountHeight, _CellCountWidth, _CellHeight, _CellWidth, _VectorCell, _Xmin, _Ymin, CPrimitiveWorldImage, min, nlassert, nlwarning, x, and y.
Referenced by testMove, and updatePrimitives. |
void NLPACS::CMoveContainer::updatePrimitives |
( |
double |
deltaTime, |
|
|
uint8 |
worldImage |
|
) |
[private] |
|
Friends And Related Function Documentation
friend class CMovePrimitive [friend]
|
|
|
Definition at line 58 of file move_container.h.
Referenced by addCollisionablePrimitive, addNonCollisionablePrimitive, allocatePrimitive, clearModifiedList, evalAllCollisions, evalNCPrimitiveCollision, evalOnePrimitiveCollision, reaction, removeFromModifiedList, removeModifiedFromOT, removeNCFromModifiedList, removePrimitive, testMove, and updatePrimitives. |
friend class CPrimitiveWorldImage [friend]
|
|
|
Definition at line 59 of file move_container.h.
Referenced by allocateWorldImage, allocateWorldImagesPtrs, changed, clearModifiedList, duplicateWorldImage, evalAllCollisions, evalNCPrimitiveCollision, evalOnePrimitiveCollision, evalOneTerrainCollision, getCells, newCollision, reaction, removeFromModifiedList, removeModifiedFromOT, removeNCFromModifiedList, removePrimitive, testMove, updateCells, and updatePrimitives. |
Member Data Documentation
uint NLPACS::CMoveContainer::_CellCountHeight [private]
|
|
uint NLPACS::CMoveContainer::_CellCountWidth [private]
|
|
double NLPACS::CMoveContainer::_CellHeight [private]
|
|
double NLPACS::CMoveContainer::_CellWidth [private]
|
|
std::vector<CMovePrimitive*> NLPACS::CMoveContainer::_ChangedRoot [private]
|
|
|
Root of modified primitive for each world image.
Definition at line 158 of file move_container.h.
Referenced by changed, clear, clearModifiedList, evalAllCollisions, evalCollision, init, loadCollisionablePrimitiveBlock, removeFromModifiedList, removeModifiedFromOT, removeNCFromModifiedList, and updatePrimitives. |
double NLPACS::CMoveContainer::_DeltaTime [private]
|
|
uint32 NLPACS::CMoveContainer::_MaxTestIteration [private]
|
|
uint NLPACS::CMoveContainer::_OtSize [private]
|
|
CCollisionOT* NLPACS::CMoveContainer::_PreviousCollisionNode [private]
|
|
double NLPACS::CMoveContainer::_PrimitiveMaxSize [private]
|
|
std::set<CMovePrimitive*> NLPACS::CMoveContainer::_PrimitiveSet [private]
|
|
std::set<uint8> NLPACS::CMoveContainer::_StaticWorldImage [private]
|
|
uint32 NLPACS::CMoveContainer::_TestTime [private]
|
|
std::vector<CCollisionOT> NLPACS::CMoveContainer::_TimeOT [private]
|
|
std::vector<UTriggerInfo> NLPACS::CMoveContainer::_Triggers [private]
|
|
std::vector<std::vector<CMoveCell> > NLPACS::CMoveContainer::_VectorCell [private]
|
|
double NLPACS::CMoveContainer::_Xmax [private]
|
|
double NLPACS::CMoveContainer::_Xmin [private]
|
|
double NLPACS::CMoveContainer::_Ymax [private]
|
|
double NLPACS::CMoveContainer::_Ymin [private]
|
|
The documentation for this class was generated from the following files:
|
|