Docs / Camera

Glossary: FreeCameraController

The members of FreeCameraController, in alphabetical order.

Color legend plain property method

Flight with six degrees of freedom: moves along and turns about the camera’s own axes, from input you give it each frame.

FreeCameraController derives from BaseCameraController and has its members too. The controllers page shows it in context, with code.

Names are colored by what they are: a property or a method; values and fields keep the plain color.

Properties

AxisSnapConvergenceSec →

float · The seconds a SnapTo takes to cover 95 % of its turn, whatever the frame rate. 0.18 by default; 0 or less snaps almost at once.

LookSensitivity →

float · The turn of one unit of Look, in radians. 0.0025 by default: 100 units turn the view by 14°.

MoveSpeedUnitSec →

float · The speed of a full Move, in world units per second. 20 by default.

RollSpeedRadSec →

float · The speed of a full Roll, in radians per second. 2.5 by default.

Methods

FreeCameraController() →

FreeCameraController() · A free camera with the default speeds and sensitivity. Attached, it takes over the camera’s orientation, roll included.

Look() →

Look(float deltaYaw, float deltaPitch) · Turns about the camera’s own up and right by the deltas times LookSensitivity. Calls within a frame add up, and aren’t scaled by the time. Cancels a snap.

Parameter Type Description
deltaYaw float Positive looks right, the way the mouse’s x grows.
deltaPitch float Positive looks down, the way the mouse’s y grows.

Move() →

Move(Vector3 delta) · Moves in the camera’s own frame. Calls within a frame add up, and the sum is capped at unit length: it moves at MoveSpeedUnitSec times its length.

Parameter Type Description
delta Vector3 x right, y up and −z forward: Vector3.Forward moves ahead.

Roll() →

Roll(float direction) · Rolls about the camera’s forward at RollSpeedRadSec times the value. Calls within a frame add up. Cancels a snap.

Parameter Type Description
direction float Positive rolls clockwise, negative counterclockwise; 1 is full speed.

SnapTo() →

SnapTo(Vector3 forward) · Turns smoothly to face the direction, with the roll leveled against world +Y, covering 95 % of the turn in AxisSnapConvergenceSec. Look or Roll input cancels it; Move doesn’t.

Parameter Type Description
forward Vector3 The direction to face. One of length zero is ignored.

Update() →

Update(float elapsedSeconds) · Override. Applies the frame’s input to the camera and clears it. The camera calls it.

Parameter Type Description
elapsedSeconds float The seconds since the last update.