|
evan 2026.1.4
Evan
|
Represents an OpenXR action and its associated properties. More...
#include <headers/evan/openxr/actions/AXrAction.hpp>


Classes | |
| struct | PropertiesXrActions |
| Encapsulates properties required for creating an OpenXR action. More... | |
Public Member Functions | |
| virtual | ~AXrAction () |
| Destructor for AXrAction, responsible for cleaning up OpenXR resources. | |
| virtual std::vector< std::shared_ptr< utility::event::Event > > | getEvent (XrDeviceBackend &deviceBackend, std::shared_ptr< utility::event::HandMotionEvent > handMotionEvent)=0 |
| Polls the OpenXR runtime and produces events for this action. | |
| XrAction | getAction () const |
| Retrieves the XrAction handle associated with this AXrAction. | |
| const std::string & | getActionName () const |
| Retrieves the name of the action. | |
| const std::string & | getBindingPath () const |
| Retrieves the binding path of the action. | |
| void | createAction (const PropertiesXrActions &properties) |
| Creates an OpenXR action based on the provided properties. | |
Represents an OpenXR action and its associated properties.
This class encapsulates the creation and management of an OpenXR action, including its name, binding path, and the underlying XrAction handle. It provides methods to retrieve the action's properties and to create the action based on specified properties. The class also ensures proper cleanup of the OpenXR resources when the object is destroyed.
Definition at line 36 of file AXrAction.hpp.
|
inlinevirtual |
Destructor for AXrAction, responsible for cleaning up OpenXR resources.
This destructor ensures that the XrAction handle is properly destroyed when the AXrAction object goes out of scope. It also checks if the associated action space is valid and destroys it if necessary, ensuring that all OpenXR resources are released correctly to prevent memory leaks and other issues.
Definition at line 85 of file AXrAction.hpp.
| void evan::AXrAction::createAction | ( | const PropertiesXrActions & | properties | ) |
Creates an OpenXR action based on the provided properties.
This method takes a PropertiesXrActions structure containing all necessary parameters for creating an OpenXR action, such as the action's name, binding path, associated action set, and type. It uses this information to create the action using the OpenXR API and stores the resulting XrAction handle for later use. If the action creation fails, it throws a runtime error with details about the failure.
| properties | A structure containing all necessary parameters for creating an OpenXR action. |
| std::runtime_error | If action creation fails, providing details about the failure. |
Definition at line 29 of file AXrAction.cpp.
| XrAction evan::AXrAction::getAction | ( | ) | const |
Retrieves the XrAction handle associated with this AXrAction.
This method returns the XrAction handle that represents the OpenXR action managed by this class. The handle can be used in OpenXR API calls to interact with the action, such as binding it to input devices or querying its state.
Definition at line 14 of file AXrAction.cpp.
| const std::string & evan::AXrAction::getActionName | ( | ) | const |
Retrieves the name of the action.
This method returns the name of the action, which is used for identification and debugging purposes. The name should be unique within the action set to avoid conflicts with other actions.
Definition at line 19 of file AXrAction.cpp.
| const std::string & evan::AXrAction::getBindingPath | ( | ) | const |
Retrieves the binding path of the action.
This method returns the binding path for the action, which specifies how the action is bound to input devices. The binding path should follow OpenXR's binding syntax and conventions to ensure proper functionality when interacting with input devices.
Definition at line 24 of file AXrAction.cpp.
|
pure virtual |
Polls the OpenXR runtime and produces events for this action.
Query the OpenXR runtime for the current state of this action and translate any relevant state changes into a list of runtime events. Implementations should create and return a vector of unique pointers to utility::event::Event that represent meaningful input occurrences (e.g. button pressed/released, axis movement, pose updates) detected since the last poll.
| deviceBackend | Reference to the XrDeviceBackend used to communicate with the OpenXR session and query action state. |
| handMotionEvent | Optional shared pointer to a HandMotionEvent that may be used to provide context for hand-related actions. This parameter can be nullptr if the action is not related to hand motion. |
Implemented in evan::XrHandThumbStickAction, and evan::XrButtonAction.