Class ARPlane
Represents a plane (i.e., a flat surface) detected by an AR device.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Syntax
[DefaultExecutionOrder(-2147483646)]
[DisallowMultipleComponent]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.arfoundation@4.1/api/UnityEngine.XR.ARFoundation.ARPlane.html")]
public sealed class ARPlane : ARTrackable<BoundedPlane, ARPlane>
Remarks
Generated by the ARPlaneManager when an AR device detects a plane in the environment.
Properties
alignment
The alignment of this plane.
Declaration
public PlaneAlignment alignment { get; }
Property Value
Type | Description |
---|---|
PlaneAlignment |
boundary
The plane's boundary points, in plane space, that is, relative to this ARPlane's local position and rotation.
Declaration
public NativeArray<Vector2> boundary { get; }
Property Value
Type | Description |
---|---|
NativeArray<Vector2> |
center
The 3D center point, in Unity world space.
Declaration
public Vector3 center { get; }
Property Value
Type | Description |
---|---|
Vector3 |
centerInPlaneSpace
The 2D center point, in plane space
Declaration
public Vector2 centerInPlaneSpace { get; }
Property Value
Type | Description |
---|---|
Vector2 |
classification
The classification of this plane.
Declaration
public PlaneClassification classification { get; }
Property Value
Type | Description |
---|---|
PlaneClassification |
extents
The physical extents (half dimensions) of the plane in meters.
Declaration
public Vector2 extents { get; }
Property Value
Type | Description |
---|---|
Vector2 |
infinitePlane
Get the infinite plane associated with this ARPlane.
Declaration
public Plane infinitePlane { get; }
Property Value
Type | Description |
---|---|
Plane |
nativePtr
Get a native pointer associated with this plane.
Declaration
public IntPtr nativePtr { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Remarks
The data pointed to by this member is implementation defined. The lifetime of the pointed to object is also implementation defined, but should be valid at least until the next ARSession update.
normal
Gets the normal to this plane in world space.
Declaration
public Vector3 normal { get; }
Property Value
Type | Description |
---|---|
Vector3 |
size
The physical size (dimensions) of the plane in meters.
Declaration
public Vector2 size { get; }
Property Value
Type | Description |
---|---|
Vector2 |
subsumedBy
The ARPlane which has subsumed this plane, or null
if this plane has not been subsumed.
Declaration
public ARPlane subsumedBy { get; }
Property Value
Type | Description |
---|---|
ARPlane |
vertexChangedThreshold
The largest value by which a plane's vertex may change before the mesh is regenerated. Units are in meters.
Declaration
public float vertexChangedThreshold { get; set; }
Property Value
Type | Description |
---|---|
Single |
Events
boundaryChanged
Invoked when any vertex in the plane's boundary changes by more than vertexChangedThreshold.
Declaration
public event Action<ARPlaneBoundaryChangedEventArgs> boundaryChanged
Event Type
Type | Description |
---|---|
Action<ARPlaneBoundaryChangedEventArgs> |