DtBallisticGunJoyController extends the DtBallisticGunController class with the ability to be controlled from a joystick. It implements the DtJoystickControllerInterface to process joystick input and translate it to appropriate gun control outputs.
Uses Descriptor Type: DtBallisticGunJoyControllerDescriptor
#include <ballisticGunJoyController.h>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
◆ DtBallisticGunJoyController() [1/3]
| makVre::DtBallisticGunJoyController::DtBallisticGunJoyController |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc, |
|
|
DtReaderWriterRegistry *const | parentRegistry = 0 ) |
Constructor.
- Parameters
-
| 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 ballistic gun joy controller component with the specified parameters.
Referenced by DtBallisticGunJoyController(), and operator=().
◆ ~DtBallisticGunJoyController()
| virtual makVre::DtBallisticGunJoyController::~DtBallisticGunJoyController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the ballistic gun joy controller component.
◆ DtBallisticGunJoyController() [2/3]
| makVre::DtBallisticGunJoyController::DtBallisticGunJoyController |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
◆ DtBallisticGunJoyController() [3/3]
Copy constructor (not implemented)
Copy constructor is private and not implemented to prevent copy construction.
References DtBallisticGunJoyController().
◆ type()
| virtual const char * makVre::DtBallisticGunJoyController::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtBallisticGunJoyControllerType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
Reimplemented in makVre::DtVreBallisticGunJoyController.
◆ createActiveJoystickPort()
| virtual bool makVre::DtBallisticGunJoyController::createActiveJoystickPort |
( |
| ) |
|
|
virtual |
Creates the joystick active state output port.
- Returns
- True if port was created successfully, false otherwise
Creates the output port used to indicate when joystick control is active. This is called during initialization to set up communication with the actuator.
◆ activeJoystickPort()
| virtual DtBooleanOutputPort * makVre::DtBallisticGunJoyController::activeJoystickPort |
( |
| ) |
const |
|
virtual |
Gets the joystick active state output port.
- Returns
- Pointer to the joystick active output port
Provides access to the port that indicates when joystick control is active.
◆ createElevationPort()
| virtual bool makVre::DtBallisticGunJoyController::createElevationPort |
( |
| ) |
|
|
virtual |
Creates the elevation control output port.
- Returns
- True if port was created successfully, false otherwise
Creates the output port used to control gun elevation via joystick input.
◆ elevationPort()
| virtual DtConstrainedAnalogOutputPort * makVre::DtBallisticGunJoyController::elevationPort |
( |
| ) |
const |
|
virtual |
Gets the elevation control output port.
- Returns
- Pointer to the elevation output port
Provides access to the port that controls gun elevation.
◆ chooseAmmo()
| virtual bool makVre::DtBallisticGunJoyController::chooseAmmo |
( |
const DtEntityType & | name = DtEntityType::nullType() | ) |
|
|
virtual |
Selects ammunition type for the weapon.
- Parameters
-
| name | The entity type of ammunition to select, or null for default |
- Returns
- True if ammunition selection was successful, false otherwise
Attempts to select the specified ammunition type for the weapon. If no type is specified (nullType), uses the default ammunition.
◆ canFire()
| virtual bool makVre::DtBallisticGunJoyController::canFire |
( |
| ) |
|
|
virtual |
Checks if the weapon can currently fire.
- Returns
- True if the weapon can fire, false otherwise
Determines whether the weapon is currently able to fire based on ammunition availability and other weapon state conditions.
◆ creator()
| static DtSimComponent * makVre::DtBallisticGunJoyController::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.
◆ tick()
| virtual void makVre::DtBallisticGunJoyController::tick |
( |
| ) |
|
|
overrideprotectedvirtual |
Updates the controller state each simulation frame.
Processes joystick input and updates output ports to control the associated ballistic gun actuator component.
Reimplemented in makVre::DtVreBallisticGunJoyController.
◆ calcAndSetPortValues()
| virtual void makVre::DtBallisticGunJoyController::calcAndSetPortValues |
( |
const DtString & | functionGroup, |
|
|
const DtString & | function, |
|
|
double | value, |
|
|
bool | repeat ) |
|
overrideprotectedvirtual |
Processes joystick input and updates output ports.
- Parameters
-
| 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 accordingly.
◆ joystickConnected()
| virtual void makVre::DtBallisticGunJoyController::joystickConnected |
( |
| ) |
|
|
overrideprotectedvirtual |
Handles joystick connection event.
Called when a joystick is connected to the system. Activates joystick control mode for this controller.
◆ joystickDisconnected()
| virtual void makVre::DtBallisticGunJoyController::joystickDisconnected |
( |
| ) |
|
|
overrideprotectedvirtual |
Handles joystick disconnection event.
Called when a joystick is disconnected from the system. Deactivates joystick control mode for this controller.
◆ createPorts()
| virtual bool makVre::DtBallisticGunJoyController::createPorts |
( |
| ) |
|
|
overrideprotectedvirtual |
Creates all required output ports for this controller.
- Returns
- True if all ports were created successfully, false otherwise
Overridden to create the specific output ports needed by this controller, including elevation control and joystick active state ports.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtBallisticGunJoyController().
◆ myElevationPort
| DtConstrainedAnalogOutputPort* makVre::DtBallisticGunJoyController::myElevationPort |
|
protected |
Output Port Name: elevation
Output Port Description:
Output Port Range: -1. to 1.
Output Port Default Value:
Output Group Parent:
◆ myActiveJoystickPort
| DtBooleanOutputPort* makVre::DtBallisticGunJoyController::myActiveJoystickPort |
|
protected |
Output Port Name: joystick-active
Output Port Description: Indicates whether controller behavior is being executed through a joystick.
Output Port Range:
Output Port Default Value: false
Output Group Parent:
◆ myFiring
| bool makVre::DtBallisticGunJoyController::myFiring |
|
protected |
Flag indicating if the weapon is currently firing.
◆ myFireButtonDown
| bool makVre::DtBallisticGunJoyController::myFireButtonDown |
|
protected |
Flag indicating if the fire button is currently pressed.
The documentation for this class was generated from the following file: