public final class ARPlane

  1. Object
  2. ARPlane

A real-world surface detected by the AR session, such as a floor, table or wall. Planes grow and merge as the session learns more about the environment; each refinement is delivered as a new immutable ARPlane instance carrying the same getId(), through the session’s ARPlaneListener.

The plane’s local coordinate frame is centered at getCenterPose() with the surface spanning the local X and Z axes and the normal along local Y.

Nested types

enum ARPlane.TypeThe orientation of a detected plane.

Constructors

public ARPlane(String id, ARPlane.Type type, ARPose centerPose, float extentX, float extentZ, float[] polygon, ARTrackingState trackingState)Creates a plane snapshot.

Methods

public String getId()The stable identifier shared by all snapshots of this physical plane.
public ARPlane.Type getType()The surface orientation.
public ARPose getCenterPose()The pose of the plane center in world space.
public float getExtentX()The surface extent along the plane’s local X axis in meters.
public float getExtentZ()The surface extent along the plane’s local Z axis in meters.
public float[] getPolygon()The boundary polygon as a newly allocated array of x, z pairs in the plane’s local frame, or null when the platform supplies none.
public ARTrackingState getTrackingState()The tracking quality of this plane.

Inherited methods

Constructor details

ARPlane

public ARPlane(String id, ARPlane.Type type, ARPose centerPose, float extentX, float extentZ, float[] polygon, ARTrackingState trackingState)
Creates a plane snapshot. Intended for platform implementations and tests; applications receive planes from the session.

Parameters

id String
the stable identifier shared by all snapshots of this plane
type ARPlane.Type
the surface orientation
centerPose ARPose
the pose of the plane center in world space; local X/Z span the surface, local Y is the normal
extentX float
the surface extent along local X in meters
extentZ float
the surface extent along local Z in meters
polygon float[]
an optional boundary polygon as x, z pairs in the plane’s local frame, or null when the platform supplies none
trackingState ARTrackingState
the tracking quality of this plane

Method details

getId

public String getId()
The stable identifier shared by all snapshots of this physical plane.

getType

public ARPlane.Type getType()
The surface orientation.

getCenterPose

public ARPose getCenterPose()
The pose of the plane center in world space. Local X/Z span the surface, local Y is the surface normal.

getExtentX

public float getExtentX()
The surface extent along the plane’s local X axis in meters.

getExtentZ

public float getExtentZ()
The surface extent along the plane’s local Z axis in meters.

getPolygon

public float[] getPolygon()
The boundary polygon as a newly allocated array of x, z pairs in the plane’s local frame, or null when the platform supplies none.

getTrackingState

public ARTrackingState getTrackingState()
The tracking quality of this plane.