Class ARPlane

java.lang.Object
com.codename1.ar.ARPlane

public final class ARPlane extends Object

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.

  • 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: the stable identifier shared by all snapshots of this plane

      • type: the surface orientation

      • centerPose: the pose of the plane center in world space; local X/Z span the surface, local Y is the normal

      • extentX: the surface extent along local X in meters

      • extentZ: the surface extent along local Z in meters

      • polygon: an optional boundary polygon as x, z pairs in the plane's local frame, or null when the platform supplies none

      • trackingState: 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.