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

Detailed Description

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>

Inheritance diagram for makVre::DtHumanJoystickMovementController:
[legend]

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 DtVreHumanJoystickMovementControllerDescriptormyComponentDescriptor
 
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)
 
DtHumanJoystickMovementControlleroperator= (const DtHumanJoystickMovementController &orig)
 

Constructor & Destructor Documentation

◆ DtHumanJoystickMovementController() [1/3]

makVre::DtHumanJoystickMovementController::DtHumanJoystickMovementController ( 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 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]

makVre::DtHumanJoystickMovementController::DtHumanJoystickMovementController ( const DtHumanJoystickMovementController & orig)
private

Copy constructor (not implemented)

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

References DtHumanJoystickMovementController().

Member Function Documentation

◆ 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.

◆ 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
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=()

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

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
functionGroupThe function group identifier for the input
functionThe specific function identifier within the group
valueThe input value from the joystick
repeatFlag 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.

Member Data Documentation

◆ 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

const DtVreHumanJoystickMovementControllerDescriptor* makVre::DtHumanJoystickMovementController::myComponentDescriptor
protected

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: