8#include "evan/openxr/actions/XrManageThumbStickActions.hpp"
9#include "evan/openxr/XrDeviceBackend.hpp"
12 utility::event::HandEvent::HandType
handType)
15 this->
getLogger().info() <<
"Creating thumb stick action for hand "
16 <<
static_cast<int>(
handType) <<
"...";
21 this->
getLogger().info() <<
"Destroying thumb stick action for hand "
22 <<
static_cast<int>(_handType) <<
"...";
29std::vector<std::shared_ptr<utility::event::Event>>
34 std::vector<std::shared_ptr<utility::event::Event>>
events = {};
44 std::make_shared<utility::event::HandThumbStickEvent>();
49 <<
"Thumb stick for hand " <<
static_cast<int>(_handType)
50 <<
" is active at position (" + std::to_string(
state.currentState.x)
51 +
", " + std::to_string(
state.currentState.y) +
")";
61 <<
"Creating thumb stick actions for left and right hands...";
63 _leftHandThumbStickActions = std::make_unique<XrHandThumbStickAction>(
64 utility::event::HandEvent::HandType::Left);
65 _rightHandThumbStickActions = std::make_unique<XrHandThumbStickAction>(
66 utility::event::HandEvent::HandType::Right);
72 "/user/hand/left/input/thumbstick";
78 <<
"Left hand thumb stick action created successfully.";
84 "/user/hand/right/input/thumbstick";
90 <<
"Right hand thumb stick action created successfully.";
95 this->
getLogger().info() <<
"Destroying thumb stick actions...";
102std::vector<std::shared_ptr<utility::event::Event>>
106 std::vector<std::shared_ptr<utility::event::Event>>
events;
110 _leftHandThumbStickActions->getEvent(
deviceBackend,
nullptr);
116 _rightHandThumbStickActions->getEvent(
deviceBackend,
nullptr);
The XrDeviceBackend class is responsible for managing the OpenXR device backend, including instance c...
std::vector< std::shared_ptr< utility::event::Event > > getEvent(evan::XrDeviceBackend &deviceBackend, std::shared_ptr< utility::event::HandMotionEvent > handMotionEvent) override
Retrieves the current thumb stick events from the device backend.
XrHandThumbStickAction(utility::event::HandEvent::HandType handType)
Constructs an XrHandThumbStickAction instance for the specified hand type.
~XrHandThumbStickAction()
Destructor for the XrHandThumbStickAction class.
~XrManageThumbStickActions()
Destructor for the XrManageThumbStickActions class.
XrManageThumbStickActions(XrActionSet actionSet, XrDeviceBackend &deviceBackend)
Constructs an XrManageThumbStickActions instance with the specified action set and device backend.
std::vector< std::shared_ptr< utility::event::Event > > getEvents(evan::XrDeviceBackend &deviceBackend)
Retrieves the current thumb stick events from the device backend.
Encapsulates properties required for creating an OpenXR action.
Small result wrapper used by helpers that must return both a status and a value (e....