Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
CinemachineComponent.hpp
Go to the documentation of this file.
1#pragma once
2#include "ecs/Entity.hpp"
3#include <glm/glm.hpp>
4#include <string>
5#include "core/EngineAPI.hpp"
6
19
25// [ReflectClass]
31
33 // [ReflectField]
34 std::string followTargetName;
36 // [ReflectField]
37 std::string lookAtTargetName;
39 // [ReflectField]
40 std::string lockToBone = "Head";
41
45 // [ReflectField]
46 bool mouseOrbit = true;
48 // [ReflectField]
49 bool mouseLook = true;
51 // [ReflectField]
52 float orbitSensitivity = 0.1f;
54 // [ReflectField]
55 float orbitYaw = 0.0f;
57 // [ReflectField]
58 float orbitPitch = 0.0f;
60 // [ReflectField]
61 float cameraYaw = 0.0f;
63 // [ReflectField]
64 float cameraPitch = 0.0f;
65
67 // [ReflectField]
68 glm::vec3 followOffset = glm::vec3(0.0f, 4.0f, 8.0f);
70 // [ReflectField]
71 float followDamping = 2.0f;
73 // [ReflectField]
74 float lookAtDamping = 1.0f;
75
77 // [ReflectField]
78 float fov = 45.0f;
80 // [ReflectField]
81 int priority = 10;
83 // [ReflectField]
84 bool active = true;
85
86
88 glm::vec3 currentPosition = glm::vec3(0.0f);
90 glm::vec3 currentRotationEuler = glm::vec3(0.0f);
92 bool initialized = false;
93};
94
95
96
CinemachineMode
Operating camera mode for Cinemachine virtual camera tracking.
Definition CinemachineComponent.hpp:11
@ FirstPerson
Attached first-person perspective locked to target or bone.
Definition CinemachineComponent.hpp:15
@ FixedLookAt
Stationary or offset camera looking continuously at a target.
Definition CinemachineComponent.hpp:17
@ ThirdPersonFollow
Orbiting third-person follow view behind target.
Definition CinemachineComponent.hpp:13
Lightweight identifier representing a game object in the Entity Component System.
Definition Entity.hpp:11
Addon component that represents a virtual camera. Managed by CinemachineSystem to calculate tracking ...
Definition CinemachineComponent.hpp:26
float followDamping
Damping rate for smooth position tracking (higher = slower, 0.0f = instant).
Definition CinemachineComponent.hpp:71
Entity lookAtTarget
Target entity handle to look at.
Definition CinemachineComponent.hpp:30
std::string lockToBone
Skeletal bone name to lock camera to in FirstPerson mode.
Definition CinemachineComponent.hpp:40
bool mouseLook
Enable free mouse look orientation.
Definition CinemachineComponent.hpp:49
float orbitYaw
Current orbit yaw angle in degrees.
Definition CinemachineComponent.hpp:55
glm::vec3 currentRotationEuler
Cached Euler rotation angles for smooth frame interpolation.
Definition CinemachineComponent.hpp:90
float fov
Field of view in degrees.
Definition CinemachineComponent.hpp:78
std::string followTargetName
Name of follow target entity for serialization lookup.
Definition CinemachineComponent.hpp:34
float orbitSensitivity
Sensitivity multiplier for mouse orbit input.
Definition CinemachineComponent.hpp:52
float lookAtDamping
Damping rate for smooth rotation tracking.
Definition CinemachineComponent.hpp:74
Entity followTarget
Target entity handle to follow.
Definition CinemachineComponent.hpp:28
std::string lookAtTargetName
Name of look-at target entity for serialization lookup.
Definition CinemachineComponent.hpp:37
glm::vec3 followOffset
3D position offset relative to target.
Definition CinemachineComponent.hpp:68
glm::vec3 currentPosition
Cached world-space position for smooth frame interpolation.
Definition CinemachineComponent.hpp:88
bool initialized
Flag indicating whether camera initial transform was initialized.
Definition CinemachineComponent.hpp:92
float cameraYaw
Current camera yaw angle in degrees.
Definition CinemachineComponent.hpp:61
bool mouseOrbit
Enable mouse orbit control around follow target.
Definition CinemachineComponent.hpp:46
float orbitPitch
Current orbit pitch angle in degrees.
Definition CinemachineComponent.hpp:58
float cameraPitch
Current camera pitch angle in degrees.
Definition CinemachineComponent.hpp:64
CinemachineMode mode
Active camera tracking mode.
Definition CinemachineComponent.hpp:43
int priority
Priority rank used to pick active virtual camera (higher priority wins).
Definition CinemachineComponent.hpp:81
bool active
Master active flag for this virtual camera.
Definition CinemachineComponent.hpp:84