DtHumanJoystickMovementController enables joystick control of a human entity's movement capabilities. It manages walking, running, strafing, turning, and posture changes through joystick inputs. This controller works alongside combat controllers to provide comprehensive control of human entities.
Uses Descriptor Type: DtVreHumanJoystickMovementControllerDescriptor
#include <humanJoystickMovementController.h>
|
| static DtSimComponent * | creator (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0) |
| |
| static void | updateJoystickState (DtSimComponent &component, DtLocalObject &owner, bool enabled, int requestCount) |
| |
| static bool | restoreJoystickState (DtSimComponent &component, DtLocalObject &owner, bool incomingTransfer, bool &enabled, int &requestCount, bool hasDescriptor) |
| |
◆ DtHumanJoystickMovementController() [1/3]
| makVre::DtHumanJoystickMovementController::DtHumanJoystickMovementController |
( |
const DtString & | name, |
|
|
DtLocalObject * | owner, |
|
|
DtSimulationServices * | simManager, |
|
|
DtComponentDescriptor * | desc, |
|
|
DtReaderWriterRegistry * | 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 human joystick movement controller component with the specified parameters.
Referenced by DtHumanJoystickMovementController(), and operator=().
◆ ~DtHumanJoystickMovementController()
| virtual makVre::DtHumanJoystickMovementController::~DtHumanJoystickMovementController |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the human joystick movement controller component.
◆ DtHumanJoystickMovementController() [2/3]
| makVre::DtHumanJoystickMovementController::DtHumanJoystickMovementController |
( |
| ) |
|
|
private |
Default constructor (not implemented)
Default constructor is private and not implemented to prevent creation of instances without proper initialization.
◆ DtHumanJoystickMovementController() [3/3]
◆ type()
| virtual const char * makVre::DtHumanJoystickMovementController::type |
( |
| ) |
const |
|
overridevirtual |
Gets the type identifier for this component.
- Returns
- String identifying the component type (DtVreHumanJoystickMovementControllerType)
Implements the DtSimComponent::type() method to return the type identifier for this component.
◆ preFirstTickInit()
| virtual void makVre::DtHumanJoystickMovementController::preFirstTickInit |
( |
| ) |
|
|
overridevirtual |
Calls base first-tick initialization and restores incoming joystick state.
◆ createPortGroups()
| virtual bool makVre::DtHumanJoystickMovementController::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, particularly the human movement control port group.
◆ createPorts()
| virtual bool makVre::DtHumanJoystickMovementController::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 movement-related functions, including ports for movement state and posture.
◆ creator()
| static DtSimComponent * makVre::DtHumanJoystickMovementController::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.
◆ operator=()
Assignment operator (not implemented)
- Returns
- Reference to this object
Assignment operator is private and not implemented to prevent assignment.
References DtHumanJoystickMovementController().
◆ calcAndSetPortValues()
| virtual void makVre::DtHumanJoystickMovementController::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 for movement functions.
◆ joystickConnected()
| virtual void makVre::DtHumanJoystickMovementController::joystickConnected |
( |
| ) |
|
|
overrideprotectedvirtual |
Handles joystick connection event.
Called when a joystick is connected to the system. Activates joystick control mode for movement functions.
◆ joystickDisconnected()
| virtual void makVre::DtHumanJoystickMovementController::joystickDisconnected |
( |
| ) |
|
|
overrideprotectedvirtual |
Handles joystick disconnection event.
Called when a joystick is disconnected from the system. Deactivates joystick control mode for movement functions.
◆ tick()
| virtual void makVre::DtHumanJoystickMovementController::tick |
( |
| ) |
|
|
overrideprotectedvirtual |
Updates the controller state each simulation frame.
Processes movement-related controls and updates the human entity's movement state and posture based on current joystick inputs.
◆ myHumanMovementControlOutputPortGroup
| DtHumanMovementControlOutputPortGroup* makVre::DtHumanJoystickMovementController::myHumanMovementControlOutputPortGroup |
|
protected |
Output port group for human movement control.
Contains all output ports related to human movement control, including forward/backward movement, strafing, turning, and running states.
◆ myIsMovingPort
| DtBooleanOutputPort* makVre::DtHumanJoystickMovementController::myIsMovingPort |
|
protected |
Output port indicating movement state.
When true, indicates that the entity is being actively moved by this controller. Used to synchronize animations and other movement-dependent systems.
◆ myStaticPostureOutputPort
| DtIntegerOutputPort* makVre::DtHumanJoystickMovementController::myStaticPostureOutputPort |
|
protected |
Output port for static posture control.
Controls the static posture of the entity (standing, crouching, prone, etc.) using integer values to represent different postures.
◆ myHumanStateRepository
| DtHumanStateRepository* makVre::DtHumanJoystickMovementController::myHumanStateRepository |
|
protected |
Pointer to the human state repository.
Provides access to the human entity's state information for reading and modifying state based on movement inputs.
◆ myComponentDescriptor
Pointer to the movement controller descriptor.
Provides access to component-specific configuration parameters defined for this human joystick movement controller.
◆ myTurningRate
| double makVre::DtHumanJoystickMovementController::myTurningRate |
|
protected |
Rate of turning in response to inputs.
Controls how quickly the human entity turns in response to yaw inputs.
◆ mySpeedFactor
| double makVre::DtHumanJoystickMovementController::mySpeedFactor |
|
protected |
Speed multiplier for movement.
Adjusts the speed of forward/backward and strafe movement relative to the base movement speeds defined for the entity.
◆ myForward
| double makVre::DtHumanJoystickMovementController::myForward |
|
protected |
Current forward/backward movement input value.
Ranges from -1.0 (full backward) to 1.0 (full forward).
◆ myStrafe
| double makVre::DtHumanJoystickMovementController::myStrafe |
|
protected |
Current strafe (sideways) movement input value.
Ranges from -1.0 (full left) to 1.0 (full right).
◆ myYaw
| double makVre::DtHumanJoystickMovementController::myYaw |
|
protected |
Current yaw (turning) input value from joystick.
Controls the rate of turning, with positive values for turning right and negative values for turning left.
◆ myMouseYaw
| double makVre::DtHumanJoystickMovementController::myMouseYaw |
|
protected |
Current yaw (turning) input value from mouse.
Additional turning input from mouse movements, added to joystick input.
◆ myFrontendYaw
| double makVre::DtHumanJoystickMovementController::myFrontendYaw |
|
protected |
Current frontend (view) yaw angle.
The yaw angle used by the frontend/view system, which may differ from the entity's actual orientation.
◆ myFrontendPitch
| double makVre::DtHumanJoystickMovementController::myFrontendPitch |
|
protected |
Current frontend (view) pitch angle.
The pitch angle used by the frontend/view system, which controls the up/down view direction.
◆ myCurrentPosture
| int makVre::DtHumanJoystickMovementController::myCurrentPosture |
|
protected |
Current posture state of the human entity.
Integer representation of the current posture (standing, crouching, etc.)
◆ myAssertCurrentPosture
| bool makVre::DtHumanJoystickMovementController::myAssertCurrentPosture |
|
protected |
Flag indicating whether to force posture state.
When true, the controller will assert the current posture value even if it conflicts with other movement states.
◆ mySetYaw
| bool makVre::DtHumanJoystickMovementController::mySetYaw |
|
protected |
Flag indicating whether to set an absolute yaw value.
When true, the controller will set the entity's yaw to the specific value in mySetYawValue instead of using incremental turning.
◆ mySetYawValue
| double makVre::DtHumanJoystickMovementController::mySetYawValue |
|
protected |
Absolute yaw value to set when mySetYaw is true.
The absolute yaw angle (in radians) to set for the entity when mySetYaw is true.
The documentation for this class was generated from the following file: