reckfellENGINE

OpenXRSpatialEntityTracker

OpenXR spatial-entity tracking data.

On this page
class OpenXRSpatialEntityTrackerReckfellSharpInherits XRPositionalTracker

Provider RefCounted data, not a game-tree Entity or ECS. Uses the XRServer Anchor category; XRAnchor3D under XROrigin3D binds by Name and default pose. Require both SpatialTrackingState=Tracking and pose HasTrackingData. Manually setting state creates no tracking.

Entity is a backend RID managed by the tracker; do not free it independently. SpatialContext cannot switch after its first assignment. Name/RID are not persistence UUIDs. Additional Next structures form a linked list; duplicate insertion can create cycles.

Executed example and setup. Windows headless XR-off covered synthetic metadata/client logic: 23 API cases and an earlier 20 helper checks. Real discovery, entity/context RIDs, persistence, headsets and imagery remain untested. Do not dispose provider-owned trackers/poses/cached wrappers; dispose a newly owned tracker after use.

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

Constructors1

OpenXRSpatialEntityTrackerConstructor
# OpenXRSpatialEntityTracker
C#
public OpenXRSpatialEntityTracker();

Creates a caller-owned RefCounted tracker without starting OpenXR, registering with XRServer or detecting anything. Base state is Paused, category Anchor, entity/context RIDs empty. Real applications normally use the borrowed provider-registered tracker rather than a synthetic resource. Release your own instance after removing owned references/registration.

Properties2

EntityProperty
# Entity
C#
public Rid Entity { get; set; }

Runtime spatial-entity RID, not a game-tree Entity or persistence UUID. Initially empty. Assignment gives the tracker responsibility for this RID: replacing/destroying the tracker frees its previous entity through the spatial extension. Do not free a built-in tracker RID yourself or assign arbitrary Rids; IsValid does not verify a live owner.

SpatialTrackingStateProperty
# SpatialTrackingState
C#
public OpenXRSpatialEntityTracker.EntityTrackingState SpatialTrackingState { get; set; }

Spatial tracking state, initially Paused: Tracking, Paused or Stopped. The setter updates metadata and emits SpatialTrackingStateChanged on change; it creates no pose, starts no discovery and validates no position. Also require GetPose("default").HasTrackingData before using a pose.

Methods9

AddNextvoid
# AddNext
C#
public void AddNext(OpenXRStructureBase next);

Prepends a structure, setting its Next to the previous head. Null is ignored; a successful addition emits NextChanged. Mutates the supplied structure links; use a distinct instance and never insert an already linked structure again, which can create a cycle. Requests no runtime capability.

Parameters
NameTypeDefault
nextOpenXRStructureBase—
next

Prepends a structure, setting its Next to the previous head. Null is ignored; a successful addition emits NextChanged. Mutates the supplied structure links; use a distinct instance and never insert an already linked structure again, which can create a cycle. Requests no runtime capability.

GetEntityRid
# GetEntity
C#
public Rid GetEntity();

Runtime spatial-entity RID, not a game-tree Entity or persistence UUID. Initially empty. Assignment gives the tracker responsibility for this RID: replacing/destroying the tracker frees its previous entity through the spatial extension. Do not free a built-in tracker RID yourself or assign arbitrary Rids; IsValid does not verify a live owner.

Returns Rid

Runtime spatial-entity RID, not a game-tree Entity or persistence UUID. Initially empty. Assignment gives the tracker responsibility for this RID: replacing/destroying the tracker frees its previous entity through the spatial extension. Do not free a built-in tracker RID yourself or assign arbitrary Rids; IsValid does not verify a live owner.

GetNextOpenXRStructureBase
# GetNext
C#
public OpenXRStructureBase GetNext();

Borrowed first OpenXRStructureBase in the additional-structure chain, or null. A linked extension-parameter list, not child Entities. Do not mutate/dispose provider-owned structures; detach newly owned structures before releasing them.

Returns OpenXRStructureBase

Borrowed first OpenXRStructureBase in the additional-structure chain, or null. A linked extension-parameter list, not child Entities. Do not mutate/dispose provider-owned structures; detach newly owned structures before releasing them.

GetSpatialContextRid
# GetSpatialContext
C#
public Rid GetSpatialContext();

Spatial-context RID, initially empty. After a valid RID is assigned, the setter rejects a different context, including empty; create a new tracker instead. Reading transfers no context ownership; do not free engine-owned default contexts. The setter does not establish OpenXR context readiness.

Returns Rid

Spatial-context RID, initially empty. After a valid RID is assigned, the setter rejects a different context, including empty; create a new tracker instead. Reading transfers no context ownership; do not free engine-owned default contexts. The setter does not establish OpenXR context readiness.

GetSpatialTrackingStateOpenXRSpatialEntityTracker.EntityTrackingState
# GetSpatialTrackingState
C#
public OpenXRSpatialEntityTracker.EntityTrackingState GetSpatialTrackingState();

Spatial tracking state, initially Paused: Tracking, Paused or Stopped. The setter updates metadata and emits SpatialTrackingStateChanged on change; it creates no pose, starts no discovery and validates no position. Also require GetPose("default").HasTrackingData before using a pose.

Returns OpenXRSpatialEntityTracker.EntityTrackingState

Spatial tracking state, initially Paused: Tracking, Paused or Stopped. The setter updates metadata and emits SpatialTrackingStateChanged on change; it creates no pose, starts no discovery and validates no position. Also require GetPose("default").HasTrackingData before using a pose.

RemoveNextvoid
# RemoveNext
C#
public void RemoveNext(OpenXRStructureBase next);

Unlinks the first matching reference, clears that structure Next and emits NextChanged. Null/absent entries do nothing. Destroys no resource and cancels no submitted asynchronous request; do not edit provider-owned chains.

Parameters
NameTypeDefault
nextOpenXRStructureBase—
next

Unlinks the first matching reference, clears that structure Next and emits NextChanged. Null/absent entries do nothing. Destroys no resource and cancels no submitted asynchronous request; do not edit provider-owned chains.

SetEntityvoid
# SetEntity
C#
public void SetEntity(Rid entity);

Runtime spatial-entity RID, not a game-tree Entity or persistence UUID. Initially empty. Assignment gives the tracker responsibility for this RID: replacing/destroying the tracker frees its previous entity through the spatial extension. Do not free a built-in tracker RID yourself or assign arbitrary Rids; IsValid does not verify a live owner.

Parameters
NameTypeDefault
entityRid—
entity

Runtime spatial-entity RID, not a game-tree Entity or persistence UUID. Initially empty. Assignment gives the tracker responsibility for this RID: replacing/destroying the tracker frees its previous entity through the spatial extension. Do not free a built-in tracker RID yourself or assign arbitrary Rids; IsValid does not verify a live owner.

SetSpatialContextvoid
# SetSpatialContext
C#
public void SetSpatialContext(Rid spatialContext);

Spatial-context RID, initially empty. After a valid RID is assigned, the setter rejects a different context, including empty; create a new tracker instead. Reading transfers no context ownership; do not free engine-owned default contexts. The setter does not establish OpenXR context readiness.

Parameters
NameTypeDefault
spatialContextRid—
spatialContext

Spatial-context RID, initially empty. After a valid RID is assigned, the setter rejects a different context, including empty; create a new tracker instead. Reading transfers no context ownership; do not free engine-owned default contexts. The setter does not establish OpenXR context readiness.

SetSpatialTrackingStatevoid
# SetSpatialTrackingState
C#
public void SetSpatialTrackingState(OpenXRSpatialEntityTracker.EntityTrackingState spatialTrackingState);

Spatial tracking state, initially Paused: Tracking, Paused or Stopped. The setter updates metadata and emits SpatialTrackingStateChanged on change; it creates no pose, starts no discovery and validates no position. Also require GetPose("default").HasTrackingData before using a pose.

Parameters
NameTypeDefault
spatialTrackingStateOpenXRSpatialEntityTracker.EntityTrackingState—
spatialTrackingState

Spatial tracking state, initially Paused: Tracking, Paused or Stopped. The setter updates metadata and emits SpatialTrackingStateChanged on change; it creates no pose, starts no discovery and validates no position. Also require GetPose("default").HasTrackingData before using a pose.

Signals and events2

NextChangedEvent
# NextChanged
C#
public event Action NextChanged;

Additional-structure list change through AddNext/RemoveNext. Establishes no changed pose, discovery or runtime application. Directly changing a structure Next need not pass through this signal.

SpatialTrackingStateChangedEvent
# SpatialTrackingStateChanged
C#
public event OpenXRSpatialEntityTracker.SpatialTrackingStateChangedEventHandler SpatialTrackingStateChanged;

Spatial-state change signal; its C# argument is long. Convert to EntityTrackingState after checking the expected value. Reassigning an equal state emits nothing. This establishes neither valid pose nor ready geometry; handle visibility and collision separately.

Handler parameters
NameTypeDefault
spatialTrackingStatelong—
spatialTrackingState

New state as long corresponding to EntityTrackingState; does not establish valid pose.

OpenXRSpatialEntityTracker.EntityTrackingState

ValueDescription
Paused = 2

Tracking is currently paused.

Stopped = 1

This anchor has stopped tracking.

Tracking = 3

This anchor is currently being tracked.

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.