|
VR-Engage
2.2
|
DtHumanJoystickCombatController enables joystick control of a human entity's combat capabilities. It manages weapon aiming, firing, and other combat-related actions through joystick inputs. This controller works alongside movement controllers to provide comprehensive control of human entities.
Uses Descriptor Type: DtHumanJoystickCombatControllerDescriptor
#include <humanJoystickCombatController.h>
Public Member Functions | |
| DtHumanJoystickCombatController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtHumanJoystickCombatController () override |
| virtual const char * | type () const override |
| virtual bool | createPortGroups () override |
| virtual bool | createPorts () override |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
Protected Member Functions | |
| virtual void | calcAndSetPortValues (const DtString &functionGroup, const DtString &function, double value, bool repeat) override |
| virtual void | joystickConnected () override |
| virtual void | joystickDisconnected () override |
| virtual void | tick () override |
Protected Attributes | |
Ports and Port Groups | |
| DtOutputPortGroup * | myAimWeaponOutputPortGroup |
| DtBooleanOutputPort * | myAimAtAnglePort |
| DtBooleanOutputPort * | myAllowAzimuthAimingPort |
| DtAnalogOutputPort * | myAimAzimuthOutputPort |
| DtAnalogOutputPort * | myAimElevationOutputPort |
| DtOutputPortGroup * | myBalGunControlPortGroup |
| DtBooleanOutputPort * | myTriggerPort |
| DtIntegerOutputPort * | myQuantityOutputPort |
| DtBooleanOutputPort * | myLoadedPort |
| DtIntegerOutputPort * | myLosPort |
| DtBooleanOutputPort * | myActiveJoystickPort |
| DtBooleanOutputPort * | mySecondActiveJoystickPort |
| DtHumanStateRepository * | myHumanStateRepository |
| DtConstrainedAnalogOutputPort * | myElevationPort |
| bool | myAiming |
| bool | myTrigger |
| double | myPitchingRate |
| double | myPitch |
| double | myMousePitch |
| double | myYawingRate |
| double | myYaw |
| double | myMouseYaw |
| int | myCurrentWeaponState |
| double | myCurrentAimElevation |
| double | myCurrentAimAzimuth |
Private Member Functions | |
| DtHumanJoystickCombatController () | |
| DtHumanJoystickCombatController (const DtHumanJoystickCombatController &orig) | |
| DtHumanJoystickCombatController & | operator= (const DtHumanJoystickCombatController &orig) |
| makVre::DtHumanJoystickCombatController::DtHumanJoystickCombatController | ( | const DtString & | name, |
| DtLocalObject * | owner, | ||
| DtSimulationServices * | simManager, | ||
| DtComponentDescriptor * | desc, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 ) |
Constructor.
| name | The name of this component |
| owner | The local object that owns this component |
| simManager | The simulation services manager |
| desc | Component descriptor with configuration parameters |
| parentRegistry | Optional parent registry for reader/writer functionality |
Creates a new human joystick combat controller component with the specified parameters.
Referenced by DtHumanJoystickCombatController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the human joystick combat controller component.
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
|
private |
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtHumanJoystickCombatController().
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
overridevirtual |
Creates port groups for this component.
Creates and initializes the output port groups used by this controller, including groups for weapon aiming and ballistic gun control.
|
overridevirtual |
Creates input and output ports for this component.
Creates and initializes all input and output ports used by this controller for combat-related functions, including ports for aiming, triggering, and weapon state information.
|
static |
Factory method to create a new instance of this component.
| 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 |
Static factory method used by the component creation system to instantiate new instances of this component type.
|
private |
Assignment operator (not implemented)
Assignment operator is private and not implemented to prevent assignment.
References DtHumanJoystickCombatController().
|
overrideprotectedvirtual |
Processes joystick input and updates output ports.
| functionGroup | The function group identifier for the input |
| function | The specific function identifier within the group |
| value | The input value from the joystick |
| repeat | Flag indicating if this is a repeated input |
Implements the DtJoystickControllerInterface method to process joystick input and update the controller's output ports for combat functions.
|
overrideprotectedvirtual |
Handles joystick connection event.
Called when a joystick is connected to the system. Activates joystick control mode for combat functions.
|
overrideprotectedvirtual |
Handles joystick disconnection event.
Called when a joystick is disconnected from the system. Deactivates joystick control mode for combat functions.
|
overrideprotectedvirtual |
Updates the controller state each simulation frame.
Processes combat-related controls and updates the human entity's weapon aiming and firing state based on current joystick inputs.
|
protected |
Output port group for aiming weapon systems.
Contains all output ports related to weapon aiming control.
|
protected |
Output port for enabling aiming at specific angles.
When true, allows aiming at specific elevation and azimuth angles.
|
protected |
Output port for enabling azimuth aiming.
When true, allows aiming in azimuth (side-to-side) direction.
|
protected |
Output port for azimuth aim angle.
Controls the azimuth angle for weapon aiming in radians.
|
protected |
Output port for elevation aim angle.
Controls the elevation angle for weapon aiming in radians.
|
protected |
Output port group for ballistic gun control.
Contains all output ports related to the control of ballistic guns.
|
protected |
Output port for weapon trigger state.
When true, indicates that the weapon trigger is pulled/activated.
|
protected |
Output port for ammunition quantity.
Indicates the quantity of ammunition to use for firing.
|
protected |
Output port for loaded state.
When true, indicates that the weapon is loaded and ready to fire.
|
protected |
Output port for line-of-sight state.
Indicates whether a valid line-of-sight target exists.
|
protected |
Output port for primary joystick active state.
When true, indicates that primary joystick control is active.
|
protected |
Output port for secondary joystick active state.
When true, indicates that secondary joystick control is active.
|
protected |
Pointer to the human state repository.
Access to the human entity's state information.
|
protected |
Output port for elevation control.
Controls the elevation of the weapon system, with constraints on minimum and maximum values.
|
protected |
Flag indicating if the entity is currently aiming.
When true, the entity is actively aiming a weapon.
|
protected |
Flag indicating if the trigger is currently activated.
When true, the weapon trigger is being pressed/activated.
|
protected |
Rate of change for pitch (elevation) control.
Controls how quickly the weapon elevation changes in response to inputs.
|
protected |
Current pitch (elevation) angle.
Stores the current pitch/elevation angle of the weapon in radians.
|
protected |
Current mouse-controlled pitch contribution.
Stores the component of pitch that is controlled by mouse input.
|
protected |
Rate of change for yaw (azimuth) control.
Controls how quickly the weapon azimuth changes in response to inputs.
|
protected |
Current yaw (azimuth) angle.
Stores the current yaw/azimuth angle of the weapon in radians.
|
protected |
Current mouse-controlled yaw contribution.
Stores the component of yaw that is controlled by mouse input.
|
protected |
Current state of the weapon.
Stores the current operational state of the weapon system.
|
protected |
Current weapon aim elevation.
Stores the current elevation angle being used for aiming the weapon.
|
protected |
Current weapon aim azimuth.
Stores the current azimuth angle being used for aiming the weapon.