![]() |
VR-Forces Developer's Guide
|
The DtCollisionDetector is a class used to detect collisions between a specified list of obstructions, by feature type (defined in appdata/settings/featureconfig.txt) and by DtSimObject obstruction IDs, and a specified Dt3dBoundingVolume. This class is used by the DtObstructionSensor to determine potential collisions (with the specified obstructions).
General operation: The collision detector is initialized
Public Types | |
| typedef std::set< DtObjectType > | DtObjectObstructionIDContainer |
| typedef std::vector< const DtSimObject * > | DtObjectObstructionContainer |
| typedef std::list< DtRwString > | DtFeatureTypeContainer |
Public Member Functions | |
| DtCollisionDetector (const DtSimulationServices *simServices) | |
| virtual | ~DtCollisionDetector () |
| virtual void | setObjectToIgnore (const DtSimObject *vrfObject) |
| virtual bool | detectPotentialCollision (const Dt3dBoundingVolume &collisionBv, const DtVector &localPosition, const DtDcm &bvOrientation, DtCollision *&potentialCollision) |
| virtual bool | detectAllEntityCollisions (const Dt3dBoundingVolume &collisionBv, const DtVector &localPosition, const DtDcm &bvOrientation, std::list< DtBoost::shared_ptr< DtEntityCollision > > &collisionList) |
| virtual bool | getObjectObstructions (DtObjectObstructionContainer &objectObstructions) const |
| virtual bool | getObjectObstructions (Dt3dBoundingVolume &boundingVolume, const DtVector &bvLocation, const DtDcm &bvOrientation, DtObjectObstructionContainer &objectObstructions) const |
| virtual bool | vrfObjectObstructionPredicate (const DtSimObject &vrfObjectToTest) const |
| virtual bool | checkForCollision (const Dt3dBoundingVolume &collisionBV, DtCollision &potentialCollision, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| virtual void | addObjectObstructionID (const DtObjectType &objectObstructionType) |
| virtual void | removeObjectObstructionID (const DtObjectType &objectObstructionType) |
| virtual void | setObjectObstructionIDs (const DtObjectObstructionIDContainer &objectTypes) |
| virtual void | setFeatureObstructionTypes (const DtFeatureTypeContainer &featureTypes) |
Protected Member Functions | |
| bool | detectNewClosestCollision (const Dt3dBoundingVolume &collisionBV, DtCollision *&potentialCollision, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| bool | detectObjectCollision (const Dt3dBoundingVolume &collisionBV, DtCollisionProcessor< DtEntityCollision > &collisionProcessor, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| bool | detectFeatureCollision (const Dt3dBoundingVolume &collisionBV, DtCollisionProcessor< DtFeatureCollision > &, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| DtCollision * | primaryCollision (DtCollision *firstCollision, DtCollision *secondCollision) const |
| bool | testInvariant () const |
Protected Attributes | |
| DtObjectObstructionIDContainer | myObjectObstructionTypes |
| const DtSimulationServices * | mySimulationServices |
| DtFeatureTypeContainer | myObstructionTypes |
| boost::shared_ptr < MAKVRinTerra::DtAreaFeatureSet::List > | myObstructions |
| const DtSimObject * | myObjectToIgnore |
Private Member Functions | |
| DtCollisionDetector (const DtCollisionDetector &orig) | |
| DtCollisionDetector & | operator= (const DtCollisionDetector &orig) |
| typedef std::set<DtObjectType> DtCollisionDetector::DtObjectObstructionIDContainer |
| typedef std::vector<const DtSimObject*> DtCollisionDetector::DtObjectObstructionContainer |
| typedef std::list<DtRwString> DtCollisionDetector::DtFeatureTypeContainer |
| DtCollisionDetector::DtCollisionDetector | ( | const DtSimulationServices * | simServices | ) |
constructor
|
virtual |
destructor
|
private |
copy constructor; not implemented
|
private |
assignment operator; not implemented
|
virtual |
|
virtual |
Add/Remove the specified obstruction types. (ID is a misnomer.)
|
virtual |
Add/Remove the specified obstruction types. (ID is a misnomer.)
|
virtual |
Clears and sets IDs to the specified list.
|
virtual |
Clears and sets types to the specified list.
|
virtual |
Calculates the closest potential collision among all the defined obstructions in the scene.
| potentialCollision | An assumed to be empty DtCollision object which will contain the closest potential collision data if one is detected. |
|
virtual |
Finds all the entities within the provided collisionBv. Caller is responsible for deleting collision item returned on the list.
|
virtual |
Requests, from the Object Manager, pointers to all of the DtSimObject types that have been specified as obstructions. If the version of the function that takes a bounding volume as a parameter, then the set of returned vrfObjects will contain at least all of the vrfObjects whose extents intersect the extent of the specified bounding volume (in the database CS).
| objectObstructions | Used as a container of the pointers to the DtSimObject obstructions. |
| boundingVolume | The volume of interest. |
| bvLocation | The location, in the reference CS (database CS) of the bv. |
| bvOrientation | The orientation of the bv. |
|
virtual |
|
virtual |
This function is used to filter out vrfObjects that are not appropriate for some reason. For example, this function currently screens out vrfObjects that are not of one of the specified object types, or if the vrfObjects is attached to the collision detector's entity. (you can collide with yourself in our current system).
|
virtual |
Determines if the specified entities collide or not.
| potentialCollidee | A vrfObject to test for collisions. |
| localPosition,if | not 0, 0, 0, will use that position rather than entity position NOTE that false will also be returned when the test could not be done, such as if the potential collidee did not have a state repository. |
|
protected |
Determines if the entity is potentially or currently colliding with any obstructions.
| localPosition,if | not 0, 0, 0, will use that position rather than entity position |
|
protected |
Determines if the entity is potentially or currently colliding with any obstructions of the specified types.
| DtEntityCollision | the "best" (closest currently) object collision if any. |
| DtFeatureObstructionCollision | the "best" (closest currently) feature obstruction collision if any. |
| localPosition,if | not 0, 0, 0, will use that position rather than entity position |
|
protected |
|
protected |
|
protected |
|
protected |
The object obstruction typess.
|
protected |
|
protected |
Feature obstructions.
|
protected |
|
protected |
This object (if set) will not be reported as a collision. Typically, this is the object that the collisions are being found for.