Uses Descriptor Type: DtBallisticGunDescriptor
#include <ballisticGunJoy.h>
|
| | DtBallisticGunJoy (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *const parentRegistry=0) |
| |
| virtual | ~DtBallisticGunJoy () override |
| |
| virtual const char * | type () const override |
| |
| virtual bool | createPorts () override |
| |
| virtual void | setComponentDescriptor (DtComponentDescriptor *descriptor) override |
| |
| virtual void | tick () override |
| |
| virtual DtReal | setTarget (makVrf::DtArticulatedPartStateRepository *rotBody) |
| |
| virtual makVrfEvents::DtFireEvent * | manualFireInteraction (makVrf::DtArticulatedPartStateRepository *rotBody) |
| |
| virtual makVrfEvents::DtDetonationEvent * | manualDetonationInteraction (makVrf::DtArticulatedPartStateRepository *rotBody, DtReal &detTime, DtReal dist) |
| |
| virtual DtUUID | targetSelection (makVrf::DtArticulatedPartStateRepository *rotBody, DtReal &dist) |
| |
| virtual DtReal | distanceToTarget () |
| |
|
| static void | detonationCallback (DtTimer *timer) |
| |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
◆ DtBallisticGunJoy() [1/3]
| makVre::DtBallisticGunJoy::DtBallisticGunJoy |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc, |
|
|
DtReaderWriterRegistry *const | parentRegistry = 0 ) |
◆ ~DtBallisticGunJoy()
| virtual makVre::DtBallisticGunJoy::~DtBallisticGunJoy |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the ballistic gun joy component.
◆ DtBallisticGunJoy() [2/3]
| makVre::DtBallisticGunJoy::DtBallisticGunJoy |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
◆ DtBallisticGunJoy() [3/3]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtBallisticGunJoy().
◆ type()
| virtual const char * makVre::DtBallisticGunJoy::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtBallisticGunJoyActuatorType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
Reimplemented in makVre::DtHumanGunJoyActuator, and makVre::DtVreGunJoyActuator.
◆ createPorts()
| virtual bool makVre::DtBallisticGunJoy::createPorts |
( |
| ) |
|
|
overridevirtual |
◆ setComponentDescriptor()
| virtual void makVre::DtBallisticGunJoy::setComponentDescriptor |
( |
DtComponentDescriptor * | descriptor | ) |
|
|
overridevirtual |
Sets the component descriptor and extracts configuration values.
- Parameters
-
| descriptor | The component descriptor containing configuration parameters |
Overrides the base class method to extract joystick-specific values and then calls the base class's method to set common parameters.
◆ tick()
| virtual void makVre::DtBallisticGunJoy::tick |
( |
| ) |
|
|
overridevirtual |
◆ setTarget()
| virtual DtReal makVre::DtBallisticGunJoy::setTarget |
( |
makVrf::DtArticulatedPartStateRepository * | rotBody | ) |
|
|
virtual |
Sets the target for the gun.
- Parameters
-
| rotBody | The articulated part state repository of the gun, or entity state if none exists |
- Returns
- Distance to the target, or -1.0 if no target found
Uses targetSelection() to try to find an entity in the gun's line of fire; if it finds one, it sets the PSR->currentTarget.
◆ manualFireInteraction()
| virtual makVrfEvents::DtFireEvent * makVre::DtBallisticGunJoy::manualFireInteraction |
( |
makVrf::DtArticulatedPartStateRepository * | rotBody | ) |
|
|
virtual |
Creates a fire interaction event.
- Parameters
-
| rotBody | The articulated part state repository of the gun, or entity state if none exists |
- Returns
- Pointer to the created fire event
Creates a fire interaction event. Uses the currentTarget in the PSR as the fire target, if present.
◆ manualDetonationInteraction()
| virtual makVrfEvents::DtDetonationEvent * makVre::DtBallisticGunJoy::manualDetonationInteraction |
( |
makVrf::DtArticulatedPartStateRepository * | rotBody, |
|
|
DtReal & | detTime, |
|
|
DtReal | dist ) |
|
virtual |
Creates a detonation interaction event.
- Parameters
-
| rotBody | The articulated part state repository of the gun, or entity state if none exists |
| detTime | Reference to store the detonation time |
| dist | Distance to the target |
- Returns
- Pointer to the created detonation event
Creates a detonation interaction event based on the current target and distance.
◆ targetSelection()
| virtual DtUUID makVre::DtBallisticGunJoy::targetSelection |
( |
makVrf::DtArticulatedPartStateRepository * | rotBody, |
|
|
DtReal & | dist ) |
|
virtual |
Finds a target along the gun's firing direction.
- Parameters
-
| rotBody | The articulated part state repository of the gun, or entity state if none exists |
| dist | Reference to store the distance to the target |
- Returns
- UUID of the first target found, or empty UUID if none found
Casts a ray out from the gun to a point MAX_RANGE away (currently 4000m). Determines, using physicalWorld->getVrfObjectsAlongChord(), if there are any platforms, lifeforms, or cultural features on the ray. Returns the UUID of the first one found and stores the range in the dist parameter.
◆ distanceToTarget()
| virtual DtReal makVre::DtBallisticGunJoy::distanceToTarget |
( |
| ) |
|
|
virtual |
Calculates the distance to the current target.
- Returns
- Distance to the target, or -1.0 if no target is set
Determines the distance from the gun to the currently selected target.
◆ detonationCallback()
| static void makVre::DtBallisticGunJoy::detonationCallback |
( |
DtTimer * | timer | ) |
|
|
static |
Timer callback for detonation events.
- Parameters
-
| timer | Pointer to the timer that has expired |
Casts the user data portion of the DtTimer to a DtDetonationTimerData object. Uses the Simulation Manager pointer in the DtDetonationTimerData to get the DtExerciseConn, and sends the makVrfEvents::DtDetonationEvent via the exercise connection. The timer is removed from the scheduler, and the DtDetonationTimerData and makVrfEvents::DtDetonationEvent objects are deleted.
◆ creator()
| static DtSimComponent * makVre::DtBallisticGunJoy::creator |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc = 0, |
|
|
DtReaderWriterRegistry * | parentRegistry = 0 ) |
|
static |
Factory method to create a new instance of this component.
- Parameters
-
| name | The name for the new component |
| owner | The local object that will own this component |
| simManager | The simulation services manager |
| desc | Optional component descriptor |
| parentRegistry | Optional parent registry for reader/writer functionality |
- Returns
- Pointer to the newly created component
Static factory method used by the component creation system to instantiate new instances of this component type.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtBallisticGunJoy().
◆ myElevationPort
| DtConstrainedAnalogInputPort* makVre::DtBallisticGunJoy::myElevationPort |
|
protected |
Input Port Name: elevation
Input Port Description:
Input Port Range: -1. to 1.
Input Port Default Value:
Input Group Parent: gun-control.
◆ myActiveJoystickPort
| DtBooleanInputPort* makVre::DtBallisticGunJoy::myActiveJoystickPort |
|
protected |
Input Port Name: joystick-active
Input Port Description:
Input Port Range:
Input Port Default Value:
Input Group Parent: gun-control.
◆ myReportedNoArticulation
| bool makVre::DtBallisticGunJoy::myReportedNoArticulation |
|
protected |
Flag to track missing articulation warning.
A flag to remember whether a warning message was printed about not finding an articulated part.
The documentation for this class was generated from the following file: