Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
VrCameraComponent.h
1#pragma once
2
3#include "Engine/Component/CameraComponent.h"
4
6{
7 class Headset;
8} // namespace Engine::Rendering
9
10namespace Engine::Components {
22public:
23 static constexpr bool IsUnique = true;
24 static constexpr const char* ComponentName = "VrCamera";
25
33 std::shared_ptr<Entities::SceneNode> sceneNode,
34 Rendering::Headset* headset);
35
39 ~VrCamera() override = default;
40
41 void tick(double deltaTime) override;
42
43 [[nodiscard]] glm::mat4 getEyeViewMatrix(size_t eyeIndex) const override;
44 [[nodiscard]] glm::mat4 getEyeProjectionMatrix(size_t eyeIndex) const override;
45
50 [[nodiscard]] Rendering::Headset* getHeadset() const { return headset_; }
51
52private:
54};
55
56} // namespace EngineCore
A camera component that provides view and projection matrices based on its SceneNode transform....
static constexpr const char * ComponentName
Component registry name.
~VrCamera() override=default
Destroys the VR camera component.
glm::mat4 getEyeProjectionMatrix(size_t eyeIndex) const override
Gets the projection matrix for a specific eye. Base returns getProjectionMatrix() for both (mono).
Rendering::Headset * getHeadset() const
Gets the headset used by this VR camera.
void tick(double deltaTime) override
Called every frame if ticking is enabled.
glm::mat4 getEyeViewMatrix(size_t eyeIndex) const override
Gets the view matrix for a specific eye. Base returns getViewMatrix() for both (mono).
static constexpr bool IsUnique
This component type is unique per actor.
Rendering::Headset * headset_
VrCamera(Entities::Scene *owningScene, std::shared_ptr< Entities::SceneNode > sceneNode, Rendering::Headset *headset)
Constructs a VR camera backed by a headset and scene node.
Owns scene entities, actor lifetime, and the scene graph root.
Definition Scene.h:84
Owns the OpenXR session, XR swapchain, eye transforms, and per-frame XR submission state.
Definition Headset.h:55