Plane

public class Plane

Describes the current best knowledge of a real-world planar surface.

Merging / Subsumption

Two or more planes may be automatically merged into a single parent plane, resulting in each child plane's getSubsumedBy() returning the parent plane. A subsumed plane becomes identical to the parent plane, and will continue behaving as if it were independently tracked, for example being included in the output of Frame.getUpdatedTrackables(Class).

Planes are hashable and may for example be used as keys in HashMaps. Subsumed planes are distinct from their parents and siblings.

Change from Developer Preview 1: Two Plane objects may refer to the same logical plane detected by the system. Be sure to always use equals(Object) when comparing them.

Nested Classes

enum Plane.Type Simple summary of the normal vector of a plane, for filtering purposes. 

Public Methods

Anchor
createAnchor(Pose pose)
Creates an anchor that is attached to this trackable, using the given initial pose in the world coordinate space.
boolean
equals(Object obj)
Indicates whether some other object is a Trackable referencing the same logical trackable as this one.
Collection<Anchor>
getAnchors()
Gets the Anchors attached to this trackable.
Pose
getCenterPose()
Returns the pose of the center of the detected plane.
float
getExtentX()
Returns the length of this plane's bounding rectangle measured along the local X-axis of the coordinate space centered on the plane.
float
getExtentZ()
Returns the length of this plane's bounding rectangle measured along the local Z-axis of the coordinate frame centered on the plane.
FloatBuffer
getPolygon()
Returns the 2D vertices of a convex polygon approximating the detected plane, in the form [x1, z1, x2, z2, ...].
Plane
getSubsumedBy()
If this plane has been subsumed, returns the plane this plane was merged into.
TrackingState
getTrackingState()
Gets this trackable's TrackingState.
Plane.Type
getType()
Returns the type of this plane.
int
hashCode()
Returns a hash code value for the object.
boolean
isPoseInExtents(Pose pose)
Returns true if the given pose (usually obtained from a HitResult) is in the plane's rectangular extents.
boolean
isPoseInPolygon(Pose pose)
Returns true if the given pose (usually obtained from a HitResult) is in the plane's polygon.

Inherited Methods

Public Methods

createAnchor

public Anchor createAnchor(
  Pose pose
)

Creates an anchor that is attached to this trackable, using the given initial pose in the world coordinate space. The type of trackable will determine the semantics of attachment and how the anchor's pose will be updated to maintain this relationship. Note that the relative offset between the pose of multiple anchors attached to a trackable may adjust slightly over time as ARCore updates its model of the world.

Details
Parameters
pose

equals

public boolean equals(
  Object obj
)

Indicates whether some other object is a Trackable referencing the same logical trackable as this one.

Details
Parameters
obj the reference object with which to compare.
Returns true if this object is the same as the obj argument; false otherwise.
See Also

getAnchors

public Collection<Anchor> getAnchors()

Gets the Anchors attached to this trackable.

getCenterPose

public Pose getCenterPose()

Returns the pose of the center of the detected plane. The pose's transformed +Y axis will be point normal out of the plane, with the +X and +Z axes orienting the extents of the bounding rectangle.

getExtentX

public float getExtentX()

Returns the length of this plane's bounding rectangle measured along the local X-axis of the coordinate space centered on the plane.

getExtentZ

public float getExtentZ()

Returns the length of this plane's bounding rectangle measured along the local Z-axis of the coordinate frame centered on the plane.

getPolygon

public FloatBuffer getPolygon()

Returns the 2D vertices of a convex polygon approximating the detected plane, in the form [x1, z1, x2, z2, ...]. These X-Z values are in the plane's local x-z plane (y=0) and must be transformed by the pose (getCenterPose()) to get the boundary in world coordinates.

getSubsumedBy

public Plane getSubsumedBy()

If this plane has been subsumed, returns the plane this plane was merged into. In cases where a subsuming plane is itself subsumed, this function will always return the topmost non-subsumed plane.

See the Merging / Subsumption section above for details of the subsumption process.

Details
Returns the non-subsumed plane that this one has been merged into, or null if the plane has not been subsumed.

getTrackingState

public TrackingState getTrackingState()

Gets this trackable's TrackingState.

getType

public Plane.Type getType()

Returns the type of this plane.

hashCode

public int hashCode()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

Details
Returns a hash code value for this object.
See Also

isPoseInExtents

public boolean isPoseInExtents(
  Pose pose
)

Returns true if the given pose (usually obtained from a HitResult) is in the plane's rectangular extents.

Details
Parameters
pose

isPoseInPolygon

public boolean isPoseInPolygon(
  Pose pose
)

Returns true if the given pose (usually obtained from a HitResult) is in the plane's polygon.

Details
Parameters
pose