reckfellENGINE

XRServer

Server for AR and VR features.

On this page
class XRServerReckfellSharp

Server for AR and VR features.

The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Properties5

CameraLockedToOriginProperty
# CameraLockedToOrigin
C#
public static bool CameraLockedToOrigin { get; set; }

If set to true, the scene will be rendered as if the camera is locked to the XROrigin3D. Note: This doesn't provide a very comfortable experience for users. This setting exists for doing benchmarking or automated testing, where you want to control what is rendered via code.

PrimaryInterfaceProperty
# PrimaryInterface
C#
public static XRInterface PrimaryInterface { get; set; }

The primary XRInterface currently bound to the XRServer.

SingletonProperty
# Singleton
C#
public static XRServerInstance Singleton { get; }
WorldOriginProperty
# WorldOrigin
C#
public static Transform3D WorldOrigin { get; set; }

XRServer gameplay origin. The active XROrigin3D publishes its world transform here; direct assignments can be overwritten by it. The setter emits WorldOriginChanged even on repetition. Move the rig origin/body rather than maintaining two independent owners. A pose GetAdjustedTransform excludes this value.

WorldScaleProperty
# WorldScale
C#
public static double WorldScale { get; set; }

Shared tracking-to-game scale, initially 1. The setter clamps finite values to 0.01…1000 and forwards state to rendering. Validate finiteness before calling: range comparisons do not reject NaN. Changes pose adjustment, not Entity local Scale or stored velocities.

Methods26

AddInterfacevoid
# AddInterface
C#
public static void AddInterface(XRInterface @interface);

Registers an XRInterface object.

Parameters
NameTypeDefault
interfaceXRInterface—
AddTracker2 overloads
# AddTracker · 1/2
C#
public static void AddTracker(XRPositionalTracker tracker);

Registers a non-null object under its current name. Repeating the same reference emits nothing; a different object with the same name replaces the entry and emits TrackerUpdated. A new name emits TrackerAdded. Discovers no device and validates no hardware capabilities. Keep the name stable until removal.

Parameters
NameTypeDefault
trackerXRPositionalTracker—
tracker

Non-null object with a configured stable name. Removal uses its name, not reference identity.

# AddTracker · 2/2
C#
public static void AddTracker(XRTracker tracker);

Registers a non-null object under its current name. Repeating the same reference emits nothing; a different object with the same name replaces the entry and emits TrackerUpdated. A new name emits TrackerAdded. Discovers no device and validates no hardware capabilities. Keep the name stable until removal.

Parameters
NameTypeDefault
trackerXRTracker—
tracker

Non-null object with a configured stable name. Removal uses its name, not reference identity.

CenterOnHmdvoid
# CenterOnHmd
C#
public static void CenterOnHmd(XRServer.RotationMode rotationMode, bool keepHeight);

This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism.

Parameters
NameTypeDefault
rotationModeXRServer.RotationMode—
keepHeightbool—
ClearReferenceFramevoid
# ClearReferenceFrame
C#
public static void ClearReferenceFrame();

Resets the reference-frame adjustment to Identity, forwards it to rendering and emits ReferenceFrameChanged. Changes no gameplay origin, scale setting or raw poses. Source-reviewed; real recenter was not tested.

FindInterfaceXRInterface
# FindInterface
C#
public static XRInterface FindInterface(string name);

Finds an interface by its name. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it.

Parameters
NameTypeDefault
namestring—
Returns XRInterface
GetCameraOffsetsReckfell.Collections.Array<Transform3D>
# GetCameraOffsets
C#
public static Reckfell.Collections.Array<Transform3D> GetCameraOffsets(StringName trackerName);

Gets an array of offset transforms for each view for tracker tracker_name. tracker_name must refer to an XRPositionalTracker used as a camera. Will check our primary interface first, then check each active interface. Returns empty if no interfaces manage this tracker.

Parameters
NameTypeDefault
trackerNameStringName—
Returns Reckfell.Collections.Array<Transform3D>
GetCameraProjectionsReckfell.Collections.Array<Projection>
# GetCameraProjections
C#
public static Reckfell.Collections.Array<Projection> GetCameraProjections(StringName trackerName, double aspect, double near, double far);

Gets an array of projection matrices for each view for tracker tracker_name. tracker_name must refer to an XRPositionalTracker used as a camera. Will check our primary interface first, then check each active interface. Returns empty if no interfaces manage this tracker.

Parameters
NameTypeDefault
trackerNameStringName—
aspectdouble—
neardouble—
fardouble—
Returns Reckfell.Collections.Array<Projection>
GetHmdTransformTransform3D
# GetHmdTransform
C#
public static Transform3D GetHmdTransform();

Returns the primary interface's transformation.

Returns Transform3D
GetInterfaceXRInterface
# GetInterface
C#
public static XRInterface GetInterface(int idx);

Returns the interface registered at the given idx index in the list of interfaces.

Parameters
NameTypeDefault
idxint—
Returns XRInterface
GetInterfaceCountint
# GetInterfaceCount
C#
public static int GetInterfaceCount();

Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns true.

Returns int
GetInterfacesReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetInterfaces
C#
public static Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetInterfaces();

Returns a list of available interfaces the ID and name of each interface.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetPrimaryInterfaceXRInterface
# GetPrimaryInterface
C#
public static XRInterface GetPrimaryInterface();
Returns XRInterface
GetReferenceFrameTransform3D
# GetReferenceFrame
C#
public static Transform3D GetReferenceFrame();

Copy of the tracking-space adjustment. GetAdjustedTransform left-multiplies by it after position scaling. Not gameplay WorldOrigin. Only Identity was tested here; recenter needs separate device verification.

Returns Transform3D

Tracking-space adjustment, not gameplay origin.

GetTrackerXRTracker
# GetTracker
C#
public static XRTracker GetTracker(StringName trackerName);

Returns a registered XRTracker by exact name, or null. Includes nonpositional trackers omitted by current GetTrackers. The object is shared: do not dispose its borrowed C# wrapper or edit provider-owned data.

Parameters
NameTypeDefault
trackerNameStringName—
trackerName

Exact XRServer entry name, not ResourceName or a numeric ID.

Returns XRTracker

Shared registered XRTracker or null; do not dispose the borrowed object.

GetTrackersReckfell.Collections.Dictionary
# GetTrackers
C#
public static Reckfell.Collections.Dictionary GetTrackers(int trackerTypes);

Returns a separate Dictionary: names as keys, shared tracker objects as values. Clearing the container unregisters nothing. The mask is bit-tested against Type. Confirmed defect: implementation first casts objects to XRPositionalTracker, so even Any omits nonpositional XRFaceTracker. Use GetTracker for a known name; do not treat this list as complete.

Parameters
NameTypeDefault
trackerTypesint—
trackerTypes

Bitwise int mask of XRServer.TrackerType. Even Any currently omits nonpositional trackers.

Returns Reckfell.Collections.Dictionary

Separate Dictionary of shared positional trackers; current enumeration is incomplete for Any.

GetWorldOriginTransform3D
# GetWorldOrigin
C#
public static Transform3D GetWorldOrigin();

Copy of the current server gameplay origin, not raw head pose. The render thread reads render-frame state.

Returns Transform3D

Copy of gameplay origin maintained by the active XROrigin3D.

GetWorldScaledouble
# GetWorldScale
C#
public static double GetWorldScale();

Returns the shared scale as double. The render thread reads its stored render state; the main thread reads current server state. Thread synchronization was not checked here.

Returns double

Shared XRServer scale; not Entity Scale.

IsCameraLockedToOriginbool
# IsCameraLockedToOrigin
C#
public static bool IsCameraLockedToOrigin();
Returns bool
RemoveInterfacevoid
# RemoveInterface
C#
public static void RemoveInterface(XRInterface @interface);

Removes this interface.

Parameters
NameTypeDefault
interfaceXRInterface—
RemoveTracker2 overloads
# RemoveTracker · 1/2
C#
public static void RemoveTracker(XRPositionalTracker tracker);

Removes the entry by the supplied object’s current name, not reference identity. After replacement, an old reference with the same name can remove the new tracker. TrackerRemoved fires before erasure; GetTracker can still return the entry inside the handler. Destroys no external references and synthesizes no button releases.

Parameters
NameTypeDefault
trackerXRPositionalTracker—
tracker

Non-null object with a configured stable name. Removal uses its name, not reference identity.

# RemoveTracker · 2/2
C#
public static void RemoveTracker(XRTracker tracker);

Removes the entry by the supplied object’s current name, not reference identity. After replacement, an old reference with the same name can remove the new tracker. TrackerRemoved fires before erasure; GetTracker can still return the entry inside the handler. Destroys no external references and synthesizes no button releases.

Parameters
NameTypeDefault
trackerXRTracker—
tracker

Non-null object with a configured stable name. Removal uses its name, not reference identity.

SetCameraLockedToOriginvoid
# SetCameraLockedToOrigin
C#
public static void SetCameraLockedToOrigin(bool enabled);
Parameters
NameTypeDefault
enabledbool—
SetPrimaryInterfacevoid
# SetPrimaryInterface
C#
public static void SetPrimaryInterface(XRInterface @interface);
Parameters
NameTypeDefault
interfaceXRInterface—
SetWorldOriginvoid
# SetWorldOrigin
C#
public static void SetWorldOrigin(Transform3D worldOrigin);

XRServer gameplay origin. The active XROrigin3D publishes its world transform here; direct assignments can be overwritten by it. The setter emits WorldOriginChanged even on repetition. Move the rig origin/body rather than maintaining two independent owners. A pose GetAdjustedTransform excludes this value.

Parameters
NameTypeDefault
worldOriginTransform3D—
worldOrigin

Gameplay origin transform; an active XROrigin3D can overwrite it.

SetWorldScalevoid
# SetWorldScale
C#
public static void SetWorldScale(double scale);

Shared tracking-to-game scale, initially 1. The setter clamps finite values to 0.01…1000 and forwards state to rendering. Validate finiteness before calling: range comparisons do not reject NaN. Changes pose adjustment, not Entity local Scale or stored velocities.

Parameters
NameTypeDefault
scaledouble—
scale

Positive finite double scale; pass neither NaN nor infinity.

Signals and events7

InterfaceAddedEvent
# InterfaceAdded
C#
public static event XRServer.InterfaceAddedEventHandler InterfaceAdded;

Emitted when a new interface has been added.

Handler parameters
NameTypeDefault
interfaceNameStringName—
InterfaceRemovedEvent
# InterfaceRemoved
C#
public static event XRServer.InterfaceRemovedEventHandler InterfaceRemoved;

Emitted when an interface is removed.

Handler parameters
NameTypeDefault
interfaceNameStringName—
ReferenceFrameChangedEvent
# ReferenceFrameChanged
C#
public static event Action ReferenceFrameChanged;

Emitted when the reference frame transform changes.

TrackerAddedEvent
# TrackerAdded
C#
public static event XRServer.TrackerAddedEventHandler TrackerAdded;

A new-entry event emitted after insertion. Carries the name and numeric long category, not the object. Provider registration, not proof of a current pose or hardware connection.

Handler parameters
NameTypeDefault
trackerNameStringName—
typelong—
trackerName

Exact XRServer entry name, not ResourceName or a numeric ID.

type

Numeric long category from XRServer.TrackerType, not a tracker object.

TrackerRemovedEvent
# TrackerRemoved
C#
public static event XRServer.TrackerRemovedEventHandler TrackerRemoved;

Emitted before registry erasure. Lookup by name may still return the object in the handler; this does not mean removal was cancelled. After RemoveTracker returns the entry is absent.

Handler parameters
NameTypeDefault
trackerNameStringName—
typelong—
trackerName

Exact XRServer entry name, not ResourceName or a numeric ID.

type

Numeric long category from XRServer.TrackerType, not a tracker object.

TrackerUpdatedEvent
# TrackerUpdated
C#
public static event XRServer.TrackerUpdatedEventHandler TrackerUpdated;

Emitted when another object replaces the entry under the same name. Repeating AddTracker with the same reference does not emit it. Not a per-tracking-frame event; pose updates are separate.

Handler parameters
NameTypeDefault
trackerNameStringName—
typelong—
trackerName

Exact XRServer entry name, not ResourceName or a numeric ID.

type

Numeric long category from XRServer.TrackerType, not a tracker object.

WorldOriginChangedEvent
# WorldOriginChanged
C#
public static event Action WorldOriginChanged;

Emitted when the world origin transform changes.

XRServer.RotationMode

ValueDescription
DontResetRotation = 2

Does not reset the orientation of the HMD, only the position of the player gets centered.

ResetButKeepTilt = 1

Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset.

ResetFullRotation = 0

Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world.

XRServer.TrackerType

ValueDescription
Anchor = 8

The tracker tracks the location and size of an AR anchor.

Any = 255

Used internally to select all trackers.

AnyKnown = 127

Used internally to filter trackers of any known type.

Basestation = 4

The tracker tracks the location of a base station.

Body = 32

The tracker tracks the location and joints of a body.

Camera = 1

The tracker tracks the position of an XR camera (HMD, external camera, phone camera for phone based AR).

Controller = 2

The tracker tracks the location of a controller.

Face = 64

The tracker tracks the expressions of a face.

Hand = 16

The tracker tracks the location and joints of a hand.

Head = 1

The tracker tracks the location of the player's head. This is usually a location centered between the player's eyes. Note that for handheld AR devices this can be the current location of the device.

Unknown = 128

Used internally if we haven't set the tracker type yet.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.