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

Detailed Description

DtVreTurretJoystickController extends the base joystick controller to provide specialized functionality for controlling turrets with joystick inputs. It automatically creates and manages the appropriate output ports for turret azimuth, elevation, and aiming mode controls, and translates joystick inputs into commands that the turret actuator can understand and execute.

#include <vreTurretJoystickController.h>

Inheritance diagram for makVre::DtVreTurretJoystickController:
[legend]

Public Member Functions

 DtVreTurretJoystickController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreTurretJoystickController () override
 
virtual const char * type () const override
 
- Public Member Functions inherited from makVre::DtVreJoystickController
 DtVreJoystickController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreJoystickController () override
 
virtual bool init () override
 
virtual bool createPortGroups () override
 
- Public Member Functions inherited from makVre::DtVreSimComponent< DtControllerComponent >
 DtVreSimComponent (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
virtual ~DtVreSimComponent ()
 
bool isPlayerControlled (const std::string &role="") const
 
DtString entitySystemName () const
 

Static Public Member Functions

static DtSimComponent * creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
 
- Static Public Member Functions inherited from makVre::DtVreJoystickController
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 bool createPorts () override
 
- Protected Member Functions inherited from makVre::DtVreJoystickController
virtual DtVreMessageResult handleCommanderOverride (DtVreMessage *msg)
 
virtual void joystickConnected () override
 
virtual void joystickDisconnected () override
 
virtual void tick () override
 

Protected Attributes

DtStringOutputPort * myAimingModePort
 
- Protected Attributes inherited from makVre::DtVreJoystickController
std::string myOutputPortGroupName
 
DtOutputPortGroup * myOutputGroup
 
OutputPortMap myOutputPorts
 
bool myCommanderOverrideActive
 

Private Member Functions

 DtVreTurretJoystickController ()
 
 DtVreTurretJoystickController (const DtVreJoystickController &orig)
 
DtVreTurretJoystickControlleroperator= (const DtVreTurretJoystickController &orig)
 

Additional Inherited Members

- Protected Types inherited from makVre::DtVreJoystickController
using OutputPortMap = std::map<std::string, DtOutputPort*>
 

Constructor & Destructor Documentation

◆ DtVreTurretJoystickController() [1/3]

makVre::DtVreTurretJoystickController::DtVreTurretJoystickController ( 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 turret joystick controller component with the specified parameters. Initializes the controller and sets up the required output ports for turret control.

Referenced by operator=().

◆ ~DtVreTurretJoystickController()

virtual makVre::DtVreTurretJoystickController::~DtVreTurretJoystickController ( )
overridevirtual

Virtual destructor.

Cleans up resources used by the turret joystick controller component.

◆ DtVreTurretJoystickController() [2/3]

makVre::DtVreTurretJoystickController::DtVreTurretJoystickController ( )
private

Default constructor (not implemented)

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

◆ DtVreTurretJoystickController() [3/3]

makVre::DtVreTurretJoystickController::DtVreTurretJoystickController ( const DtVreJoystickController & orig)
private

Copy constructor (not implemented)

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

References makVre::DtVreJoystickController::DtVreJoystickController().

Member Function Documentation

◆ type()

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

Gets the type identifier for this component.

Returns
String identifying the component type (DtVreTurretJoystickControllerType)

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

Reimplemented from makVre::DtVreJoystickController.

◆ creator()

static DtSimComponent * makVre::DtVreTurretJoystickController::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=()

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

Assignment operator (not implemented)

Returns
Reference to this object

Assignment operator is private and not implemented to prevent assignment.

References DtVreTurretJoystickController().

◆ calcAndSetPortValues()

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

Processes joystick input and sets corresponding port values.

Parameters
functionGroupThe function group identifier for the input
functionThe specific function name for the input
valueThe input value (typically in range [-1.0, 1.0])
repeatFlag indicating whether the function should repeat

Handles joystick input by translating joystick function calls into appropriate turret control values. Maps joystick axes and buttons to turret azimuth, elevation, and aiming mode controls.

Reimplemented from makVre::DtVreJoystickController.

◆ createPorts()

virtual bool makVre::DtVreTurretJoystickController::createPorts ( )
overrideprotectedvirtual

Creates input and output ports for the component.

Returns
True if ports are successfully created, false otherwise

Creates the output ports needed by this component for turret control, including ports for azimuth, elevation, and aiming mode. These ports connect to the turret actuator component.

Reimplemented from makVre::DtVreJoystickController.

Member Data Documentation

◆ myAimingModePort

DtStringOutputPort* makVre::DtVreTurretJoystickController::myAimingModePort
protected

Output port for the turret aiming mode.

String output port that specifies the current aiming mode for the turret. This can be used to switch between different aiming behaviors such as direct aim, lead aim, or other specialized aiming modes.


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