|
VR-Engage
2.2
|
DtHumanVirtualRealityLogic manages VR-specific interaction for the human role, including processing controller input, head tracking, hand tracking, and providing VR-specific behavior for weapons, movement, and interaction. It translates VR controller input into appropriate simulation actions.
#include <humanVirtualRealityLogic.h>
Classes | |
| struct | ControllerIdentifier |
Public Member Functions | |
| DtHumanVirtualRealityLogic () | |
| virtual | ~DtHumanVirtualRealityLogic () override |
| virtual bool | initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual void | processControllerStates (const ControllerStateMap &stateMap) |
| virtual void | resetHeadPos () |
| virtual void | handleResetHeadPosInput (int val) |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual void | startVr () |
| virtual void | stopVr () |
| virtual makVre::DtVreMessageResult | handleResetVrHeadPos (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleToggleMixedReality (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleEnterPlayerState (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleExitPlayerState (makVre::DtVreMessage *msg) |
| virtual const ControllerState * | findController (ControllerIdentifier &identifier, const ControllerStateMap &stateMap) |
| virtual void | yaw (double val) |
Protected Member Functions inherited from makVre::DtPlayerComponent | |
| virtual void | initializeStateAttributes () |
Protected Attributes | |
| makVrv::DtVirtualRealityDriver * | myVrDriver |
| DtHumanVrEventProcessor * | myEventProcessor |
| DtHumanControlLogic * | myHumanLogic |
| makVre::DtActionMenuLogic * | myMenuLogic |
| makVrv::DtSubmitOverlayCallback * | myVrOverlay |
| bool | myVrEnabled |
| bool | myVrWasEnabled |
| bool | myRightHanded |
| bool | mySingleHandAiming |
| bool | myDidHaveHandMotion |
| bool | myDidNoHandMotionReset |
| ControllerIdentifier | myHeadId |
| ControllerIdentifier | myLeftHandId |
| ControllerIdentifier | myRightHandId |
| DtTaitBryan | myWeaponOverride |
| int | myFramesSinceMenu |
| DtVirtualDpad | myVirtualDpad |
| int | myLastMainChannelRenderOrder |
| double | myCurrentHeading |
| double | myYaw |
| double | myAimYaw |
| double | myAimPitch |
| bool | myHasVRInput |
| bool | myInitializedHeading |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| using makVre::DtHumanVirtualRealityLogic::ControllerStateMap = makVrv::DtVirtualRealityEventManager::ControllerStateMap |
Type alias for the controller state map.
| using makVre::DtHumanVirtualRealityLogic::Bitfield = makVrv::DtVirtualRealityControllerState::Bitfield |
Type alias for the controller state bitfield.
| using makVre::DtHumanVirtualRealityLogic::ControllerId = makVrv::DtVirtualRealityControllerState::ControllerId |
Type alias for the controller identifier.
| using makVre::DtHumanVirtualRealityLogic::DtVector2f = makVrv::DtVirtualRealityControllerState::DtVector2f |
Type alias for 2D vector used by VR controllers.
Type alias for the VR controller state.
| makVre::DtHumanVirtualRealityLogic::DtHumanVirtualRealityLogic | ( | ) |
Default constructor.
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Initializes the VR logic component.
| player | Pointer to the player station |
| config | Configuration settings for initialization |
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Updates VR processing for the current frame.
| dt | Delta time since the last frame in seconds |
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Cleans up resources when the component is being shut down.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Returns the type identifier string for this component, which is used by the VR-Engage framework for component identification and management. The returned value matches DtHumanVirtualRealityLogicType.
Implements makVre::DtPlayerComponent.
Referenced by makVre::DtHumanVirtualRealityLogic::ControllerIdentifier::ControllerIdentifier().
|
virtual |
Processes controller state updates.
| stateMap | Map of controller states to process |
|
virtual |
Resets the head position in VR.
Recenters the VR view based on the current physical head position
|
virtual |
Input handler for resetting head position.
| val | Input value (1 to trigger reset) |
Handles the reset head position input action from bound controls
|
protectedvirtual |
Starts VR mode.
Initializes and enables VR rendering and input
|
protectedvirtual |
Stops VR mode.
Disables VR rendering and input
|
protectedvirtual |
Handles VR head position reset messages.
| msg | Pointer to the message being processed |
|
protectedvirtual |
Handles toggle mixed reality messages.
| msg | Pointer to the message being processed |
|
protectedvirtual |
Handles player state enter messages.
| msg | Pointer to the message being processed |
If incoming message is for entering the menu state, disables VR
|
protectedvirtual |
Handles player state exit messages.
| msg | Pointer to the message being processed |
If incoming message is for exiting the menu state, enables VR
|
protectedvirtual |
Finds a controller in the controller state map.
| identifier | [in,out] Identifier of the controller to find |
| stateMap | Map of controller states to search in |
|
protectedvirtual |
Applies yaw rotation input.
| val | Yaw rotation value |
|
protected |
Pointer to the VR driver.
|
protected |
Pointer to the VR event processor.
|
protected |
Pointer to the human control logic component.
|
protected |
Pointer to the action menu logic component.
|
protected |
Pointer to the VR overlay callback.
|
protected |
Flag indicating if VR is currently enabled.
|
protected |
Flag tracking previous VR enabled state.
|
protected |
Flag indicating if the player is right-handed.
|
protected |
Flag indicating if single-hand aiming is enabled.
|
protected |
Flag tracking if hand motion was detected.
|
protected |
Flag tracking if a no-motion reset was performed.
|
protected |
Identifier for the head/HMD controller.
|
protected |
Identifier for the left hand controller.
|
protected |
Identifier for the right hand controller.
|
protected |
Weapon orientation override in Tait-Bryan angles.
|
protected |
Counter for frames elapsed since menu was active.
|
protected |
Virtual direction pad for VR movement.
|
protected |
Last known render order for the main channel.
|
protected |
Current heading angle in radians.
|
protected |
Current yaw angle in radians.
|
protected |
Current aim yaw angle in radians.
|
protected |
Current aim pitch angle in radians.
|
protected |
Flag indicating if VR input is available.
|
protected |
Flag indicating if heading has been initialized.