FpsCameraComponent

First-person camera movement. Like FreeFlyCameraComponent, but the forward axis is projected onto the XZ plane so the camera does not drift up/down when looking at the sky/ground. Vertical movement (input.Y) is taken in world space.

Properties

Speed

(float) { get; set } = 5f: Movement speed in world units per second.

LookSensitivity

(float) { get; set } = 0.005f: Mouse look sensitivity in radians per pixel.

CaptureInput

(bool) { get; set } = true: When true (the default), the component reads WASD / Space / Left-Shift for movement and right-drag for mouse look from the engine Input facade every update, so it drives the camera on its own in a running session. Set false to feed Move / Look from your own script instead.

Public Methods

OnUpdate

public override void OnUpdate(float deltaTime)

Parameters:

  • deltaTime (float)

Move

public void Move(Vector3 input, float deltaTime)

Translates the camera in the XZ ground plane. input: X = strafe (right), Y = world-up climb, Z = forward (projected on XZ).

Parameters:

  • input (Vector3)
  • deltaTime (float)

Look

public void Look(float dxPixels, float dyPixels)

Rotates the camera by mouse-pixel deltas (same convention as FreeFly).

Parameters:

  • dxPixels (float)
  • dyPixels (float)