OpenXRSpatialComponentMesh2DList
Spatial snapshot data: OpenXRSpatialComponentMesh2DList.
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.
Origin of local XY vertices relative to tracking space, not a world transform or ready XRAnchor3D mesh offset. Read only from a successfully filled row with valid state. Reconcile it with entity pose/coordinate conventions; the getter performs no scene/world rebasing.
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
OpenXRSpatialComponentMesh2DListConstructor
public OpenXRSpatialComponentMesh2DList();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
GetIndicesint[]
public int[] GetIndices(Rid snapshot, long index);Copies triangle indices from the same live snapshot to int[]. Supported UInt8/UInt16/UInt32 buffers convert to signed int; validate nonnegative values, vertex bounds and triangle multiples before building a mesh. Missing IDs/errors yield empty output; the getter creates/validates no triangles.
| Name | Type | Default |
|---|---|---|
snapshot | Rid | — |
index | long | — |
snapshotLive snapshot RID for this exact result; copy buffer data before freeing it. IsValid does not verify a live owner.
indexZero-based filled-row index from the same successful snapshot query, not entity ID. Matches OpenXRSpatialQueryResultData; allocated capacity alone is insufficient.
int[]Copies triangle indices from the same live snapshot to int[]. Supported UInt8/UInt16/UInt32 buffers convert to signed int; validate nonnegative values, vertex bounds and triangle multiples before building a mesh. Missing IDs/errors yield empty output; the getter creates/validates no triangles.
GetTransformTransform3D
public Transform3D GetTransform(long index);Origin of local XY vertices relative to tracking space, not a world transform or ready XRAnchor3D mesh offset. Read only from a successfully filled row with valid state. Reconcile it with entity pose/coordinate conventions; the getter performs no scene/world rebasing.
| 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.
Transform3DOrigin of local XY vertices relative to tracking space, not a world transform or ready XRAnchor3D mesh offset. Read only from a successfully filled row with valid state. Reconcile it with entity pose/coordinate conventions; the getter performs no scene/world rebasing.
GetVerticesVector2[]
public Vector2[] GetVertices(Rid snapshot, long index);Copies the selected row Vector2 vertex buffer from the same live snapshot. Requires successful QuerySnapshot, a valid index and Vector2F buffer; absent buffer ID returns an empty array. Copy before FreeSpatialSnapshot/end of a borrowed callback. Local XY data is not a Mesh; empty output alone proves no missing surface.
| Name | Type | Default |
|---|---|---|
snapshot | Rid | — |
index | long | — |
snapshotLive snapshot RID for this exact result; copy buffer data before freeing it. IsValid does not verify a live owner.
indexZero-based filled-row index from the same successful snapshot query, not entity ID. Matches OpenXRSpatialQueryResultData; allocated capacity alone is insufficient.
Vector2[]Copies the selected row Vector2 vertex buffer from the same live snapshot. Requires successful QuerySnapshot, a valid index and Vector2F buffer; absent buffer ID returns an empty array. Copy before FreeSpatialSnapshot/end of a borrowed callback. Local XY data is not a Mesh; empty output alone proves no missing surface.