Flutter Engine
The Flutter Engine
Typedefs | Functions
Plane

Typedefs

typedef struct ArPlane_ ArPlane
 

Functions

 AR_DEFINE_ENUM (ArPlaneType)
 
void ArPlane_acquireSubsumedBy (const ArSession *session, const ArPlane *plane, ArPlane **out_subsumed_by)
 
void ArPlane_getType (const ArSession *session, const ArPlane *plane, ArPlaneType *out_plane_type)
 Retrieves the type (orientation) of the plane. See ::ArPlaneType. More...
 
void ArPlane_getCenterPose (const ArSession *session, const ArPlane *plane, ArPose *out_pose)
 
void ArPlane_getExtentX (const ArSession *session, const ArPlane *plane, float *out_extent_x)
 
void ArPlane_getExtentZ (const ArSession *session, const ArPlane *plane, float *out_extent_z)
 
void ArPlane_getPolygonSize (const ArSession *session, const ArPlane *plane, int32_t *out_polygon_size)
 
void ArPlane_getPolygon (const ArSession *session, const ArPlane *plane, float *out_polygon_xz)
 
void ArPlane_isPoseInExtents (const ArSession *session, const ArPlane *plane, const ArPose *pose, int32_t *out_pose_in_extents)
 
void ArPlane_isPoseInPolygon (const ArSession *session, const ArPlane *plane, const ArPose *pose, int32_t *out_pose_in_polygon)
 

Detailed Description

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

Typedef Documentation

◆ ArPlane

typedef struct ArPlane_ ArPlane

A detected planar surface (reference type, long-lived).

Trackable type: #AR_TRACKABLE_PLANE
Release with: ArTrackable_release()

Definition at line 284 of file arcore_c_api.h.

Function Documentation

◆ AR_DEFINE_ENUM()

AR_DEFINE_ENUM ( ArPlaneType  )

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

A horizontal plane facing upward (for example a floor or tabletop).

A horizontal plane facing downward (for example a ceiling).

A vertical plane (for example a wall).

Definition at line 742 of file arcore_c_api.h.

742 {
743 /// A horizontal plane facing upward (for example a floor or tabletop).
744 AR_PLANE_HORIZONTAL_UPWARD_FACING = 0,
745 /// A horizontal plane facing downward (for example a ceiling).
746 AR_PLANE_HORIZONTAL_DOWNWARD_FACING = 1,
747 /// A vertical plane (for example a wall).
748 AR_PLANE_VERTICAL = 2};

◆ ArPlane_acquireSubsumedBy()

void ArPlane_acquireSubsumedBy ( const ArSession session,
const ArPlane plane,
ArPlane **  out_subsumed_by 
)

Acquires a reference to the plane subsuming this plane.

Two or more planes may be automatically merged into a single parent plane, resulting in this method acquiring the parent plane when called with each child 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 ArFrame_getUpdatedTrackables().

In cases where a subsuming plane is itself subsumed, this function will always return the topmost non-subsumed plane.

Note: this function will set *out_subsumed_by to NULL if the plane is not subsumed.

◆ ArPlane_getCenterPose()

void ArPlane_getCenterPose ( const ArSession session,
const ArPlane plane,
ArPose out_pose 
)

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.

Parameters
[in]sessionThe ARCore session.
[in]planeThe plane for which to retrieve center pose.
[in,out]out_poseAn already-allocated ArPose object into which the pose will be stored.

◆ ArPlane_getExtentX()

void ArPlane_getExtentX ( const ArSession session,
const ArPlane plane,
float *  out_extent_x 
)

Retrieves the length of this plane's bounding rectangle measured along the local X-axis of the coordinate space defined by the output of ArPlane_getCenterPose().

◆ ArPlane_getExtentZ()

void ArPlane_getExtentZ ( const ArSession session,
const ArPlane plane,
float *  out_extent_z 
)

Retrieves the length of this plane's bounding rectangle measured along the local Z-axis of the coordinate space defined by the output of ArPlane_getCenterPose().

◆ ArPlane_getPolygon()

void ArPlane_getPolygon ( const ArSession session,
const ArPlane plane,
float *  out_polygon_xz 
)

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 (ArPlane_getCenterPose()) to get the boundary in world coordinates.

Parameters
[in]sessionThe ARCore session.
[in]planeThe plane to retrieve the polygon from.
[in,out]out_polygon_xzA pointer to an array of floats. The length of this array must be at least that reported by ArPlane_getPolygonSize().

◆ ArPlane_getPolygonSize()

void ArPlane_getPolygonSize ( const ArSession session,
const ArPlane plane,
int32_t *  out_polygon_size 
)

Retrieves the number of elements (not vertices) in the boundary polygon. The number of vertices is 1/2 this size.

◆ ArPlane_getType()

void ArPlane_getType ( const ArSession session,
const ArPlane plane,
ArPlaneType *  out_plane_type 
)

Retrieves the type (orientation) of the plane. See ::ArPlaneType.

◆ ArPlane_isPoseInExtents()

void ArPlane_isPoseInExtents ( const ArSession session,
const ArPlane plane,
const ArPose pose,
int32_t *  out_pose_in_extents 
)

Sets *out_pose_in_extents to non-zero if the given pose (usually obtained from a HitResult) is in the plane's rectangular extents.

◆ ArPlane_isPoseInPolygon()

void ArPlane_isPoseInPolygon ( const ArSession session,
const ArPlane plane,
const ArPose pose,
int32_t *  out_pose_in_polygon 
)

Sets *out_pose_in_extents to non-zero if the given pose (usually obtained from a HitResult) is in the plane's polygon.