![]() |
VR-Forces 4.0.4 Class Documentation
|
DtBallisticGunJoy extends the DtBallisticGun actuator class with the ability to be controlled from a joystick. More...

Public Member Functions | |
| DtBallisticGunJoy (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *const parentRegistry=0) | |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
| virtual | ~DtBallisticGunJoy () |
| destructor | |
| virtual DtString | type () const |
| Returns a string identifies the class type of component. | |
| virtual bool | createPorts () |
| Creates myElevationPort. | |
| virtual void | setComponentDescriptor (DtComponentDescriptor *descriptor) |
| Override so we can extract the values we want and set our pointer. | |
| virtual void | tick () |
| Fire and detonate. | |
| virtual DtReal | setTarget (DtArticulatedPartStateRepository *rotBody) |
| virtual DtFireInteraction * | manualFireInteraction (DtArticulatedPartStateRepository *rotBody) |
| virtual DtDetonationInteraction * | manualDetonationInteraction (DtArticulatedPartStateRepository *rotBody, DtReal &detTime, DtReal dist) |
| virtual DtVrfObject * | targetSelection (DtArticulatedPartStateRepository *rotBody, DtReal &dist) |
| virtual DtReal | distanceToTarget () |
Static Public Member Functions | |
| static void | detonationCallback (DtTimer *timer) |
| Casts the user data portion of the DtTimer passed to it to a DtDetonationTimerData object. | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| (const DtString&,DtVrfObject*,DtSimManager*, | |
Protected Attributes | |
Ports and Port Groups | |
| DtConstrainedAnalogInputPort * | myElevationPort |
| Input Port Name: elevation Input Port Description: Input Port Range: -1. | |
| DtBooleanInputPort * | myActiveJoystickPort |
| Input Port Name: joystick-active Input Port Description: Input Port Range: Input Port Default Value: Input Group Parent: gun-control. | |
Private Member Functions | |
| DtBallisticGunJoy () | |
| Default constructor; should not be called. | |
| DtBallisticGunJoy (const DtBallisticGunJoy &orig) | |
| copy constructor; shallow copy - timers not copied | |
| const DtBallisticGunJoy & | operator= (const DtBallisticGunJoy &orig) |
| assignment operator; see comments on copy constructor! | |
DtBallisticGunJoy extends the DtBallisticGun actuator class with the ability to be controlled from a joystick.
Uses Descriptor Type: DtBallisticGunDescriptor
| DtBallisticGunJoy::DtBallisticGunJoy | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc, | ||
| DtReaderWriterRegistry *const | 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 DtBallisticGunJoy::~DtBallisticGunJoy | ( | ) | [virtual] |
destructor
| DtBallisticGunJoy::DtBallisticGunJoy | ( | ) | [private] |
Default constructor; should not be called.
Here because the compiler will generate an unprotected one otherwise.
| DtBallisticGunJoy::DtBallisticGunJoy | ( | const DtBallisticGunJoy & | orig | ) | [private] |
copy constructor; shallow copy - timers not copied
| virtual DtString DtBallisticGunJoy::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 DtBallisticGun.
| virtual bool DtBallisticGunJoy::createPorts | ( | ) | [virtual] |
Creates myElevationPort.
Reimplemented from DtBallisticGun.
| virtual void DtBallisticGunJoy::setComponentDescriptor | ( | DtComponentDescriptor * | descriptor | ) | [virtual] |
Override so we can extract the values we want and set our pointer.
Calls down to the base class's set.
Reimplemented from DtSimComponent.
| virtual void DtBallisticGunJoy::tick | ( | ) | [virtual] |
Fire and detonate.
It detects if we need to use local or parent function depending on joystick enable/disable state
Reimplemented from DtBallisticGun.
| virtual DtReal DtBallisticGunJoy::setTarget | ( | DtArticulatedPartStateRepository * | rotBody | ) | [virtual] |
| virtual DtFireInteraction* DtBallisticGunJoy::manualFireInteraction | ( | DtArticulatedPartStateRepository * | rotBody | ) | [virtual] |
| virtual DtDetonationInteraction* DtBallisticGunJoy::manualDetonationInteraction | ( | DtArticulatedPartStateRepository * | rotBody, |
| DtReal & | detTime, | ||
| DtReal | dist | ||
| ) | [virtual] |
| virtual DtVrfObject* DtBallisticGunJoy::targetSelection | ( | DtArticulatedPartStateRepository * | rotBody, |
| DtReal & | dist | ||
| ) | [virtual] |
| virtual DtReal DtBallisticGunJoy::distanceToTarget | ( | ) | [virtual] |
| static void DtBallisticGunJoy::detonationCallback | ( | DtTimer * | timer | ) | [static] |
Casts the user data portion of the DtTimer passed to it to a DtDetonationTimerData object.
It then uses the pointer to the Simulation Manager provided in the DtDetonationTimerData to get a pointer to the DtExerciseConn, and sends the DtDetonationInteraction which is also in the DtDetonationTimerData object via the exercise connection. The timer is removed from the scheduler, and the DtDetonationTimerData and DtDetonationInteraction objects are deleted.
Reimplemented from DtBallisticGun.
| static DtSimComponent* DtBallisticGunJoy::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 from DtBallisticGun.
| const DtBallisticGunJoy& DtBallisticGunJoy::operator= | ( | const DtBallisticGunJoy & | orig | ) | [private] |
assignment operator; see comments on copy constructor!
Input Port Name: elevation
Input Port Description:
Input Port Range: -1.
to 1.
Input Port Default Value:
Input Group Parent: gun-control
Input Port Name: joystick-active
Input Port Description:
Input Port Range:
Input Port Default Value:
Input Group Parent: gun-control.