|
VR-Engage
2.2
|
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>
Public Member Functions | |
| DtHumanJoystickMovementController (const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry=0) | |
| virtual | ~DtHumanJoystickMovementController () 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 | |
| DtIntegerOutputPort * | myStaticPostureOutputPort |
| DtHumanStateRepository * | myHumanStateRepository |
| const DtVreHumanJoystickMovementControllerDescriptor * | myComponentDescriptor |
| double | myTurningRate |
| double | mySpeedFactor |
| double | myForward |
| double | myStrafe |
| double | myYaw |
| double | myMouseYaw |
| double | myFrontendYaw |
| double | myFrontendPitch |
| int | myCurrentPosture |
| bool | myAssertCurrentPosture |
| bool | mySetYaw |
| double | mySetYawValue |
Ports and Port Groups | |
| DtHumanMovementControlOutputPortGroup * | myHumanMovementControlOutputPortGroup |
| DtBooleanOutputPort * | myIsMovingPort |
Private Member Functions | |
| DtHumanJoystickMovementController () | |
| DtHumanJoystickMovementController (const DtHumanJoystickMovementController &orig) | |
| DtHumanJoystickMovementController & | operator= (const DtHumanJoystickMovementController &orig) |
| makVre::DtHumanJoystickMovementController::DtHumanJoystickMovementController | ( | 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 human joystick movement controller component with the specified parameters.
Referenced by DtHumanJoystickMovementController(), and operator=().
|
overridevirtual |
Virtual destructor.
Cleans up resources used by the human joystick movement 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 DtHumanJoystickMovementController().
|
overridevirtual |
Gets the type identifier for this component.
Implements the DtSimComponent::type() method to return the type identifier for this component.
|
overridevirtual |
Creates port groups for this component.
Creates and initializes the output port groups used by this controller, particularly the human movement control port group.
|
overridevirtual |
Creates input and output ports for this component.
Creates and initializes all input and output ports used by this controller for movement-related functions, including ports for movement state and posture.
|
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 DtHumanJoystickMovementController().
|
overrideprotectedvirtual |
Processes joystick input and updates output ports.
| 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.
|
overrideprotectedvirtual |
Handles joystick connection event.
Called when a joystick is connected to the system. Activates joystick control mode for movement functions.
|
overrideprotectedvirtual |
Handles joystick disconnection event.
Called when a joystick is disconnected from the system. Deactivates joystick control mode for movement functions.
|
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.
|
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.
|
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.
|
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.
|
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.
|
protected |
Pointer to the movement controller descriptor.
Provides access to component-specific configuration parameters defined for this human joystick movement controller.
|
protected |
Rate of turning in response to inputs.
Controls how quickly the human entity turns in response to yaw inputs.
|
protected |
Speed multiplier for movement.
Adjusts the speed of forward/backward and strafe movement relative to the base movement speeds defined for the entity.
|
protected |
Current forward/backward movement input value.
Ranges from -1.0 (full backward) to 1.0 (full forward).
|
protected |
Current strafe (sideways) movement input value.
Ranges from -1.0 (full left) to 1.0 (full right).
|
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.
|
protected |
Current yaw (turning) input value from mouse.
Additional turning input from mouse movements, added to joystick input.
|
protected |
Current frontend (view) yaw angle.
The yaw angle used by the frontend/view system, which may differ from the entity's actual orientation.
|
protected |
Current frontend (view) pitch angle.
The pitch angle used by the frontend/view system, which controls the up/down view direction.
|
protected |
Current posture state of the human entity.
Integer representation of the current posture (standing, crouching, etc.)
|
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.
|
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.
|
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.