evan 2026.1.4
Evan
Loading...
Searching...
No Matches
AXrAction.hpp
1/*
2** ETIB PROJECT, 2026
3** evan
4** File description:
5** AXrAction
6*/
7
8#pragma once
9
10#include "evan/EvanPlatform.hpp"
11
12#include "evan/openxr/InteractionProfile.hpp"
13
14#include <utility/event/hand_button_event.hpp>
15#include <utility/event/hand_motion_event.hpp>
16
17#include <utility/logging/loggable.hpp>
18#include <utility/logging/default_logger.hpp>
19
20namespace evan
21{
22
23 class XrDeviceBackend;
24
36 class AXrAction:
37 protected utility::logging::Loggable<AXrAction,
38 utility::logging::DefaultLogger>
39 {
40 public:
75
85 virtual ~AXrAction()
86 {
87 if (_action != XR_NULL_HANDLE)
88 xrDestroyAction(_action);
89 if (_actionSpace != XR_NULL_HANDLE) {
90 xrDestroySpace(_actionSpace);
91 }
92 }
93
114 virtual std::vector<std::shared_ptr<utility::event::Event>>
116 std::shared_ptr<utility::event::HandMotionEvent>
117 handMotionEvent) = 0;
118
127 XrAction getAction() const;
128
137 const std::string &getActionName() const;
138
148 const std::string &getBindingPath() const;
149
167
168 private:
171 XrAction _action = XR_NULL_HANDLE;
172
175 XrSpace _actionSpace = XR_NULL_HANDLE;
176
179 XrPath _actionSubactionPath;
180
183 std::string _actionName;
184
187 std::string _bindingPath;
188 };
189
190} // namespace evan
Represents an OpenXR action and its associated properties.
Definition AXrAction.hpp:39
const std::string & getActionName() const
Retrieves the name of the action.
Definition AXrAction.cpp:19
void createAction(const PropertiesXrActions &properties)
Creates an OpenXR action based on the provided properties.
Definition AXrAction.cpp:29
virtual ~AXrAction()
Destructor for AXrAction, responsible for cleaning up OpenXR resources.
Definition AXrAction.hpp:85
XrAction getAction() const
Retrieves the XrAction handle associated with this AXrAction.
Definition AXrAction.cpp:14
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.
const std::string & getBindingPath() const
Retrieves the binding path of the action.
Definition AXrAction.cpp:24
The XrDeviceBackend class is responsible for managing the OpenXR device backend, including instance c...
Encapsulates properties required for creating an OpenXR action.
Definition AXrAction.hpp:52
std::string actionName
The name of the action, used for identification and debugging purposes. It should be unique within th...
Definition AXrAction.hpp:56
XrActionType actionType
The type of the action, indicating how it is used in the application. This can be a boolean input,...
Definition AXrAction.hpp:73
XrActionSet actionSet
The action set to which this action belongs. An action set is a collection of actions that can be act...
Definition AXrAction.hpp:67
std::string bindingPath
The binding path for the action, specifying how the action is bound to input devices....
Definition AXrAction.hpp:61
Small result wrapper used by helpers that must return both a status and a value (e....
Definition Error.hpp:89