Vixen
02b45cc4
csharp
public readonly record struct XrFieldOfView

The four half-angles of an asymmetric view frustum, in radians.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Four angles, not a field of view and an aspect ratio. A headset's frustum is not symmetric — the lenses are canted, so each eye sees further towards its own side than towards the nose — and a projection built from a single vertical FOV is wrong by several degrees in a way that shows up as the two eyes disagreeing about where things are.

The signs are OpenXR's and they are worth stating: left and down are negative, so the width of the frustum is tan(right) − tan(left) rather than a sum.

Fields and properties (5)

  • public float AngleLeft

    To the left edge. Negative.

  • public float AngleRight

    To the right edge. Positive.

  • public float AngleUp

    To the top edge. Positive.

  • public float AngleDown

    To the bottom edge. Negative.

  • public bool IsValid

    Whether it describes a frustum with any volume in it.

Methods (2)

  • public XrFieldOfView(float AngleLeft, float AngleRight, float AngleUp, float AngleDown)

    The four half-angles of an asymmetric view frustum, in radians.

  • public static XrFieldOfView Symmetric(float horizontal, float vertical)

    A symmetric frustum, for a null backend and for tests.

Used by (6)

  • NullXrSessionVixen.Xr
  • OpenXrSessionVixen.Xr.OpenXR
  • XrCompositionViewVixen.Xr
  • XrProjectionVixen.Xr
  • XrProjectionTestsVixen.Xr.Tests
  • XrViewVixen.Xr