class

CameraSystem

Module
Camera
Header
#include "Camera/CameraSystem.h"
Namespace
Mowo

Public functions

ReturnsNameDescription
CameraSystem&Get
voidRegisterCamera
EntityGetMainCameraGet main camera (first camera with isMain=true, or first available)
voidSetMainCamera
voidReelectMainCameraRe-evaluate isMain flags over the registered list (cheap — does not scan the world).
voidSetCinematicOverride
voidClearCinematicOverride
boolHasCinematicOverride
voidSetViewTargetView-target handover with a timed blend (the PlayerCameraManager essential): the current evaluated view is captured as the FROM pose and eased (smoothstep) into the new target's LIVE pose over blendTimeSeconds.
boolIsViewBlending
voidPushViewTargetView-target STACK on top of SetViewTarget — the cutscene/kill-cam shape: Push hands authority to target remembering who had it, Pop blends back to the remembered holder (or the elected main camera when the stack empties / the remembered entity died with its world).
voidPopViewTarget
size_tGetViewTargetStackDepth
voidAddModifierCamera modifiers — view mutators applied AFTER the blend on every main-view evaluation.
voidClearModifiers
size_tGetModifierCount
const std::vector<Entity>&GetAllCameras
voidUpdateAspectRatiosUpdate camera aspect ratios (call when window resizes)
boolGetMainCameraMatrices
boolGetMainSceneRendererCamera
boolBuildSceneRendererCameraBuild a SceneRendererCamera for an arbitrary camera entity.
std::vector<Entity>GetCamerasSortedByRenderOrderList of camera entities sorted by CameraComponent::renderOrder (ascending — earlier renderOrder is drawn first, later ones can overdraw for PiP).
EntityGetCameraAtViewportPositionFind best camera for viewport position (for multi-camera setups)
voidClearClear all registrations (e.g., on scene load)
voidClearWorldDrop every registration that belongs to world.

Function details

Get

C++
static CameraSystem& Get()

RegisterCamera

C++
void RegisterCamera(Entity entity)

GetMainCamera

C++
Entity GetMainCamera() const

Get main camera (first camera with isMain=true, or first available)

SetMainCamera

C++
void SetMainCamera(Entity entity)

ReelectMainCamera

C++
void ReelectMainCamera()

Re-evaluate isMain flags over the registered list (cheap — does not scan the world). Lets callers cache the registration pass while still honoring runtime isMain flips.

SetCinematicOverride

C++
void SetCinematicOverride(Entity entity)

ClearCinematicOverride

C++
void ClearCinematicOverride()

HasCinematicOverride

C++
bool HasCinematicOverride() const

SetViewTarget

C++
void SetViewTarget(Entity target, float blendTimeSeconds = 0.0f)

View-target handover with a timed blend (the PlayerCameraManager essential): the current evaluated view is captured as the FROM pose and eased (smoothstep) into the new target's LIVE pose over blendTimeSeconds. blendTime <= 0 cuts instantly. An invalid target hands authority back to the elected main camera (with the same blend). Retargeting mid-blend re-captures the blended pose, so chained cuts stay continuous. Time source is the real-time clock — a paused game can still blend its cameras.

IsViewBlending

C++
bool IsViewBlending() const

PushViewTarget

C++
void PushViewTarget(Entity target, float blendTimeSeconds = 0.0f)

View-target STACK on top of SetViewTarget — the cutscene/kill-cam shape: Push hands authority to target remembering who had it, Pop blends back to the remembered holder (or the elected main camera when the stack empties / the remembered entity died with its world). The stack stores TARGETS, not poses — a popped camera re-evaluates live, so it may have moved while covered.

PopViewTarget

C++
void PopViewTarget(float blendTimeSeconds = 0.0f)

GetViewTargetStackDepth

C++
size_t GetViewTargetStackDepth() const

AddModifier

C++
void AddModifier(std::shared_ptr<ICameraModifier> modifier)

Camera modifiers — view mutators applied AFTER the blend on every main-view evaluation. A modifier returning false is removed, so one-shots (FCameraShake) clean themselves up.

ClearModifiers

C++
void ClearModifiers()

GetModifierCount

C++
size_t GetModifierCount() const

GetAllCameras

C++
const std::vector<Entity>& GetAllCameras() const

UpdateAspectRatios

C++
void UpdateAspectRatios(float screenWidth, float screenHeight)

Update camera aspect ratios (call when window resizes)

GetMainCameraMatrices

C++
bool GetMainCameraMatrices(Mat4& outView, Mat4& outProj, Vec3& outPos, Vec3& outForward, Vec3& outUp)

GetMainSceneRendererCamera

C++
bool GetMainSceneRendererCamera(SceneRendererCamera& out, float aspectRatio)

BuildSceneRendererCamera

C++
bool BuildSceneRendererCamera(Entity camEntity, float aspectRatio, SceneRendererCamera& out)

Build a SceneRendererCamera for an arbitrary camera entity. Used by multi-camera setups that iterate every registered camera and render each into its assigned viewport. Returns false if the entity is invalid or lacks Camera + Transform components.

GetCamerasSortedByRenderOrder

C++
std::vector<Entity> GetCamerasSortedByRenderOrder() const

List of camera entities sorted by CameraComponent::renderOrder (ascending — earlier renderOrder is drawn first, later ones can overdraw for PiP). Skips cameras whose component is disabled.

GetCameraAtViewportPosition

C++
Entity GetCameraAtViewportPosition(float x, float y) const

Find best camera for viewport position (for multi-camera setups)

Clear

C++
void Clear()

Clear all registrations (e.g., on scene load)

ClearWorld

C++
void ClearWorld(World* world)

Drop every registration that belongs to world. A registered Entity holds a raw World*, so the registry MUST be purged before the world it points at is destroyed — a scene unload, map travel or editor shutdown otherwise leaves handles that read freed memory on the next lookup.

Generated from Camera/CameraSystem.h via camera.json · Oct 26, 2026Version 1.0.0