OpenXRSpatialQueryResultData
Spatial snapshot data: OpenXRSpatialQueryResultData.
Native component-data container for QuerySnapshot, not a tracker, game Entity or ready geometry. OpenXRSpatialQueryResultData must be first in a query array; other components use the same row indices. Validate component support, successful query and row state before reading.
SetCapacity allocates memory rather than device data. Query-result GetCapacity reports allocated array length and can be nonzero without any query. Never consume stale storage after a failed/incomplete query. Final output counts are not separately public between the two passes; changing runtime result counts was not tested.
Buffer getters need the same live snapshot. Copy needed arrays/strings before FreeSpatialSnapshot or the end of a borrowed capability callback. Never double-free that snapshot; keep owned containers alive through use. Raw poses are not ready GlobalTransform values and do not automatically apply WorldOrigin/reference frame/WorldScale.
Stores runtime IDs and tracking states; an ID is no RID or persistence UUID. Use matching indices across component lists and handle Paused/Stopped without consuming invalid poses.
Integration guide. Eleven Windows XR-off checks covered metadata/capacity/virtual dispatch without reading unfilled memory. Real snapshots, buffer values, pose/UUID/marker decoding, headsets and export remain untested. Engine unchanged.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRSpatialQueryResultDataConstructor
public OpenXRSpatialQueryResultData();Creates a caller-owned RefCounted query-data container with empty buffers. Performs no QuerySnapshot and receives no device data. SetCapacity allocates without filling rows. Keep owned containers alive through native query use; do not dispose provider-owned resources.
Methods3
GetCapacitylong
public long GetCapacity();Allocated entity-ID array length as long, initially zero. SetCapacity(4) returns four without QuerySnapshot, so it is not a count of validated records. Read rows only after a successful query. Current allocation follows the first count pass; final output counts are not separately exposed, and changing counts between passes was not tested.
longAllocated entity-ID array length as long, initially zero. SetCapacity(4) returns four without QuerySnapshot, so it is not a count of validated records. Read rows only after a successful query. Current allocation follows the first count pass; final output counts are not separately exposed, and changing counts between passes was not tested.
GetEntityIdulong
public ulong GetEntityId(long index);Runtime row ID as ulong. Requires successful QuerySnapshot and an index within filled results; not a game Entity, RID or UUID. Use the same index for state and other component lists. Invalid indexing logs a native error and returns null ID zero, not a detected object.
| Name | Type | Default |
|---|---|---|
index | long | — |
indexZero-based filled-row index from the same successful snapshot query, not entity ID. Matches OpenXRSpatialQueryResultData; allocated capacity alone is insufficient.
ulongRuntime row ID as ulong. Requires successful QuerySnapshot and an index within filled results; not a game Entity, RID or UUID. Use the same index for state and other component lists. Invalid indexing logs a native error and returns null ID zero, not a detected object.
GetEntityStateOpenXRSpatialEntityTracker.EntityTrackingState
public OpenXRSpatialEntityTracker.EntityTrackingState GetEntityState(long index);Tracking state for the GetEntityId(index) row. Tracking permits reading supported component data; Paused/Stopped are no current valid pose. Invalid indexing returns a MAX_ENUM cast outside ordinary EntityTrackingState values. Never read after SetCapacity alone without a successful query.
| Name | Type | Default |
|---|---|---|
index | long | — |
indexZero-based filled-row index from the same successful snapshot query, not entity ID. Matches OpenXRSpatialQueryResultData; allocated capacity alone is insufficient.
OpenXRSpatialEntityTracker.EntityTrackingStateTracking state for the GetEntityId(index) row. Tracking permits reading supported component data; Paused/Stopped are no current valid pose. Invalid indexing returns a MAX_ENUM cast outside ordinary EntityTrackingState values. Never read after SetCapacity alone without a successful query.