Vixen
02b45cc4
csharp
public sealed class XrTrackingSystem

Puts the headset and the controllers where the runtime says they are.

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

As a system

Phase
LateUpdate

Remarks

It reads what the host has already done and writes transforms. The frame loop — poll, begin, locate, sync — belongs to whatever owns the session, because it is the loop the runtime paces. By the time this runs, the views have been located for this frame's display time and the actions have been synced, so the system's whole job is to compose those poses with the rig and put the result on the entities.

The head pose is the midpoint of the eyes, not a third located space. Locating the view space separately would be a second prediction of the same thing, and the two would disagree by however much the runtime's two answers differ. A camera at the midpoint is also the right place for anything that is not being rendered in stereo — a shadow view, an audio listener, a culling frustum.

It writes LocalTransform, so a tracked entity should be a root. The same constraint NavigationSystem has, for the same reason: this composes the rig in itself, and a parented entity would have the result composed with its parent a second time.

Fields and properties (3)

  • public IXrSession Session

    The session being read.

  • public XrAction? HandPoseAction

    The pose action the left controller's transform comes from.

  • public SystemAccess Access

Methods (3)

  • public XrTrackingSystem(IXrSession session)

    Creates the system over a session.

  • public override JobHandle Update(in SystemContext context, JobHandle dependency)

    Runs the system.

  • public void Publish(World world)

    Writes this frame's poses onto a world's entities.

Used by (1)

  • XrTrackingSystemTestsVixen.Xr.Tests