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
10
namespace
Engine::Rendering
11
{
12
class
Headset
;
13
}
14
15
namespace
Input
16
{
20
struct
TrackedHandPose
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
54
void
resolveTrackedPoses
();
55
59
[[nodiscard]]
TrackedHandPose
getHandPose
(
Hand
hand )
const
;
60
61
private
:
62
const
XrInputHandler
*
inputHandler_
=
nullptr
;
63
const
Engine::Rendering::Headset
*
headset_
=
nullptr
;
64
TrackedHandPose
handPoses_
[2];
65
};
66
}
// namespace Input
Engine::Rendering::Headset
Owns the OpenXR session, XR swapchain, eye transforms, and per-frame XR submission state.
Definition
Headset.h:55
Input::XrInputHandler
Creates OpenXR controller actions from the profile registry and samples the input state.
Definition
XrInputHandler.h:77
Input::XrRig::getHandPose
TrackedHandPose getHandPose(Hand hand) const
Returns the last resolved world-space pose for a hand.
Input::XrRig::inputHandler_
const XrInputHandler * inputHandler_
Definition
XrRig.h:62
Input::XrRig::resolveTrackedPoses
void resolveTrackedPoses()
Updates cached world-space hand poses from the latest raw XR input poses.
Input::XrRig::XrRig
XrRig(const XrInputHandler &inputHandler, const Engine::Rendering::Headset *headset)
Creates an XR rig that reads raw poses from the input handler and headset.
Input::XrRig::handPoses_
TrackedHandPose handPoses_[2]
Definition
XrRig.h:64
Input::XrRig::headset_
const Engine::Rendering::Headset * headset_
Definition
XrRig.h:63
Engine::Rendering
Definition
VrCameraComponent.h:6
Input
Definition
VrGliderComponent.h:15
Input::Hand
Hand
Index of a tracked hand in hand-indexed input arrays.
Definition
XrInputHandler.h:39
Input::TrackedHandPose
World-space pose for one tracked XR hand.
Definition
XrRig.h:21
Input::TrackedHandPose::isValid
bool isValid
True when the pose was resolved from valid tracking data.
Definition
XrRig.h:25
Input::TrackedHandPose::orientation
glm::quat orientation
World-space hand orientation.
Definition
XrRig.h:35
Input::TrackedHandPose::position
glm::vec3 position
World-space hand position.
Definition
XrRig.h:30
workspace
magerbeton
gl3-vulkan
code
Engine
include
Engine
Input
XrRig.h
Generated by
1.14.0