Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
XrRig.h
1#pragma once
2
3#include "Engine/Input/XrInputHandler.h"
4
5#include <glm/glm.hpp>
6#include <glm/gtc/quaternion.hpp>
7
8#include <cstddef>
9
10namespace Engine::Rendering
11{
12 class Headset;
13}
14
15namespace Input
16{
21 {
25 bool isValid = false;
26
30 glm::vec3 position{ 0.0f };
31
35 glm::quat orientation{ 1.0f, 0.0f, 0.0f, 0.0f };
36 };
37
43 class XrRig
44 {
45 public:
49 XrRig(const XrInputHandler& inputHandler, const Engine::Rendering::Headset * headset );
50
55
59 [[nodiscard]] TrackedHandPose getHandPose( Hand hand ) const;
60
61 private:
62 const XrInputHandler * inputHandler_ = nullptr;
65 };
66} // namespace Input
Owns the OpenXR session, XR swapchain, eye transforms, and per-frame XR submission state.
Definition Headset.h:55
Creates OpenXR controller actions from the profile registry and samples the input state.
TrackedHandPose getHandPose(Hand hand) const
Returns the last resolved world-space pose for a hand.
const XrInputHandler * inputHandler_
Definition XrRig.h:62
void resolveTrackedPoses()
Updates cached world-space hand poses from the latest raw XR input poses.
XrRig(const XrInputHandler &inputHandler, const Engine::Rendering::Headset *headset)
Creates an XR rig that reads raw poses from the input handler and headset.
TrackedHandPose handPoses_[2]
Definition XrRig.h:64
const Engine::Rendering::Headset * headset_
Definition XrRig.h:63
Hand
Index of a tracked hand in hand-indexed input arrays.
World-space pose for one tracked XR hand.
Definition XrRig.h:21
bool isValid
True when the pose was resolved from valid tracking data.
Definition XrRig.h:25
glm::quat orientation
World-space hand orientation.
Definition XrRig.h:35
glm::vec3 position
World-space hand position.
Definition XrRig.h:30