Vixen
02b45cc4
csharp
public static class PlayerCameras

The camera rigs that need to know where a player is looking.

Read the guide page for this →

Remarks

Why these are in the engine when a tuned rig belongs in a sample. [29](../../../docs/plan/29-players-and-possession.md) is firm that the engine ships mechanism rather than a ruleset, and a camera preset would be a ruleset. These are not presets: a first-person camera and a third-person orbit are the two rigs that cannot be assembled from outside this assembly, because both are steered by ControlRotation and the write that carries it into PovAim and OrbitBody is PossessionSystem's. Everything a game would actually tune — the distance, the height, the damping, the lens — is an argument here and a component afterwards.

Both build on doc 26's stages and add nothing to them. A game that wants a different rig writes the same three component adds with different values, which is what the source of each of these is.

Methods (3)

  • public static PlayerCamera FirstPerson(World world, Entity controller, float eyeHeight = 1.65)

    A camera at the player's eyes, looking exactly where they are aiming.

  • public static PlayerCamera ThirdPerson(World world, Entity controller, float distance = 4, float shoulderHeight = 1.4, float damping = 0.3)

    A camera orbiting behind the player, at the angle they are aiming.

  • public static Entity CreateEye(World world, int channel = 0)

    The real camera and its director, on a player's own channel.

Used by (2)

  • PlayerRigThirdPersonShooter
  • PlayerCameraTestsVixen.Engine.Tests