docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRPlaneSubsystem.Provider

    The provider API for XRPlaneSubsystem-derived classes to implement.

    Inheritance
    object
    SubsystemProvider
    SubsystemProvider<XRPlaneSubsystem>
    XRPlaneSubsystem.Provider
    Inherited Members
    SubsystemProvider<XRPlaneSubsystem>.TryInitialize()
    SubsystemProvider<XRPlaneSubsystem>.Start()
    SubsystemProvider<XRPlaneSubsystem>.Stop()
    SubsystemProvider<XRPlaneSubsystem>.Destroy()
    SubsystemProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public abstract class XRPlaneSubsystem.Provider : SubsystemProvider<XRPlaneSubsystem>

    Properties

    currentPlaneDetectionMode

    Get the current plane detection mode in use by the provider.

    Declaration
    public virtual PlaneDetectionMode currentPlaneDetectionMode { get; }
    Property Value
    Type Description
    PlaneDetectionMode

    requestedPlaneDetectionMode

    Get or set the requested PlaneDetectionMode.

    Declaration
    public abstract PlaneDetectionMode requestedPlaneDetectionMode { get; set; }
    Property Value
    Type Description
    PlaneDetectionMode

    Methods

    CreateOrResizeNativeArrayIfNecessary<T>(int, Allocator, ref NativeArray<T>)

    Creates or resizes the array if necessary. If array has been allocated and its length is equal to length, then this method does nothing. If its length is different, then it is first disposed before being assigned to a new NativeArray.

    Declaration
    protected static void CreateOrResizeNativeArrayIfNecessary<T>(int length, Allocator allocator, ref NativeArray<T> array) where T : struct
    Parameters
    Type Name Description
    int length

    The length that array will have after this method returns.

    Allocator allocator

    If allocation is necessary, this allocator will be used to create the new NativeArray.

    NativeArray<T> array

    The array to create or resize.

    Type Parameters
    Name Description
    T

    The type of elements held by the array.

    GetBoundary(TrackableId, Allocator, ref NativeArray<Vector2>)

    Gets the boundary vertices of a given BoundedPlane based on its trackableId.

    Declaration
    public virtual void GetBoundary(TrackableId trackableId, Allocator allocator, ref NativeArray<Vector2> boundary)
    Parameters
    Type Name Description
    TrackableId trackableId

    The TrackableId of a BoundedPlane.

    Allocator allocator

    An Allocator to use if boundary needs to be created. Temp is not supported. Use TempJob if you need temporary memory.

    NativeArray<Vector2> boundary

    The boundary vertices will be stored here. If the given array is the same length as the number of vertices, it is overwritten with the new data. Otherwise, it is disposed and recreated with the correct length.

    Remarks

    See CreateOrResizeNativeArrayIfNecessary<T>(int, Allocator, ref NativeArray<T>) for a helper method implementation.

    GetChanges(BoundedPlane, Allocator)

    Gets a TrackableChanges<T> struct containing any changes to detected planes since the last time you called this method. You are responsible to Dispose() the returned TrackableChanges instance.

    Declaration
    public abstract TrackableChanges<BoundedPlane> GetChanges(BoundedPlane defaultPlane, Allocator allocator)
    Parameters
    Type Name Description
    BoundedPlane defaultPlane

    The default plane. You should use this to initialize the returned TrackableChanges<T> instance by passing it to the constructor TrackableChanges(int, int, int, Allocator, T).

    Allocator allocator

    An Allocator to use when allocating the returned NativeArrays.

    Returns
    Type Description
    TrackableChanges<BoundedPlane>

    The changes to planes since the last call to this method.

    In This Article
    Back to top
    Copyright © 2024 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)