CameraManager is a resource that manages the active camera entity.
More...
#include <CameraManager.hpp>
CameraManager is a resource that manages the active camera entity.
The camera entity must have both a Transform and a Camera component. This resource is initialized with late binding - the camera entity is set after plugin binding.
◆ CameraManager()
| CameraMovement::Resource::CameraManager::CameraManager |
( |
Engine::Core & | core | ) |
|
|
inlineexplicit |
◆ ~CameraManager()
| CameraMovement::Resource::CameraManager::~CameraManager |
( |
| ) |
|
|
default |
◆ GetActiveCamera()
| Engine::Entity CameraMovement::Resource::CameraManager::GetActiveCamera |
( |
| ) |
const |
|
inline |
Get the active camera entity.
- Returns
- The active camera entity.
- Exceptions
-
◆ GetBehavior()
Get the current camera behavior instance.
- Returns
- Shared pointer to the current ICameraBehavior, or nullptr if none is set.
◆ GetCore()
| Engine::Core & CameraMovement::Resource::CameraManager::GetCore |
( |
| ) |
|
|
inline |
Get the core reference.
- Returns
- The core reference.
◆ GetJoystickId()
| int CameraMovement::Resource::CameraManager::GetJoystickId |
( |
| ) |
const |
|
inline |
Get the joystick ID used for camera control.
- Returns
- The GLFW joystick ID.
◆ GetLastMouseX()
| double CameraMovement::Resource::CameraManager::GetLastMouseX |
( |
| ) |
const |
|
inline |
Get the last mouse X position.
- Returns
- The last mouse X position.
◆ GetLastMouseY()
| double CameraMovement::Resource::CameraManager::GetLastMouseY |
( |
| ) |
const |
|
inline |
Get the last mouse Y position.
- Returns
- The last mouse Y position.
◆ GetMouseSensitivity()
| float CameraMovement::Resource::CameraManager::GetMouseSensitivity |
( |
| ) |
const |
|
inline |
Get the mouse sensitivity of the camera.
- Returns
- The mouse sensitivity.
◆ GetMovementSpeed()
| float CameraMovement::Resource::CameraManager::GetMovementSpeed |
( |
| ) |
const |
|
inline |
Get the movement speed of the camera.
- Returns
- The movement speed.
◆ GetOriginRotation()
| const glm::quat & CameraMovement::Resource::CameraManager::GetOriginRotation |
( |
| ) |
const |
|
inline |
Get the origin rotation.
- Returns
- The origin rotation.
◆ HasValidCamera()
| bool CameraMovement::Resource::CameraManager::HasValidCamera |
( |
| ) |
const |
|
inline |
Check if the camera entity is set and valid.
- Returns
- True if the camera is set and valid, false otherwise.
◆ IsMouseDragging()
| bool CameraMovement::Resource::CameraManager::IsMouseDragging |
( |
| ) |
const |
|
inline |
Check if the mouse is being dragged.
- Returns
- True if dragging, false otherwise.
◆ SetActiveCamera()
| void CameraMovement::Resource::CameraManager::SetActiveCamera |
( |
Engine::Entity | entity | ) |
|
|
inline |
Set the active camera entity.
- Parameters
-
| entity | The entity to use as the camera. |
- Exceptions
-
◆ SetBehavior()
Set the camera behavior instance.
- Parameters
-
| behavior | Shared pointer to an implementation of ICameraBehavior. |
◆ SetJoystickId()
| void CameraMovement::Resource::CameraManager::SetJoystickId |
( |
int | joystickId | ) |
|
|
inline |
Set the joystick ID to use for camera control.
- Parameters
-
| joystickId | The GLFW joystick ID (e.g., GLFW_JOYSTICK_1). |
◆ SetLastMousePosition()
| void CameraMovement::Resource::CameraManager::SetLastMousePosition |
( |
double | x, |
|
|
double | y ) |
|
inline |
Set the last mouse position.
- Parameters
-
| x | The x position. |
| y | The y position. |
◆ SetMouseDragging()
| void CameraMovement::Resource::CameraManager::SetMouseDragging |
( |
bool | dragging | ) |
|
|
inline |
Set whether the mouse is being dragged.
- Parameters
-
| dragging | True if dragging, false otherwise. |
◆ SetMouseSensitivity()
| void CameraMovement::Resource::CameraManager::SetMouseSensitivity |
( |
float | sensitivity | ) |
|
|
inline |
Set the mouse sensitivity of the camera.
- Parameters
-
| sensitivity | The mouse sensitivity. |
◆ SetMovementSpeed()
| void CameraMovement::Resource::CameraManager::SetMovementSpeed |
( |
float | speed | ) |
|
|
inline |
Set the movement speed of the camera.
- Parameters
-
◆ SetOriginRotation()
| void CameraMovement::Resource::CameraManager::SetOriginRotation |
( |
const glm::quat & | rotation | ) |
|
|
inline |
Set the origin rotation (used for mouse dragging).
- Parameters
-
| rotation | The origin rotation. |
◆ SetWasCursorMasked()
| void CameraMovement::Resource::CameraManager::SetWasCursorMasked |
( |
bool | masked | ) |
|
|
inline |
Set whether the cursor was masked in the previous frame.
- Parameters
-
| masked | True if cursor was masked, false otherwise. |
◆ WasCursorMasked()
| bool CameraMovement::Resource::CameraManager::WasCursorMasked |
( |
| ) |
const |
|
inline |
Check if the cursor was masked in the previous frame.
- Returns
- True if cursor was masked, false otherwise.
◆ _behavior
◆ _cameraEntity
| std::optional<Engine::Entity> CameraMovement::Resource::CameraManager::_cameraEntity = std::nullopt |
|
private |
◆ _core
| Engine::Core& CameraMovement::Resource::CameraManager::_core |
|
private |
◆ _isMouseDragging
| bool CameraMovement::Resource::CameraManager::_isMouseDragging = false |
|
private |
◆ _joystickId
| int CameraMovement::Resource::CameraManager::_joystickId = GLFW_JOYSTICK_1 |
|
private |
◆ _lastMouseX
| double CameraMovement::Resource::CameraManager::_lastMouseX = 0.0 |
|
private |
◆ _lastMouseY
| double CameraMovement::Resource::CameraManager::_lastMouseY = 0.0 |
|
private |
◆ _mouseSensitivity
| float CameraMovement::Resource::CameraManager::_mouseSensitivity = 0.002f |
|
private |
◆ _movementSpeed
| float CameraMovement::Resource::CameraManager::_movementSpeed = 5.0f |
|
private |
◆ _originRotation
| glm::quat CameraMovement::Resource::CameraManager::_originRotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f) |
|
private |
◆ _wasCursorMasked
| bool CameraMovement::Resource::CameraManager::_wasCursorMasked = false |
|
private |
The documentation for this class was generated from the following file: