Vixen
02b45cc4
csharp
public struct ControlRotation

Which way a player is looking. Held by the controller, not by the body.

Read the guide page for this →

As a scene component

Size
16 bytes — 585 rows in a 16 KB chunk, alone on the archetype

Remarks

The single decision this whole subsystem is arranged around. Aim on the pawn dies with the pawn, so every game that puts it there writes code to carry it across a respawn, a vehicle entry and a spectator transition — three times, differently. Aim on the controller survives all three because the controller was never in the world's way. Unreal calls this ControlRotation and the name is kept.

No roll. A player looks with two angles; a camera that rolls is doing it as an effect, which is CameraLens.Dutch's job and is composed after everything here.

The clamps default to the same ±80° PovAim uses. A first-person camera whose limits disagreed with the aim it is fed would let the player aim at something it refuses to show them.

Fields and properties (5)

  • public float Yaw

    Where the player is turned to, in radians about the world's up axis.

  • public float Pitch

    How far up they are looking, in radians. Positive looks up.

  • public float MinimumPitch

    The furthest down they may look, in radians.

  • public float MaximumPitch

    The furthest up they may look, in radians.

  • public static ControlRotation Default

    Level, facing -Z, able to look 80° up and 80° down.

Methods (4)

  • public void Turn(float yaw, float pitch)

    Turns by two angles, wrapping the yaw and clamping the pitch.

  • public readonly Vector3 Forward()

    The direction being looked along, in world space.

  • public readonly Quaternion ToRotation()

    The full look rotation, pitch included.

  • public readonly Quaternion YawRotation()

    The yaw alone, which is what a character standing on the ground turns by.

Used by (18)

  • PlayerRigThirdPersonShooter
  • WeaponFireThirdPersonShooter
  • ActionPlayerInputVixen.Engine
  • ComponentRegistrationVixen.Engine
  • ConstantVixen.Engine.Tests
  • IPlayerInputSourceVixen.Engine
  • PlayerVixen.Engine
  • PlayerAllocationTestsVixen.Engine.Tests
  • PlayerCameraTestsVixen.Engine.Tests
  • PlayerInputSystemVixen.Engine
  • PlayerInputTestsVixen.Engine.Tests
  • PlayerSpawnerTestsVixen.Net.Engine.Tests
  • PossessionSystemVixen.Engine
  • PossessionTestsVixen.Engine.Tests
  • ScriptedVixen.Engine.Tests
  • TypeRegistrationVixen.Engine
  • Vixen_Engine_Players_ControlRotationSerializerVixen.Engine
  • MaterialIconsVixen.Editor.App