Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
Input::XrInputHandler Class Reference

Handles OpenXR input actions and controller state. More...

#include <XrInputHandler.h>

Collaboration diagram for Input::XrInputHandler:

Public Member Functions

 XrInputHandler (const Engine::Rendering::Headset *headset, const Engine::Core::ApplicationContext *context)
void syncInputs (XrSpace playerSpace, XrTime predictedDisplayTime)
 Updates input state from OpenXR runtime.
XrSpace getLeftHandSpace ()
 Getter.
XrSpace getRightHandSpace ()
 Getter.
HandPoseInfo getHandPoseInfo (Hand hand) const
 Gets pose info for the specified hand.
glm::vec2 getRightThumbstick () const
 Gets the right thumbstick input for XZ plane movement.
glm::vec2 getLeftThumbstick () const
 Gets the left thumbstick input.
float getTriggerValue (Hand hand) const
 Gets the trigger value for the specified hand (0.0 to 1.0)
float getGripValue (Hand hand) const
 Gets the grip/squeeze value for the specified hand (0.0 to 1.0)

Public Attributes

std::vector< HandPoseInfohandPoseInfos

Private Attributes

XrActionSet defaultActionSet = XR_NULL_HANDLE
std::vector< XrPath > handPaths
XrAction aimPoseAction = XR_NULL_HANDLE
XrAction aimPoseLeftHand = XR_NULL_HANDLE
XrAction thumbstickAction_ = XR_NULL_HANDLE
XrAction triggerAction_ = XR_NULL_HANDLE
XrAction gripAction_ = XR_NULL_HANDLE
glm::vec2 rightThumbstick_ { 0.0f }
glm::vec2 leftThumbstick_ { 0.0f }
float triggerValues_ [2] = { 0.0f, 0.0f }
float gripValues_ [2] = { 0.0f, 0.0f }
Engine::EngineKernengine = nullptr
const Engine::Rendering::Headsetheadset = nullptr
const Engine::Core::ApplicationContextcontext = nullptr

Detailed Description

Handles OpenXR input actions and controller state.

Definition at line 124 of file XrInputHandler.h.

Constructor & Destructor Documentation

◆ XrInputHandler()

Input::XrInputHandler::XrInputHandler ( const Engine::Rendering::Headset * headset,
const Engine::Core::ApplicationContext * context )

References context, and headset.

Member Function Documentation

◆ getGripValue()

float Input::XrInputHandler::getGripValue ( Hand hand) const
nodiscard

Gets the grip/squeeze value for the specified hand (0.0 to 1.0)

◆ getHandPoseInfo()

HandPoseInfo Input::XrInputHandler::getHandPoseInfo ( Hand hand) const
nodiscard

Gets pose info for the specified hand.

Parameters
handWhich hand to query
Returns
Current pose and space information

◆ getLeftHandSpace()

XrSpace Input::XrInputHandler::getLeftHandSpace ( )

Getter.

◆ getLeftThumbstick()

glm::vec2 Input::XrInputHandler::getLeftThumbstick ( ) const
inlinenodiscard

Gets the left thumbstick input.

Returns
vec2 where x = left/right, y = forward/back

Definition at line 169 of file XrInputHandler.h.

References leftThumbstick_.

◆ getRightHandSpace()

XrSpace Input::XrInputHandler::getRightHandSpace ( )

Getter.

◆ getRightThumbstick()

glm::vec2 Input::XrInputHandler::getRightThumbstick ( ) const
inlinenodiscard

Gets the right thumbstick input for XZ plane movement.

Returns
vec2 where x = strafe (left/right), y = forward/back

Definition at line 160 of file XrInputHandler.h.

References rightThumbstick_.

◆ getTriggerValue()

float Input::XrInputHandler::getTriggerValue ( Hand hand) const
nodiscard

Gets the trigger value for the specified hand (0.0 to 1.0)

◆ syncInputs()

void Input::XrInputHandler::syncInputs ( XrSpace playerSpace,
XrTime predictedDisplayTime )

Updates input state from OpenXR runtime.

Parameters
playerSpaceReference space for pose calculations
predictedDisplayTimeTime for which poses should be predicted

Member Data Documentation

◆ aimPoseAction

XrAction Input::XrInputHandler::aimPoseAction = XR_NULL_HANDLE
private

Definition at line 190 of file XrInputHandler.h.

◆ aimPoseLeftHand

XrAction Input::XrInputHandler::aimPoseLeftHand = XR_NULL_HANDLE
private

Definition at line 191 of file XrInputHandler.h.

◆ context

const Engine::Core::ApplicationContext* Input::XrInputHandler::context = nullptr
private

Definition at line 209 of file XrInputHandler.h.

Referenced by XrInputHandler().

◆ defaultActionSet

XrActionSet Input::XrInputHandler::defaultActionSet = XR_NULL_HANDLE
private

Definition at line 187 of file XrInputHandler.h.

◆ engine

Engine::EngineKern* Input::XrInputHandler::engine = nullptr
private

Definition at line 206 of file XrInputHandler.h.

◆ gripAction_

XrAction Input::XrInputHandler::gripAction_ = XR_NULL_HANDLE
private

Definition at line 198 of file XrInputHandler.h.

◆ gripValues_

float Input::XrInputHandler::gripValues_[2] = { 0.0f, 0.0f }
private

Definition at line 204 of file XrInputHandler.h.

◆ handPaths

std::vector<XrPath> Input::XrInputHandler::handPaths
private

Definition at line 188 of file XrInputHandler.h.

◆ handPoseInfos

std::vector<HandPoseInfo> Input::XrInputHandler::handPoseInfos

Definition at line 184 of file XrInputHandler.h.

◆ headset

const Engine::Rendering::Headset* Input::XrInputHandler::headset = nullptr
private

Definition at line 208 of file XrInputHandler.h.

Referenced by XrInputHandler().

◆ leftThumbstick_

glm::vec2 Input::XrInputHandler::leftThumbstick_ { 0.0f }
private

Definition at line 202 of file XrInputHandler.h.

Referenced by getLeftThumbstick().

◆ rightThumbstick_

glm::vec2 Input::XrInputHandler::rightThumbstick_ { 0.0f }
private

Definition at line 201 of file XrInputHandler.h.

Referenced by getRightThumbstick().

◆ thumbstickAction_

XrAction Input::XrInputHandler::thumbstickAction_ = XR_NULL_HANDLE
private

Definition at line 194 of file XrInputHandler.h.

◆ triggerAction_

XrAction Input::XrInputHandler::triggerAction_ = XR_NULL_HANDLE
private

Definition at line 197 of file XrInputHandler.h.

◆ triggerValues_

float Input::XrInputHandler::triggerValues_[2] = { 0.0f, 0.0f }
private

Definition at line 203 of file XrInputHandler.h.


The documentation for this class was generated from the following file:
  • /home/magerbeton/Documents/gl3-vulkan/Engine/include/Engine/Input/XrInputHandler.h