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
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
CameraControllerMode | mode | Default CameraControllerMode::Free. |
EntityID | followTarget | Target 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. |
Vec3 | eyeOffset | FirstPerson: camera world position = followTarget.position + eyeOffset. Default Vec3(0.0f, 1.7f, 0.0f). |
float | distance | ThirdPersonOrbit / TopDown: distance from target. In ThirdPersonOrbit this is the spring-arm's full (unobstructed) length. Default 5.0f. |
bool | collisionEnabled | Spring-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. |
float | probeRadius | Sphere-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_t | collisionLayerMask | Layers 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. |
float | collisionSmoothing | Arm 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. |
float | minPitch | Orbit pitch clamp (radians). Engine convention: positive pitch tips the camera up. Default range avoids the gimbal poles. Default -1.4f. |
float | maxPitch | Default 1.4f. |
float | topDownPitch | TopDown: fixed pitch (looking down — negative tilts toward the ground in our coordinate system). Default -1.2f. |
float | followSmoothing | Follow smoothing — higher = snappier. Position is lerp'd with factor 1 - exp(-smoothing * dt) for framerate-independence. Default 5.0f. |
float | moveSpeed | Default 5.0f. |
float | mouseSensitivity | Default 0.002f. |
bool | invertY | Default false. |
bool | requireMouseButton | UE-style: require right mouse button to be held before mouse delta rotates the camera. Useful for editor/game hybrids. Default false. |
float | lookSmoothing | Look 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. |
float | gamepadLookSensitivity | Gamepad 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. |
float | gamepadDeadzone | Gamepad 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. |
float | yaw | Runtime — 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. |
float | pitch | Default 0.0f. |
float | targetYaw | Target 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. |
float | targetPitch | Default 0.0f. |
bool | targetsInit | false until first frame seeds targets from yaw/pitch Default false. |
float | currentArmDistance | Runtime — 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. |
bool | armInit | Default false. |
Generated from Camera/Components/CameraControllerComponent.h via camera.json · Oct 26, 2026Version 1.0.0