|
VR-Engage
2.2
|
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>
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) | |
| DtVreTurretJoystickController & | operator= (const DtVreTurretJoystickController &orig) |
Additional Inherited Members | |
Protected Types inherited from makVre::DtVreJoystickController | |
| using | OutputPortMap = std::map<std::string, DtOutputPort*> |
| makVre::DtVreTurretJoystickController::DtVreTurretJoystickController | ( | 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 turret joystick controller component with the specified parameters. Initializes the controller and sets up the required output ports for turret control.
Referenced by operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the turret joystick 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 makVre::DtVreJoystickController::DtVreJoystickController().
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
Reimplemented from makVre::DtVreJoystickController.
|
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 DtVreTurretJoystickController().
|
overrideprotectedvirtual |
Processes joystick input and sets corresponding port values.
| functionGroup | The function group identifier for the input |
| function | The specific function name for the input |
| value | The input value (typically in range [-1.0, 1.0]) |
| repeat | Flag 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.
|
overrideprotectedvirtual |
Creates input and output ports for the component.
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.
|
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.