struct

CameraControllerComponent

Built-in camera controllers as a single component. Mode-irrelevant fields are simply ignored by the system for the current mode — keeps the inspector surface uniform without forcing five separate component types for what's really a switch-on-enum.

Module
Camera
Header
#include "Camera/Components/CameraControllerComponent.h"
Namespace
Mowo
Reflection
Reflected by MowoHeaderTool

CameraControllerSystem reads the active InputManager (wired in by EditorLayer / RuntimeLayer) and writes back to TransformComponent each frame. The CameraComponent on the same entity is untouched.

Properties

TypeNameDescription
boolenabledDefault true.
CameraControllerModemodeDefault CameraControllerMode::Free.
EntityIDfollowTargetTarget entity for FirstPerson / ThirdPersonOrbit / TopDown / Follow modes. INVALID_ENTITY (0) means "no target" — the system falls back to Free behaviour for the modes that need a target so gameplay code can wire the reference asynchronously. Default INVALID_ENTITY.
Vec3eyeOffsetFirstPerson: camera world position = followTarget.position + eyeOffset. Default Vec3(0.0f, 1.7f, 0.0f).
floatdistanceThirdPersonOrbit / TopDown: distance from target. In ThirdPersonOrbit this is the spring-arm's full (unobstructed) length. Default 5.0f.
boolcollisionEnabledSpring-arm collision (ThirdPersonOrbit). When enabled the arm sweeps from the pivot toward the desired camera position and pulls the camera in to the first blocker, so it never clips through walls or the floor. The sweep itself is injected by the Game tier (CameraControllerSystem::SetCollisionSweep) because the Camera module sits below Physics and can't query it directly. Default true.
floatprobeRadiusSphere-probe radius for the arm sweep (world units) — the camera is kept this far off any blocking surface so the near plane can't poke through it. Default 0.2f.
uint32_tcollisionLayerMaskLayers the arm collides with, as a bitmask over physics object layers (bit N = layer N). Default clears the Player layer (bit 2) so the arm never catches on the character it is framing. Default 0xFFFFFFFBu.
floatcollisionSmoothingArm retract/extend damping. The arm snaps IN instantly (never lets the camera clip) but eases back OUT at rate 1 - exp(-s * dt) once the blocker clears, so the camera doesn't pop back to full length. Default 12.0f.
floatminPitchOrbit pitch clamp (radians). Engine convention: positive pitch tips the camera up. Default range avoids the gimbal poles. Default -1.4f.
floatmaxPitchDefault 1.4f.
floattopDownPitchTopDown: fixed pitch (looking down — negative tilts toward the ground in our coordinate system). Default -1.2f.
floatfollowSmoothingFollow smoothing — higher = snappier. Position is lerp'd with factor 1 - exp(-smoothing * dt) for framerate-independence. Default 5.0f.
floatmoveSpeedDefault 5.0f.
floatmouseSensitivityDefault 0.002f.
boolinvertYDefault false.
boolrequireMouseButtonUE-style: require right mouse button to be held before mouse delta rotates the camera. Useful for editor/game hybrids. Default false.
floatlookSmoothingLook smoothing — when > 0, current yaw/pitch lerp toward targetYaw/targetPitch with rate 1 - exp(-lookSmoothing * dt). 0 disables (snap), 20-30 gives a cinematic feel, 50+ is barely noticeable. Affects mouse and gamepad input uniformly. Default 0.0f.
floatgamepadLookSensitivityGamepad right-stick sensitivity — radians per second at full deflection (stick=1.0). Mouse sensitivity is per-pixel and tiny (0.002), gamepad needs much larger numbers because the stick is held, not flicked. Default 2.5f.
floatgamepadDeadzoneGamepad analog dead zone (0-1 stick magnitude). Below this the stick is treated as centered — drift / resting-position twitch doesn't rotate the camera. Default 0.15f.
floatyawRuntime — accumulated yaw/pitch the system writes back into TransformComponent.rotation each frame. Round-tripped through saves so a Free camera resumes facing the same direction. Default 0.0f.
floatpitchDefault 0.0f.
floattargetYawTarget yaw/pitch — input delta updates these every frame; the visible yaw/pitch lerps toward them. Hidden + runtime-only so they don't get saved (we resynchronise from yaw/pitch on load). Default 0.0f.
floattargetPitchDefault 0.0f.
booltargetsInitfalse until first frame seeds targets from yaw/pitch Default false.
floatcurrentArmDistanceRuntime — the smoothed spring-arm length actually used this frame. Eased toward the swept target so wall hits don't snap the camera; armInit stays false until the first orbit tick seeds it. Default 0.0f.
boolarmInitDefault false.
Generated from Camera/Components/CameraControllerComponent.h via camera.json · Oct 26, 2026Version 1.0.0