docs.unity3d.com
    Show / Hide Table of Contents

    Struct BoundedPlane

    The session relative data associated with a plane.

    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public struct BoundedPlane : ITrackable, IEquatable<BoundedPlane>

    Constructors

    BoundedPlane(TrackableId, TrackableId, Pose, Vector2, Vector2, PlaneAlignment, TrackingState, IntPtr, PlaneClassification)

    Constructs a new BoundedPlane. This is just a data container for a plane's session relative data. These are typically created by GetChanges(Allocator).

    Declaration
    public BoundedPlane(TrackableId trackableId, TrackableId subsumedBy, Pose pose, Vector2 center, Vector2 size, PlaneAlignment alignment, TrackingState trackingState, IntPtr nativePtr, PlaneClassification classification)
    Parameters
    Type Name Description
    TrackableId trackableId

    The TrackableId associated with the plane.

    TrackableId subsumedBy

    The plane which subsumed this one. Use invalidId if it has not been subsumed.

    Pose pose

    The Pose associated with the plane.

    Vector2 center

    The center, in plane-space (relative to pose) of the plane.

    Vector2 size

    The dimensions associated with the plane.

    PlaneAlignment alignment

    The PlaneAlignment associated with the plane.

    TrackingState trackingState

    The TrackingState associated with the plane.

    IntPtr nativePtr

    The native pointer associated with the plane.

    PlaneClassification classification

    The PlaneClassification associated with the plane.

    Properties

    alignment

    The PlaneAlignment of the plane.

    Declaration
    public readonly PlaneAlignment alignment { get; }
    Property Value
    Type Description
    PlaneAlignment

    center

    The center of the plane in plane space (relative to its pose).

    Declaration
    public readonly Vector2 center { get; }
    Property Value
    Type Description
    Vector2

    classification

    The PlaneClassification of the plane.

    Declaration
    public readonly PlaneClassification classification { get; }
    Property Value
    Type Description
    PlaneClassification

    defaultValue

    Gets a default-initialized BoundedPlane. This may be different from the zero-initialized version, e.g., the pose is Pose.identity instead of zero-initialized.

    Declaration
    public static readonly BoundedPlane defaultValue { get; }
    Property Value
    Type Description
    BoundedPlane

    extents

    The extents of the plane (half dimensions) in meters.

    Declaration
    public readonly Vector2 extents { get; }
    Property Value
    Type Description
    Vector2

    height

    The height (or depth) of the plane in meters.

    Declaration
    public readonly float height { get; }
    Property Value
    Type Description
    Single

    nativePtr

    A native pointer associated with this plane. The data pointer to by this pointer is implementation defined.

    Declaration
    public readonly IntPtr nativePtr { get; }
    Property Value
    Type Description
    IntPtr
    Implements
    ITrackable.nativePtr

    normal

    The normal of the plane in session space.

    Declaration
    public readonly Vector3 normal { get; }
    Property Value
    Type Description
    Vector3

    plane

    Gets an infinite plane in session space.

    Declaration
    public readonly Plane plane { get; }
    Property Value
    Type Description
    Plane

    pose

    The Pose, in session space, of the plane.

    Declaration
    public readonly Pose pose { get; }
    Property Value
    Type Description
    Pose
    Implements
    ITrackable.pose

    size

    The size (dimensions) of the plane in meters.

    Declaration
    public readonly Vector2 size { get; }
    Property Value
    Type Description
    Vector2

    subsumedById

    The TrackableId associated with the plane which subsumed this one. Will be invalidId if this plane has not been subsumed.

    Declaration
    public readonly TrackableId subsumedById { get; }
    Property Value
    Type Description
    TrackableId

    trackableId

    The TrackableId associated with this plane.

    Declaration
    public readonly TrackableId trackableId { get; }
    Property Value
    Type Description
    TrackableId
    Implements
    ITrackable.trackableId

    trackingState

    The TrackingState of the plane.

    Declaration
    public readonly TrackingState trackingState { get; }
    Property Value
    Type Description
    TrackingState
    Implements
    ITrackable.trackingState

    width

    The width of the plane in meters.

    Declaration
    public readonly float width { get; }
    Property Value
    Type Description
    Single

    Methods

    Equals(Object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare against.

    Returns
    Type Description
    Boolean

    True if obj is of type BoundedPlane and Equals(BoundedPlane) also returns true; otherwise false.

    Overrides
    ValueType.Equals(Object)

    Equals(BoundedPlane)

    Tests for equality.

    Declaration
    public bool Equals(BoundedPlane other)
    Parameters
    Type Name Description
    BoundedPlane other

    The other BoundedPlane to compare against.

    Returns
    Type Description
    Boolean

    True if every field in other is equal to this BoundedPlane, otherwise false.

    GetCorners(out Vector3, out Vector3, out Vector3, out Vector3)

    Get the four corners of the plane in session space in clockwise order.

    Declaration
    public void GetCorners(out Vector3 p0, out Vector3 p1, out Vector3 p2, out Vector3 p3)
    Parameters
    Type Name Description
    Vector3 p0

    The first vertex.

    Vector3 p1

    The second vertex.

    Vector3 p2

    The third vertex.

    Vector3 p3

    The fourth vertex.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code generated from this object's fields.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Generates a new string describing the plane's properties suitable for debugging purposes.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string describing the plane's properties.

    Overrides
    ValueType.ToString()

    Operators

    Equality(BoundedPlane, BoundedPlane)

    Tests for equality. Same as Equals(BoundedPlane).

    Declaration
    public static bool operator ==(BoundedPlane lhs, BoundedPlane rhs)
    Parameters
    Type Name Description
    BoundedPlane lhs

    The left-hand side of the comparison.

    BoundedPlane rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    True if lhs is equal to rhs, otherwise false.

    Inequality(BoundedPlane, BoundedPlane)

    Tests for inequality. Same as !Equals(BoundedPlane).

    Declaration
    public static bool operator !=(BoundedPlane lhs, BoundedPlane rhs)
    Parameters
    Type Name Description
    BoundedPlane lhs

    The left-hand side of the comparison.

    BoundedPlane rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    True if lhs is not equal to rhs, otherwise false.

    See Also

    XRPlaneSubsystem
    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Monday, November 7, 2022
    Terms of use