VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtHumanJoystickCombatController Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtHumanJoystickCombatController:
[legend]

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)
 
DtHumanJoystickCombatControlleroperator= (const DtHumanJoystickCombatController &orig)
 

Constructor & Destructor Documentation

◆ DtHumanJoystickCombatController() [1/3]

makVre::DtHumanJoystickCombatController::DtHumanJoystickCombatController ( const DtString & name,
DtLocalObject * owner,
DtSimulationServices * simManager,
DtComponentDescriptor * desc,
DtReaderWriterRegistry * parentRegistry = 0 )

Constructor.

Parameters
nameThe name of this component
ownerThe local object that owns this component
simManagerThe simulation services manager
descComponent descriptor with configuration parameters
parentRegistryOptional parent registry for reader/writer functionality

Creates a new human joystick combat controller component with the specified parameters.

Referenced by DtHumanJoystickCombatController(), and operator=().

◆ ~DtHumanJoystickCombatController()

virtual makVre::DtHumanJoystickCombatController::~DtHumanJoystickCombatController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the human joystick combat controller component.

◆ DtHumanJoystickCombatController() [2/3]

makVre::DtHumanJoystickCombatController::DtHumanJoystickCombatController ( )
private

Default constructor (not implemented)

Default constructor is private and not implemented to prevent creation of instances without proper initialization.

◆ DtHumanJoystickCombatController() [3/3]

makVre::DtHumanJoystickCombatController::DtHumanJoystickCombatController ( const DtHumanJoystickCombatController & orig)
private

Copy constructor (not implemented)

Copy constructor is private and not implemented to prevent copy construction.

References DtHumanJoystickCombatController().

Member Function Documentation

◆ type()

virtual const char * makVre::DtHumanJoystickCombatController::type ( ) const
overridevirtual

Gets the type identifier for this component.

Returns
String identifying the component type (DtHumanJoystickCombatControllerType)

Implements the DtSimComponent::type() method to return the type identifier for this component.

◆ createPortGroups()

virtual bool makVre::DtHumanJoystickCombatController::createPortGroups ( )
overridevirtual

Creates port groups for this component.

Returns
True if port groups were created successfully, false otherwise

Creates and initializes the output port groups used by this controller, including groups for weapon aiming and ballistic gun control.

◆ createPorts()

virtual bool makVre::DtHumanJoystickCombatController::createPorts ( )
overridevirtual

Creates input and output ports for this component.

Returns
True if ports were created successfully, false otherwise

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.

◆ creator()

static DtSimComponent * makVre::DtHumanJoystickCombatController::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
nameThe name for the new component
ownerThe local object that will own this component
simManagerThe simulation services manager
descOptional component descriptor
parentRegistryOptional 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=()

DtHumanJoystickCombatController & makVre::DtHumanJoystickCombatController::operator= ( const DtHumanJoystickCombatController & orig)
private

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtHumanJoystickCombatController().

◆ calcAndSetPortValues()

virtual void makVre::DtHumanJoystickCombatController::calcAndSetPortValues ( const DtString & functionGroup,
const DtString & function,
double value,
bool repeat )
overrideprotectedvirtual

Processes joystick input and updates output ports.

Parameters
functionGroupThe function group identifier for the input
functionThe specific function identifier within the group
valueThe input value from the joystick
repeatFlag 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.

◆ joystickConnected()

virtual void makVre::DtHumanJoystickCombatController::joystickConnected ( )
overrideprotectedvirtual

Handles joystick connection event.

Called when a joystick is connected to the system. Activates joystick control mode for combat functions.

◆ joystickDisconnected()

virtual void makVre::DtHumanJoystickCombatController::joystickDisconnected ( )
overrideprotectedvirtual

Handles joystick disconnection event.

Called when a joystick is disconnected from the system. Deactivates joystick control mode for combat functions.

◆ tick()

virtual void makVre::DtHumanJoystickCombatController::tick ( )
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.

Member Data Documentation

◆ myAimWeaponOutputPortGroup

DtOutputPortGroup* makVre::DtHumanJoystickCombatController::myAimWeaponOutputPortGroup
protected

Output port group for aiming weapon systems.

Contains all output ports related to weapon aiming control.

◆ myAimAtAnglePort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::myAimAtAnglePort
protected

Output port for enabling aiming at specific angles.

When true, allows aiming at specific elevation and azimuth angles.

◆ myAllowAzimuthAimingPort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::myAllowAzimuthAimingPort
protected

Output port for enabling azimuth aiming.

When true, allows aiming in azimuth (side-to-side) direction.

◆ myAimAzimuthOutputPort

DtAnalogOutputPort* makVre::DtHumanJoystickCombatController::myAimAzimuthOutputPort
protected

Output port for azimuth aim angle.

Controls the azimuth angle for weapon aiming in radians.

◆ myAimElevationOutputPort

DtAnalogOutputPort* makVre::DtHumanJoystickCombatController::myAimElevationOutputPort
protected

Output port for elevation aim angle.

Controls the elevation angle for weapon aiming in radians.

◆ myBalGunControlPortGroup

DtOutputPortGroup* makVre::DtHumanJoystickCombatController::myBalGunControlPortGroup
protected

Output port group for ballistic gun control.

Contains all output ports related to the control of ballistic guns.

◆ myTriggerPort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::myTriggerPort
protected

Output port for weapon trigger state.

When true, indicates that the weapon trigger is pulled/activated.

◆ myQuantityOutputPort

DtIntegerOutputPort* makVre::DtHumanJoystickCombatController::myQuantityOutputPort
protected

Output port for ammunition quantity.

Indicates the quantity of ammunition to use for firing.

◆ myLoadedPort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::myLoadedPort
protected

Output port for loaded state.

When true, indicates that the weapon is loaded and ready to fire.

◆ myLosPort

DtIntegerOutputPort* makVre::DtHumanJoystickCombatController::myLosPort
protected

Output port for line-of-sight state.

Indicates whether a valid line-of-sight target exists.

◆ myActiveJoystickPort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::myActiveJoystickPort
protected

Output port for primary joystick active state.

When true, indicates that primary joystick control is active.

◆ mySecondActiveJoystickPort

DtBooleanOutputPort* makVre::DtHumanJoystickCombatController::mySecondActiveJoystickPort
protected

Output port for secondary joystick active state.

When true, indicates that secondary joystick control is active.

◆ myHumanStateRepository

DtHumanStateRepository* makVre::DtHumanJoystickCombatController::myHumanStateRepository
protected

Pointer to the human state repository.

Access to the human entity's state information.

◆ myElevationPort

DtConstrainedAnalogOutputPort* makVre::DtHumanJoystickCombatController::myElevationPort
protected

Output port for elevation control.

Controls the elevation of the weapon system, with constraints on minimum and maximum values.

◆ myAiming

bool makVre::DtHumanJoystickCombatController::myAiming
protected

Flag indicating if the entity is currently aiming.

When true, the entity is actively aiming a weapon.

◆ myTrigger

bool makVre::DtHumanJoystickCombatController::myTrigger
protected

Flag indicating if the trigger is currently activated.

When true, the weapon trigger is being pressed/activated.

◆ myPitchingRate

double makVre::DtHumanJoystickCombatController::myPitchingRate
protected

Rate of change for pitch (elevation) control.

Controls how quickly the weapon elevation changes in response to inputs.

◆ myPitch

double makVre::DtHumanJoystickCombatController::myPitch
protected

Current pitch (elevation) angle.

Stores the current pitch/elevation angle of the weapon in radians.

◆ myMousePitch

double makVre::DtHumanJoystickCombatController::myMousePitch
protected

Current mouse-controlled pitch contribution.

Stores the component of pitch that is controlled by mouse input.

◆ myYawingRate

double makVre::DtHumanJoystickCombatController::myYawingRate
protected

Rate of change for yaw (azimuth) control.

Controls how quickly the weapon azimuth changes in response to inputs.

◆ myYaw

double makVre::DtHumanJoystickCombatController::myYaw
protected

Current yaw (azimuth) angle.

Stores the current yaw/azimuth angle of the weapon in radians.

◆ myMouseYaw

double makVre::DtHumanJoystickCombatController::myMouseYaw
protected

Current mouse-controlled yaw contribution.

Stores the component of yaw that is controlled by mouse input.

◆ myCurrentWeaponState

int makVre::DtHumanJoystickCombatController::myCurrentWeaponState
protected

Current state of the weapon.

Stores the current operational state of the weapon system.

◆ myCurrentAimElevation

double makVre::DtHumanJoystickCombatController::myCurrentAimElevation
protected

Current weapon aim elevation.

Stores the current elevation angle being used for aiming the weapon.

◆ myCurrentAimAzimuth

double makVre::DtHumanJoystickCombatController::myCurrentAimAzimuth
protected

Current weapon aim azimuth.

Stores the current azimuth angle being used for aiming the weapon.


The documentation for this class was generated from the following file: