docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XrSpatialRaycastSnapshotCreateInfoANDROID

    Information used to synchronously create a snapshot handle via raycast. Provided by XR_ANDROID_spatial_discovery_raycast.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.OpenXR.NativeTypes
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public readonly struct XrSpatialRaycastSnapshotCreateInfoANDROID
    Remarks

    Unlike xrCreateSpatialDiscoverySnapshotAsyncEXT, a raycast snapshot is created synchronously, so you can query raycast results immediately.

    Warning

    Don't initialize this struct with the default parameterless constructor. Use a constructor with parameters to ensure that type is correctly initialized to SpatialRaycastSnapshotCreateInfoANDROID.

    Warning

    raycastInfo stores the address of the raycastInfo passed to the constructor, and this struct does not keep that memory alive. The referent must remain valid and at a stable address for as long as you use this struct.

    In particular, don't pass a temporary. Because the constructors take raycastInfo by in, an expression such as new XrSpatialRaycastSnapshotCreateInfoANDROID(new XrSpatialRaycastInfoANDROID(...)) compiles, but stores the address of a value that is destroyed immediately. Assign the XrSpatialRaycastInfoANDROID to a local or field first, then pass that.

    Constructors

    XrSpatialRaycastSnapshotCreateInfoANDROID(uint, XrSpatialComponentTypeEXT*, in XrSpatialRaycastInfoANDROID)

    Construct an instance with a null next pointer.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(uint componentTypeCount, XrSpatialComponentTypeEXT* componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    uint componentTypeCount

    The count of elements in componentTypes. May be 0.

    XrSpatialComponentTypeEXT* componentTypes

    Pointer to an array of component types to include in the snapshot. May be null.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(void*, uint, XrSpatialComponentTypeEXT*, in XrSpatialRaycastInfoANDROID)

    Construct an instance.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(void* next, uint componentTypeCount, XrSpatialComponentTypeEXT* componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    void* next

    The next pointer.

    uint componentTypeCount

    The count of elements in componentTypes. May be 0.

    XrSpatialComponentTypeEXT* componentTypes

    Pointer to an array of component types to include in the snapshot. May be null.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(void*, NativeArray<XrSpatialComponentTypeEXT>, in XrSpatialRaycastInfoANDROID)

    Construct an instance from a native array.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(void* next, NativeArray<XrSpatialComponentTypeEXT> componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    void* next

    The next pointer.

    NativeArray<XrSpatialComponentTypeEXT> componentTypes

    Native array of component types to include in the snapshot.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(void*, ReadOnly, in XrSpatialRaycastInfoANDROID)

    Construct an instance from a read-only native array.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(void* next, NativeArray<XrSpatialComponentTypeEXT>.ReadOnly componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    void* next

    The next pointer.

    NativeArray<XrSpatialComponentTypeEXT>.ReadOnly componentTypes

    Read-only native array of component types to include in the snapshot.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(NativeArray<XrSpatialComponentTypeEXT>, in XrSpatialRaycastInfoANDROID)

    Construct an instance with a null next pointer from a native array.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(NativeArray<XrSpatialComponentTypeEXT> componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    NativeArray<XrSpatialComponentTypeEXT> componentTypes

    Native array of component types to include in the snapshot.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(ReadOnly, in XrSpatialRaycastInfoANDROID)

    Construct an instance with a null next pointer from a read-only native array.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(NativeArray<XrSpatialComponentTypeEXT>.ReadOnly componentTypes, in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    NativeArray<XrSpatialComponentTypeEXT>.ReadOnly componentTypes

    Read-only native array of component types to include in the snapshot.

    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    XrSpatialRaycastSnapshotCreateInfoANDROID(in XrSpatialRaycastInfoANDROID)

    Construct an instance with a null next pointer and no component type filter, which includes all spatial entities hit by the ray that have the components enabled for the raycast-supported capabilities of the spatial context.

    Declaration
    public XrSpatialRaycastSnapshotCreateInfoANDROID(in XrSpatialRaycastInfoANDROID raycastInfo)
    Parameters
    Type Name Description
    XrSpatialRaycastInfoANDROID raycastInfo

    A reference to the struct describing the ray.

    Properties

    componentTypeCount

    The count of elements in componentTypes. May be 0.

    Declaration
    public uint componentTypeCount { get; }
    Property Value
    Type Description
    uint

    componentTypes

    Pointer to an array of component types to include in the snapshot. May be null.

    Declaration
    public XrSpatialComponentTypeEXT* componentTypes { get; }
    Property Value
    Type Description
    XrSpatialComponentTypeEXT*
    Remarks

    If you don't provide a list of component types, the runtime includes all spatial entities in the snapshot that have the set of components enumerated in enabledComponents for the raycast-supported capabilities configured for the spatial context.

    next

    null or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.

    Declaration
    public void* next { get; }
    Property Value
    Type Description
    void*

    raycastInfo

    A reference to the struct describing the ray.

    Declaration
    public XrSpatialRaycastInfoANDROID* raycastInfo { get; }
    Property Value
    Type Description
    XrSpatialRaycastInfoANDROID*

    type

    The XrStructureType of this struct: SpatialRaycastSnapshotCreateInfoANDROID.

    Declaration
    public XrStructureType type { get; }
    Property Value
    Type Description
    XrStructureType
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)