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

The XrManageButtonsActions class is responsible for managing button actions in an OpenXR application. This class encapsulates the functionality required to define and manage button actions, including creating action sets, defining button actions, and handling input from button devices. It provides an interface for integrating button input capabilities into an OpenXR application, allowing developers to create immersive experiences that utilize button presses and releases. More...

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

Inheritance diagram for evan::XrManageButtonsActions:
Collaboration diagram for evan::XrManageButtonsActions:

Public Member Functions

 XrManageButtonsActions (XrActionSet actionSet, XrDeviceBackend &deviceBackend)
 Constructs an XrManageButtonsActions instance with the specified action set and device backend.
 
 ~XrManageButtonsActions ()
 Destructor for the XrManageButtonsActions class. This destructor is responsible for cleaning up any resources associated with the button actions, such as destroying action spaces and releasing OpenXR handles. It ensures that all resources are properly released when an instance of XrManageButtonsActions is destroyed.
 
std::vector< std::shared_ptr< utility::event::Event > > getEvents (XrDeviceBackend &deviceBackend, std::shared_ptr< utility::event::HandMotionEvent > handMotionLeftEvent, std::shared_ptr< utility::event::HandMotionEvent > handMotionRightEvent)
 Retrieves the current state of the button actions and generates corresponding events.
 

Public Attributes

std::unique_ptr< XrButtonAction > _buttonAAction
 Unique pointer to the action associated with the A button.
 
std::unique_ptr< XrButtonAction > _buttonBAction
 Unique pointer to the action associated with the B button.
 
std::unique_ptr< XrButtonAction > _buttonXAction
 Unique pointer to the action associated with the X button.
 
std::unique_ptr< XrButtonAction > _buttonYAction
 Unique pointer to the action associated with the Menu button.
 
std::unique_ptr< XrButtonAction > _buttonMenuAction
 Unique pointer to the action associated with the System button.
 
std::unique_ptr< XrButtonAction > _buttonSystemAction
 Unique pointer to the action associated with the System button.
 

Detailed Description

The XrManageButtonsActions class is responsible for managing button actions in an OpenXR application. This class encapsulates the functionality required to define and manage button actions, including creating action sets, defining button actions, and handling input from button devices. It provides an interface for integrating button input capabilities into an OpenXR application, allowing developers to create immersive experiences that utilize button presses and releases.

Note
This class is designed to be extended with additional button actions as needed, allowing for flexible management of various input actions in an OpenXR application.

Definition at line 99 of file XrManageButtonsActions.hpp.

Constructor & Destructor Documentation

◆ XrManageButtonsActions()

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

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

This constructor initializes the button actions by creating the necessary OpenXR actions for button input based on the provided action set and device backend. It sets up the required action handles for button tracking and input management.

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

Definition at line 67 of file XrManageButtonsActions.cpp.

◆ ~XrManageButtonsActions()

evan::XrManageButtonsActions::~XrManageButtonsActions ( )

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

Definition at line 19 of file XrManageButtonsActions.cpp.

Member Function Documentation

◆ getEvents()

std::vector< std::shared_ptr< utility::event::Event > > evan::XrManageButtonsActions::getEvents ( evan::XrDeviceBackend &  deviceBackend,
std::shared_ptr< utility::event::HandMotionEvent >  handMotionLeftEvent,
std::shared_ptr< utility::event::HandMotionEvent >  handMotionRightEvent 
)

Retrieves the current state of the button actions and generates corresponding events.

This method queries the OpenXR runtime for the current state of the button actions, such as whether specific buttons are pressed or released. It generates a vector of events based on the retrieved state, which can be used by the application to respond to button input. The events may include information about whether specific buttons are currently pressed or released, allowing the application to react accordingly.

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

Definition at line 161 of file XrManageButtonsActions.cpp.

Member Data Documentation

◆ _buttonAAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonAAction

Unique pointer to the action associated with the A button.

This member holds the action object responsible for handling input events related to the A button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 161 of file XrManageButtonsActions.hpp.

◆ _buttonBAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonBAction

Unique pointer to the action associated with the B button.

This member holds the action object responsible for handling input events related to the B button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 170 of file XrManageButtonsActions.hpp.

◆ _buttonMenuAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonMenuAction

Unique pointer to the action associated with the System button.

This member holds the action object responsible for handling input events related to the System button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 198 of file XrManageButtonsActions.hpp.

◆ _buttonSystemAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonSystemAction

Unique pointer to the action associated with the System button.

This member holds the action object responsible for handling input events related to the System button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 208 of file XrManageButtonsActions.hpp.

◆ _buttonXAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonXAction

Unique pointer to the action associated with the X button.

This member holds the action object responsible for handling input events related to the X button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 179 of file XrManageButtonsActions.hpp.

◆ _buttonYAction

std::unique_ptr<XrButtonAction> evan::XrManageButtonsActions::_buttonYAction

Unique pointer to the action associated with the Menu button.

This member holds the action object responsible for handling input events related to the Menu button. It is initialized during the construction of the XrManageButtonsActions class.

Definition at line 188 of file XrManageButtonsActions.hpp.


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