![]() |
VR-Forces 4.0.4 Class Documentation
|
DtObstructionSensor models a sensor able to detect potential collisions with other entities and/or terrain vector data. More...

Public Member Functions | |
| DtObstructionSensor (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtObstructionSensor () |
| destructor | |
| virtual bool | init () |
| Initializes the Obstruction sensor for use. | |
| virtual void | tick () |
| Determines if the entity is currently colliding with any of the specified potential Obstructions. | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Member Functions | |
| virtual bool | createPSR () |
| Creates myProcessState data member, and adds it to our process state repository manager. | |
| virtual bool | createCollisionDetector () |
| Creates the collision detector. | |
| virtual bool | setObstructionIDsInCollisionDetector () |
| Sets the obstruction IDs in the collision detector based on the descriptor and the PSR. | |
| virtual bool | initializeCollisionBV () |
| Initializes the collision bounding volume. | |
| virtual bool | calculateStoppingDistance (const DtObstructionSensorDescriptor &obstructionSensorDesc, double &stoppingDistance) |
| Calculates the current stopping distance of the entity. | |
| virtual bool | calculateCollisionBV () |
| Calculates the bounding volume representing the potential collision volume occupied by the entity. | |
| virtual void | registerMessageCallbacks () |
| Registers for DtSetCollisionAvoidTypes messages. | |
| virtual void | processCollisionAvoidTypes (DtSimMessage *msg) |
| Modifies the current obstruction detection types based on the contents of the message. | |
| virtual bool | addVectorObstructionType (const DtRwVectorObstructionType &obsId) |
| Adds the specified obstruction type to the PSR's vector obstruction list unless this type of obstruction is already being checked for. | |
| virtual bool | removeVectorObstructionType (const DtRwVectorObstructionType &obsId) |
| Removes the specified obstruction type from the PSR's vector obstruction list unless this type of obstruction if it is currently being checked for. | |
| virtual DtRwVectorObstructionType | buildingVectorObstructionType () const |
| Returns the vector obstruction type that will be added/removed when a DtSetCollisionAvoidTypes message arrives that adds/removes building avoidance. | |
| virtual DtRwVectorObstructionType | treeVectorObstructionType () const |
| Returns the vector obstruction type that will be added/removed when a DtSetCollisionAvoidTypes message arrives that adds/removes trees avoidance. | |
| virtual double | decelerationSoilFactor () const |
| virtual bool | createPorts () |
| Creates, initializes, and adds to the port group, all the ports for this component. | |
| virtual bool | createPortGroups () |
| Creates and adds all port groups for this component. | |
Static Protected Member Functions | |
| static void | setCollisionAvoidTypesCallback (DtSimMessage *msg, void *usr) |
| Calls processCollisionAvoidTypes(). | |
Protected Attributes | |
| Dt3dBoundingVolume * | myCollisionBV |
| DtCollisionDetector * | myCollisionDetector |
| DtCollisionDetector::DtObjectObstructionIDContainer | myObjectObstructionIDs |
| DtCollisionDetector::DtVectorObstructionIDContainer | myVectorObstructionIDs |
| const DtObstructionSensorDescriptor * | myObstructionSensorDesc |
| DtObstructionSensorPSR * | myProcessState |
| Container for state data associated with this component. | |
| bool | myFirstTick |
| DtCollision * | myPotentialCollision |
Ports and Port Groups | |
| DtCollisionOutputPort * | myPotentialCollisionInfoPort |
| Output Port Name: potential-collision-info Output Port Description: Information about an impending potential collision with an entity or terrain vector data feature. | |
| DtOutputPortGroup * | myObstructionInfoPortGroup |
| Output Port Group Name: obstruction-info Output Port Group Description: | |
Private Member Functions | |
| DtObstructionSensor (const DtObstructionSensor &orig) | |
| copy constructor; not implemented | |
| DtObstructionSensor & | operator= (const DtObstructionSensor &orig) |
| assignment operator; not implemented | |
DtObstructionSensor models a sensor able to detect potential collisions with other entities and/or terrain vector data.
Uses Descriptor Type: DtObstructionSensorDescriptor
| DtObstructionSensor::DtObstructionSensor | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
| virtual DtObstructionSensor::~DtObstructionSensor | ( | ) | [virtual] |
destructor
| DtObstructionSensor::DtObstructionSensor | ( | const DtObstructionSensor & | orig | ) | [private] |
copy constructor; not implemented
| DtObstructionSensor& DtObstructionSensor::operator= | ( | const DtObstructionSensor & | orig | ) | [private] |
assignment operator; not implemented
Reimplemented in DtHumanObstructionSensor.
| virtual bool DtObstructionSensor::init | ( | ) | [virtual] |
Initializes the Obstruction sensor for use.
This involves calculating the initial collision bounding volume.
Reimplemented from DtSimComponent.
| virtual void DtObstructionSensor::tick | ( | ) | [virtual] |
Determines if the entity is currently colliding with any of the specified potential Obstructions.
If so, it fills the myPotentialCollisionInfoPort with the potential collision data if it can activate the ports. Otherwise, it releases any active ports.
Reimplemented from DtSimComponent.
| virtual DtString DtObstructionSensor::type | ( | ) | const [virtual] |
Returns a string identifies the class type of component.
Type values are defined in compTypes.h. DtSimComponent creation functions are registered with the DtSimComponentFactory using the type values as the key.
Reimplemented from DtSimComponent.
Reimplemented in DtHumanObstructionSensor.
| virtual bool DtObstructionSensor::createPSR | ( | ) | [protected, virtual] |
Creates myProcessState data member, and adds it to our process state repository manager.
Passes in the name and type specified in the component descriptor (if they exist) to the DtVrfProcessStateRepository::createRepository factory method. If name and/or type is not specified, uses the appropriate default strings defined in procSRTypes.h.
| virtual bool DtObstructionSensor::createCollisionDetector | ( | ) | [protected, virtual] |
Creates the collision detector.
| virtual bool DtObstructionSensor::setObstructionIDsInCollisionDetector | ( | ) | [protected, virtual] |
Sets the obstruction IDs in the collision detector based on the descriptor and the PSR.
PSR values take precedence over values in the descriptor.
| virtual bool DtObstructionSensor::initializeCollisionBV | ( | ) | [protected, virtual] |
Initializes the collision bounding volume.
| virtual bool DtObstructionSensor::calculateStoppingDistance | ( | const DtObstructionSensorDescriptor & | obstructionSensorDesc, |
| double & | stoppingDistance | ||
| ) | [protected, virtual] |
Calculates the current stopping distance of the entity.
To get this, it queries the ground auto controller component, if specified, and returns the current braking distance that that component calculates.
Reimplemented in DtHumanObstructionSensor.
| virtual bool DtObstructionSensor::calculateCollisionBV | ( | ) | [protected, virtual] |
Calculates the bounding volume representing the potential collision volume occupied by the entity.
The entities oriented bounding volume is extended in the direction of travel. It represents a prediction of the entity's future movement for some period of time.
| virtual void DtObstructionSensor::registerMessageCallbacks | ( | ) | [protected, virtual] |
Registers for DtSetCollisionAvoidTypes messages.
| static void DtObstructionSensor::setCollisionAvoidTypesCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
Calls processCollisionAvoidTypes().
| virtual void DtObstructionSensor::processCollisionAvoidTypes | ( | DtSimMessage * | msg | ) | [protected, virtual] |
Modifies the current obstruction detection types based on the contents of the message.
| virtual bool DtObstructionSensor::addVectorObstructionType | ( | const DtRwVectorObstructionType & | obsId | ) | [protected, virtual] |
Adds the specified obstruction type to the PSR's vector obstruction list unless this type of obstruction is already being checked for.
| virtual bool DtObstructionSensor::removeVectorObstructionType | ( | const DtRwVectorObstructionType & | obsId | ) | [protected, virtual] |
Removes the specified obstruction type from the PSR's vector obstruction list unless this type of obstruction if it is currently being checked for.
| virtual DtRwVectorObstructionType DtObstructionSensor::buildingVectorObstructionType | ( | ) | const [protected, virtual] |
Returns the vector obstruction type that will be added/removed when a DtSetCollisionAvoidTypes message arrives that adds/removes building avoidance.
By default, returns a spec of layer MAK000.
| virtual DtRwVectorObstructionType DtObstructionSensor::treeVectorObstructionType | ( | ) | const [protected, virtual] |
Returns the vector obstruction type that will be added/removed when a DtSetCollisionAvoidTypes message arrives that adds/removes trees avoidance.
By default, returns a spec of layer MAK040.
| virtual double DtObstructionSensor::decelerationSoilFactor | ( | ) | const [protected, virtual] |
| static DtSimComponent* DtObstructionSensor::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = 0, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [static] |
(const DtString&,DtVrfObject*,DtSimManager*,
| name | Reader writer name of this component. |
| owner | The DtVrfObject that owns this component |
| simManager | The simulation manager (provides access to terrain, message interface, simulation clock). |
| desc | The component descriptor used to initialize this component. |
| parentRegistry | Pointer to the parent reader writer registry (the containing object that reads/writes this object). |
Reimplemented in DtHumanObstructionSensor.
| virtual bool DtObstructionSensor::createPorts | ( | ) | [protected, virtual] |
Creates, initializes, and adds to the port group, all the ports for this component.
Reimplemented from DtSimComponent.
| virtual bool DtObstructionSensor::createPortGroups | ( | ) | [protected, virtual] |
Creates and adds all port groups for this component.
Reimplemented from DtSimComponent.
Output Port Name: potential-collision-info
Output Port Description: Information about an impending potential collision with an entity or terrain vector data feature.
Output Port Range:
Output Port Default Value:
Output Group Parent: obstruction-info
Output Port Group Name: obstruction-info
Output Port Group Description:
Dt3dBoundingVolume* DtObstructionSensor::myCollisionBV [protected] |
DtCollisionDetector::DtObjectObstructionIDContainer DtObstructionSensor::myObjectObstructionIDs [protected] |
DtCollisionDetector::DtVectorObstructionIDContainer DtObstructionSensor::myVectorObstructionIDs [protected] |
const DtObstructionSensorDescriptor* DtObstructionSensor::myObstructionSensorDesc [protected] |
Container for state data associated with this component.
This state is saved and restored as part of a scenario (or checkpoint).
bool DtObstructionSensor::myFirstTick [protected] |
DtCollision* DtObstructionSensor::myPotentialCollision [mutable, protected] |