![]() |
VR-Forces 4.5 Class Documentation
|
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 DtVrfObject obstruction IDs, and a specified Dt3dBoundingVolume. More...
Public Types | |
| typedef std::set< DtObjectType > | DtObjectObstructionIDContainer |
| typedef boost::unordered_set < DtVrfObject * > | DtObjectObstructionContainer |
| typedef std::list< DtRwString > | DtFeatureTypeContainer |
Public Member Functions | |
| DtCollisionDetector (DtSimManager *simManager) | |
| constructor | |
| virtual | ~DtCollisionDetector () |
| destructor | |
| virtual void | setObjectToIgnore (DtVrfObject *vrfObject) |
| virtual bool | detectPotentialCollision (Dt3dBoundingVolume &collisionBv, const DtVector &localPosition, const DtDcm &bvOrientation, DtCollision *&potentialCollision) |
| Calculates the closest potential collision among all the defined obstructions in the scene. | |
| virtual bool | detectAllEntityCollisions (Dt3dBoundingVolume &collisionBv, const DtVector &localPosition, const DtDcm &bvOrientation, std::list< DtBoost::shared_ptr< DtEntityCollision > > &collisionList) |
| Finds all the entities within the provided collisionBv. | |
| virtual bool | getObjectObstructions (DtObjectObstructionContainer &objectObstructions) const |
| Requests, from the Object Manager, pointers to all of the DtVrfObject types that have been specified as obstructions. | |
| virtual bool | getObjectObstructions (Dt3dBoundingVolume &boundingVolume, const DtVector &bvLocation, const DtDcm &bvOrientation, DtObjectObstructionContainer &objectObstructions) const |
| virtual bool | vrfObjectObstructionPredicate (const DtVrfObject &vrfObjectToTest) const |
| This function is used to filter out vrfObjects that are not appropriate for some reason. | |
| virtual bool | checkForCollision (Dt3dBoundingVolume &collisionBV, DtCollision &potentialCollision, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| Determines if the specified entities collide or not. | |
| virtual void | addObjectObstructionID (const DtObjectType &objectObstructionID) |
| Add/Remove the specified obstruction IDs/types. | |
| virtual void | removeObjectObstructionID (const DtObjectType &objectObstructionID) |
| virtual void | setObjectObstructionIDs (const DtObjectObstructionIDContainer &objectIDs) |
| Clears and sets IDs to the specified list. | |
| virtual void | setFeatureObstructionTypes (const DtFeatureTypeContainer &featureTypes) |
| Clears and sets types to the specified list. | |
Protected Member Functions | |
| bool | detectNewClosestCollision (Dt3dBoundingVolume &collisionBV, DtCollision *&potentialCollision, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| Determines if the entity is potentially or currently colliding with any obstructions. | |
| bool | detectObjectCollision (Dt3dBoundingVolume &collisionBV, DtCollisionProcessor< DtEntityCollision > &collisionProcessor, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| Determines if the entity is potentially or currently colliding with any obstructions of the specified types. | |
| bool | detectFeatureCollision (Dt3dBoundingVolume &collisionBV, DtCollisionProcessor< DtFeatureCollision > &, const DtVector &localPosition, const DtDcm &bvOrientation) const |
| DtCollision * | primaryCollision (DtCollision *firstCollision, DtCollision *secondCollision) const |
| bool | testInvariant () const |
Protected Attributes | |
| DtObjectObstructionIDContainer | myObjectObstructionIDs |
| The object obstruction IDs. | |
| DtSimManager * | mySimManager |
| DtFeatureTypeContainer | myObstructionTypes |
| Feature obstructions. | |
| boost::shared_ptr < MAKVRinTerra::DtAreaFeatureSet::List > | myObstructions |
| DtVrfObject * | myObjectToIgnore |
| This object (if set) will not be reported as a collision. | |
Private Member Functions | |
| DtCollisionDetector (const DtCollisionDetector &orig) | |
| copy constructor; not implemented | |
| DtCollisionDetector & | operator= (const DtCollisionDetector &orig) |
| assignment operator; not implemented | |
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 DtVrfObject 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
| typedef std::set<DtObjectType> DtCollisionDetector::DtObjectObstructionIDContainer |
| typedef boost::unordered_set<DtVrfObject*> DtCollisionDetector::DtObjectObstructionContainer |
| typedef std::list<DtRwString> DtCollisionDetector::DtFeatureTypeContainer |
| DtCollisionDetector::DtCollisionDetector | ( | DtSimManager * | simManager | ) |
constructor
| simManager | A convenience pointer to the symManager, for use in getting the lists of vrfObject obstructions, vector obstructions, etc. The collision detector does not maintain any ownership at all over this simManager. |
| objectToMonitor | The DtVrfObject that is associated with this detector. This is used to get entity related information, such as location, orientation, bounding volume, etc. |
|
virtual |
destructor
|
private |
copy constructor; not implemented
|
private |
assignment operator; not implemented
|
virtual |
|
virtual |
Add/Remove the specified obstruction IDs/types.
|
virtual |
|
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 DtVrfObject 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 DtVrfObject 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 IDs.
|
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.