Nameless Engine
Loading...
Searching...
No Matches
CameraNode.h
1#pragma once
2
3// Custom.
4#include "game/nodes/SpatialNode.h"
5#include "game/camera/CameraProperties.h"
6
7#include "CameraNode.generated.h"
8
9namespace ne RNAMESPACE() {
11 class RCLASS(Guid("d0fdb87f-099e-479a-8975-d9db1c40488e")) CameraNode : public SpatialNode {
12 // Tells whether this node is being active camera or not.
13 friend class CameraManager;
14
15 public:
16 CameraNode();
17
23 CameraNode(const std::string& sNodeName);
24
25 virtual ~CameraNode() override = default;
26
35 void makeActive();
36
42 void setCameraMode(CameraMode mode);
43
54 void setOrbitalTargetLocation(const glm::vec3& targetPointLocation);
55
63 void clearOrbitalTargetLocation();
64
75 void setOrbitalRotation(float phi, float theta);
76
86 void setOrbitalDistanceToTarget(float distanceToTarget);
87
97 glm::vec3 getOrbitalTargetLocation();
98
106 CameraProperties* getCameraProperties();
107
108 protected:
115 virtual void onWorldLocationRotationScaleChanged() override;
116
126 virtual void onDespawning() override;
127
128 private:
130 void updateCameraProperties();
131
134
136 std::optional<glm::vec3> orbitalCameraTargetInWorldSpace = {};
137
139 glm::vec3 localSpaceOriginInWorldSpace = glm::vec3(0.0F, 0.0F, 0.0F);
140
146 std::pair<std::recursive_mutex, bool> mtxIsActive;
147
149 static inline constexpr float rotationDelta = 0.0001F;
150
151 ne_CameraNode_GENERATED
152 };
153} // namespace ne RNAMESPACE()
154
155File_CameraNode_GENERATED
Definition: CameraManager.h:16
Definition: CameraNode.h:11
std::pair< std::recursive_mutex, bool > mtxIsActive
Definition: CameraNode.h:146
CameraProperties cameraProperties
Definition: CameraNode.h:133
Definition: CameraProperties.h:22
Definition: GuidProperty.h:30
Definition: SpatialNode.h:12