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 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) |
| | Add/Remove the specified obstruction IDs/types.
|
| 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 |
Detailed Description
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
Member Typedef Documentation
Constructor & Destructor Documentation
| DtCollisionDetector::DtCollisionDetector |
( |
DtSimManager * |
simManager | ) |
|
constructor
- Parameters
-
| 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 DtCollisionDetector::~DtCollisionDetector |
( |
| ) |
|
|
virtual |
copy constructor; not implemented
Member Function Documentation
assignment operator; not implemented
| virtual void DtCollisionDetector::setObjectToIgnore |
( |
DtVrfObject * |
vrfObject | ) |
|
|
virtual |
| virtual void DtCollisionDetector::addObjectObstructionID |
( |
const DtObjectType & |
objectObstructionID | ) |
|
|
virtual |
Add/Remove the specified obstruction IDs/types.
| virtual void DtCollisionDetector::removeObjectObstructionID |
( |
const DtObjectType & |
objectObstructionID | ) |
|
|
virtual |
Add/Remove the specified obstruction IDs/types.
Clears and sets IDs to the specified list.
Clears and sets types to the specified list.
| virtual bool DtCollisionDetector::detectPotentialCollision |
( |
Dt3dBoundingVolume & |
collisionBv, |
|
|
const DtVector & |
localPosition, |
|
|
const DtDcm & |
bvOrientation, |
|
|
DtCollision *& |
potentialCollision |
|
) |
| |
|
virtual |
Calculates the closest potential collision among all the defined obstructions in the scene.
- Parameters
-
| potentialCollision | An assumed to be empty DtCollision object which will contain the closest potential collision data if one is detected. |
- Returns
- A boolean indicating the presence of a collision or not. Returns true if a collision is detected. False otherwise.
- See Also
- getObstructions()
-
checkEntityForCollision()
| virtual bool DtCollisionDetector::detectAllEntityCollisions |
( |
Dt3dBoundingVolume & |
collisionBv, |
|
|
const DtVector & |
localPosition, |
|
|
const DtDcm & |
bvOrientation, |
|
|
std::list< DtBoost::shared_ptr< DtEntityCollision > > & |
collisionList |
|
) |
| |
|
virtual |
Finds all the entities within the provided collisionBv.
Caller is responsible for deleting collision item returned on the list.
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).
- Parameters
-
| 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. |
- Returns
- A boolean indicating success or failure in getting the DtVrfObject pointers.
- Note
- The set of DtVrfObject pointers is guaranteed to have all DtVrfObjects that lie within the bounding volume, but may also contain elements that lie outside.
| virtual bool DtCollisionDetector::getObjectObstructions |
( |
Dt3dBoundingVolume & |
boundingVolume, |
|
|
const DtVector & |
bvLocation, |
|
|
const DtDcm & |
bvOrientation, |
|
|
DtObjectObstructionContainer & |
objectObstructions |
|
) |
| const |
|
virtual |
| virtual bool DtCollisionDetector::vrfObjectObstructionPredicate |
( |
const DtVrfObject & |
vrfObjectToTest | ) |
const |
|
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).
- Returns
- A boolean indicating whether or not the vrfObject is worth testing for a collision.
- See Also
- detectObjectCollision
| virtual bool DtCollisionDetector::checkForCollision |
( |
Dt3dBoundingVolume & |
collisionBV, |
|
|
DtCollision & |
potentialCollision, |
|
|
const DtVector & |
localPosition, |
|
|
const DtDcm & |
bvOrientation |
|
) |
| const |
|
virtual |
Determines if the specified entities collide or not.
- Parameters
-
| potentialCollidee | A vrfObject to test for collisions. |
- Returns
- A boolean specifying whether or not there was a collision.
- Parameters
-
| 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. |
| bool DtCollisionDetector::detectNewClosestCollision |
( |
Dt3dBoundingVolume & |
collisionBV, |
|
|
DtCollision *& |
potentialCollision, |
|
|
const DtVector & |
localPosition, |
|
|
const DtDcm & |
bvOrientation |
|
) |
| const |
|
protected |
Determines if the entity is potentially or currently colliding with any obstructions.
- Parameters
-
| localPosition,if | not 0, 0, 0, will use that position rather than entity position |
- Returns
- a boolean signifying success or failure in detecting the collision.
- Note
- if a new collision is detected, it is stored in the myPotentialCollision object.
Determines if the entity is potentially or currently colliding with any obstructions of the specified types.
- Parameters
-
| 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 |
- See Also
- detectNewCollision
- Returns
- a boolean signifying success or failure in detecting the collision.
- Returns
- the "best" (closest currently) of the two specified collisions.
| bool DtCollisionDetector::testInvariant |
( |
| ) |
const |
|
protected |
- Returns
- a boolean signifying whether the object's invariant is valid or not.
Member Data Documentation
The object obstruction IDs.
This object (if set) will not be reported as a collision.
Typically, this is the object that the collisions are being found for.
The documentation for this class was generated from the following file: