evan 2026.1.4
Evan
Loading...
Searching...
No Matches
evan::XrHandsMotionActions Class Reference

The XrHandsMotionActions class is responsible for managing hand tracking actions in an OpenXR application. More...

#include <headers/evan/openxr/actions/XrHandsMotionActions.hpp>

Inheritance diagram for evan::XrHandsMotionActions:
Collaboration diagram for evan::XrHandsMotionActions:

Public Member Functions

 XrHandsMotionActions (XrActionSet actionSet, XrDeviceBackend &deviceBackend)
 Constructs an XrHandsMotionActions instance with the specified action set and device backend.
 
 ~XrHandsMotionActions ()
 Destructor for the XrHandsMotionActions class.
 
std::vector< std::shared_ptr< utility::event::Event > > getEvents (XrDeviceBackend &deviceBackend)
 Retrieves the current state of the hand motion actions and generates corresponding events.
 
void createHandsMotionSpaces (XrDeviceBackend &deviceBackend)
 Creates the hand motion actions and their corresponding spaces.
 

Public Attributes

XrAction _handAimAction = XR_NULL_HANDLE
 The XrAction handle for hand aim tracking.
 
XrAction _handGripAction = XR_NULL_HANDLE
 The XrAction handle for hand grip tracking.
 
XrSpace _handGripSpace [2]
 Action spaces for hand aim and grip tracking.
 
XrSpace _handAimSpace [2]
 Action spaces for hand aim and grip tracking.
 
std::shared_ptr< utility::event::HandMotionEvent > _leftHandEvent
 Shared pointer to the left hand motion event.
 
std::shared_ptr< utility::event::HandMotionEvent > _rightHandEvent
 Shared pointer to the right hand motion event.
 

Detailed Description

The XrHandsMotionActions class is responsible for managing hand tracking actions in an OpenXR application.

This class encapsulates the functionality required to define and manage hand tracking actions, including creating action sets, defining hand poses, and handling input from hand tracking devices. It provides an interface for integrating hand tracking capabilities into an OpenXR application, allowing developers to create immersive experiences that utilize hand gestures and movements.

Definition at line 39 of file XrHandsMotionActions.hpp.

Constructor & Destructor Documentation

◆ XrHandsMotionActions()

evan::XrHandsMotionActions::XrHandsMotionActions ( XrActionSet  actionSet,
XrDeviceBackend &  deviceBackend 
)

Constructs an XrHandsMotionActions instance with the specified action set and device backend.

This constructor initializes the hand motion actions by creating the necessary OpenXR actions for hand tracking based on the provided action set and device backend. It sets up the required action handles and spaces for hand aim and grip tracking.

Parameters
actionSetThe OpenXR action set to which the hand motion actions will belong.
deviceBackendThe device backend used for interacting with the OpenXR runtime and managing resources.

Definition at line 12 of file XrHandsMotionActions.cpp.

◆ ~XrHandsMotionActions()

evan::XrHandsMotionActions::~XrHandsMotionActions ( )

Destructor for the XrHandsMotionActions class.

This destructor is responsible for cleaning up any resources associated with the hand motion actions, such as destroying action spaces and releasing OpenXR handles. It ensures that all resources are properly released when an instance of XrHandsMotionActions is destroyed.

Definition at line 18 of file XrHandsMotionActions.cpp.

Member Function Documentation

◆ createHandsMotionSpaces()

void evan::XrHandsMotionActions::createHandsMotionSpaces ( XrDeviceBackend &  deviceBackend)

Creates the hand motion actions and their corresponding spaces.

This method is responsible for creating the OpenXR actions for hand aim and grip tracking, as well as the associated action spaces. It initializes the necessary OpenXR resources to enable hand tracking functionality in the application.

Parameters
deviceBackendThe device backend used for interacting with the OpenXR runtime and managing resources.

Definition at line 57 of file XrHandsMotionActions.cpp.

◆ getEvents()

std::vector< std::shared_ptr< utility::event::Event > > evan::XrHandsMotionActions::getEvents ( evan::XrDeviceBackend &  deviceBackend)

Retrieves the current state of the hand motion actions and generates corresponding events.

This method queries the OpenXR runtime for the current state of the hand motion actions, such as hand poses and gestures. It generates a vector of events based on the retrieved state, which can be used by the application to respond to hand tracking input. The events may include information about hand positions, orientations, and gestures detected by the OpenXR runtime.

Parameters
deviceBackendThe device backend used for interacting with the OpenXR runtime and managing resources.
Returns
A vector of shared pointers to events representing the current state of the hand motion actions.

Definition at line 42 of file XrHandsMotionActions.cpp.

Member Data Documentation

◆ _handAimAction

XrAction evan::XrHandsMotionActions::_handAimAction = XR_NULL_HANDLE

The XrAction handle for hand aim tracking.

This member variable holds the XrAction handle that represents the hand aim tracking action in the OpenXR runtime. It is used to query the state of hand aim tracking and to generate events based on the hand's position and orientation.

Definition at line 95 of file XrHandsMotionActions.hpp.

◆ _handAimSpace

XrSpace evan::XrHandsMotionActions::_handAimSpace[2]

Action spaces for hand aim and grip tracking.

These member variables hold the XrSpace handles for the hand aim and grip actions. They are used to define the spatial relationships for the hand tracking actions, allowing the application to determine the position and orientation of the hands in the virtual environment based on the OpenXR runtime's tracking data.

Definition at line 123 of file XrHandsMotionActions.hpp.

◆ _handGripAction

XrAction evan::XrHandsMotionActions::_handGripAction = XR_NULL_HANDLE

The XrAction handle for hand grip tracking.

This member variable holds the XrAction handle that represents the hand grip tracking action in the OpenXR runtime. It is used to query the state of hand grip tracking and to generate events based on the hand's position and orientation when gripping.

Definition at line 103 of file XrHandsMotionActions.hpp.

◆ _handGripSpace

XrSpace evan::XrHandsMotionActions::_handGripSpace[2]

Action spaces for hand aim and grip tracking.

These member variables hold the XrSpace handles for the hand aim and grip actions. They are used to define the spatial relationships for the hand tracking actions, allowing the application to determine the position and orientation of the hands in the virtual environment based on the OpenXR runtime's tracking data.

Definition at line 113 of file XrHandsMotionActions.hpp.

◆ _leftHandEvent

std::shared_ptr<utility::event::HandMotionEvent> evan::XrHandsMotionActions::_leftHandEvent

Shared pointer to the left hand motion event.

This member variable holds a shared pointer to the HandMotionEvent representing the current state of the left hand motion action. It is used to provide context for hand-related actions and can be accessed by other components of the application that require information about the left hand's position, orientation, and gestures.

Definition at line 146 of file XrHandsMotionActions.hpp.

◆ _rightHandEvent

std::shared_ptr<utility::event::HandMotionEvent> evan::XrHandsMotionActions::_rightHandEvent

Shared pointer to the right hand motion event.

This member variable holds a shared pointer to the HandMotionEvent representing the current state of the right hand motion action. It is used to provide context for hand-related actions and can be accessed by other components of the application that require information about the right hand's position, orientation, and gestures.

Definition at line 157 of file XrHandsMotionActions.hpp.


The documentation for this class was generated from the following files: