XROrigin3D
Gameplay origin for a tracked XR rig.
XROrigin3D maps tracking space into the gameplay world. Parent the camera, controllers and anchors directly under it. For game movement move the origin or its parent body; do not correct tracking by moving the camera manually.
At runtime the first in-tree origin becomes Current automatically. Selecting another deactivates the previous one; disabling or exiting the active origin selects another available one. A detached object is not active. Current initializes no session and does not select the current Camera3D. The active origin publishes GlobalTransform to XRServer.WorldOrigin.
WorldScale is shared XRServer state: editing it through any origin affects the others. Finite values are clamped to 0.01…1000. Do not change the rig local Scale for this purpose. At WorldScale=1, the standard metric tracking model corresponds to one game unit per meter.
Origin selection, scale and world transforms were checked without a headset. Stereo output, cross-thread interpolation and real recenter were not tested. Complete movement example: XR locomotion.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
XROrigin3DConstructor
public XROrigin3D();Creates a rig origin. The first origin entering the runtime tree activates automatically. Parent the camera and tracked Entities directly under it; creating an origin does not initialize XR.
Properties2
CurrentProperty
public bool Current { get; set; }Selects the active in-tree origin. The first added origin activates automatically. Enabling deactivates others; disabling or exiting an active origin selects another available one. Outside the tree the runtime getter returns false even after setting true. Starts no XR session and selects no camera.
WorldScaleProperty
public float WorldScale { get; set; }Shared XRServer.WorldScale, not a per-origin scale. Editing through an inactive origin also affects the others. Finite values are clamped to 0.01…1000; supply a positive finite scale. Not Entity3D.Scale: keep the rig local scale at one.
Methods4
GetWorldScalefloat
public float GetWorldScale();Reads the shared XRServer scale as float. Another origin sees the same value; WorldScale is not local Scale.
floatShared XRServer scale; not Entity Scale.
IsCurrentbool
public bool IsCurrent();true when this origin is active and inside the runtime tree. Editor mode returns the stored setting; not a device-availability check.
booltrue only for the active origin inside the runtime tree.
SetCurrentvoid
public void SetCurrent(bool enabled);Selects the active in-tree origin. The first added origin activates automatically. Enabling deactivates others; disabling or exiting an active origin selects another available one. Outside the tree the runtime getter returns false even after setting true. Starts no XR session and selects no camera.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledMake this origin active; runtime status depends on being in the tree.
SetWorldScalevoid
public void SetWorldScale(float worldScale);Shared XRServer.WorldScale, not a per-origin scale. Editing through an inactive origin also affects the others. Finite values are clamped to 0.01…1000; supply a positive finite scale. Not Entity3D.Scale: keep the rig local scale at one.
| Name | Type | Default |
|---|---|---|
worldScale | float | — |
worldScalePositive finite shared scale; finite values are clamped to 0.01…1000.