8#ifndef META_OCEAN_PLATFORM_OPENXR_ACTION_SET_H
9#define META_OCEAN_PLATFORM_OPENXR_ACTION_SET_H
108 bool initialize(const XrInstance& xrInstance, const std::
string& name, const std::
string& description, const uint32_t priority = 0u);
180 inline
bool suggestActionBindings(const XrInstance& xrInstance, const std::
string& interactionProfile);
206 template <typename T>
234 inline operator XrActionSet() const;
241 explicit inline operator
bool() const;
258 template <typename T>
259 static
bool actionState(const XrSession& xrSession, const XrAction& xrAction, T& state);
300 *
this = std::move(actionSet);
318 ocean_assert(xrInstance != XR_NULL_HANDLE);
319 ocean_assert(!interactionProfile.empty());
327 ocean_assert(xrSession != XR_NULL_HANDLE);
332 const ActionIdMap::const_iterator iAction =
actionIdMap_.find(actionId);
336 ocean_assert(
false &&
"Unknown action id");
346 ocean_assert(xrSession != XR_NULL_HANDLE);
347 ocean_assert(xrAction != XR_NULL_HANDLE);
352 xrActionStateGetInfo.action = xrAction;
354 const XrResult xrResult = xrGetActionStateBoolean(xrSession, &xrActionStateGetInfo, &state);
355 ocean_assert(xrResult == XR_SUCCESS);
357 return xrResult == XR_SUCCESS;
363 ocean_assert(xrSession != XR_NULL_HANDLE);
364 ocean_assert(xrAction != XR_NULL_HANDLE);
369 xrActionStateGetInfo.action = xrAction;
371 const XrResult xrResult = xrGetActionStateFloat(xrSession, &xrActionStateGetInfo, &state);
372 ocean_assert(xrResult == XR_SUCCESS);
374 return xrResult == XR_SUCCESS;
380 ocean_assert(xrSession != XR_NULL_HANDLE);
381 ocean_assert(xrAction != XR_NULL_HANDLE);
386 xrActionStateGetInfo.action = xrAction;
388 const XrResult xrResult = xrGetActionStateVector2f(xrSession, &xrActionStateGetInfo, &state);
389 ocean_assert(xrResult == XR_SUCCESS);
391 return xrResult == XR_SUCCESS;
397 ocean_assert(xrSession != XR_NULL_HANDLE);
398 ocean_assert(xrAction != XR_NULL_HANDLE);
403 xrActionStateGetInfo.action = xrAction;
405 const XrResult xrResult = xrGetActionStatePose(xrSession, &xrActionStateGetInfo, &state);
406 ocean_assert(xrResult == XR_SUCCESS);
408 return xrResult == XR_SUCCESS;
411inline ActionSet::operator XrActionSet()
const
418inline ActionSet::operator bool()
const
This class implements a recursive lock object.
Definition Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:147
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
The namespace covering the entire Ocean framework.
Definition Accessor.h:15