Google is committed to advancing racial equity for Black communities. See how.

ArInstantPlacementPoint

Trackable Instant Placement point returned by ArFrame_hitTestInstantPlacement.

Summary

If ARCore has an accurate 3D pose for the ArInstantPlacementPoint returned by ArFrame_hitTestInstantPlacement it will start with tracking method AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING. Otherwise, it will start with tracking method AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE, and will transition to AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING once ARCore has an accurate 3D pose. Once the tracking method is AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING it will not revert to AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE.

When the tracking method changes from AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE in one frame to AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING in the next frame, the pose will jump from its initial location based on the provided approximate distance to a new location at an accurate distance.

This instantaneous change in pose will change the apparent scale of any objects that are anchored to the ArInstantPlacementPoint. That is, an object will suddenly appear larger or smaller than it was in the previous frame.

To avoid the visual jump due to the sudden change in apparent object scale, use the following procedure:

  1. Keep track of the pose and tracking method of the ArInstantPlacementPoint in each frame.
  2. Wait for the tracking method to change to AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING.
  3. Use the pose from the previous frame and the pose in the current frame to determine the object's distance to the device in both frames.
  4. Calculate the apparent change in scale due to the change in distance from the camera.
  5. Adjust the scale of the object to counteract the perceived change in scale, so that visually the object does not appear to change in size.
  6. Optionally, smoothly adjust the scale of the object back to its original value over several frames.

Enumerations

ArInstantPlacementMode{
  AR_INSTANT_PLACEMENT_MODE_DISABLED = 0,
  AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP = 2
}
enum
Used in ArConfig to indicate whether Instant Placement should be enabled or disabled.
ArInstantPlacementPointTrackingMethod{
  AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_NOT_TRACKING = 0,
  AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE = 1,
  AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING = 2
}
enum
Tracking methods for ArInstantPlacementPoint.

Typedefs

ArInstantPlacementPoint typedef
struct ArInstantPlacementPoint_

Functions

ArInstantPlacementPoint_getPose(const ArSession *session, const ArInstantPlacementPoint *instant_placement_point, ArPose *out_pose)
void
Returns the pose of the ArInstantPlacementPoint.
ArInstantPlacementPoint_getTrackingMethod(const ArSession *session, const ArInstantPlacementPoint *instant_placement_point, ArInstantPlacementPointTrackingMethod *out_tracking_method)
void
Returns the tracking method of the ArInstantPlacementPoint.

Enumerations

ArInstantPlacementMode

 ArInstantPlacementMode

Used in ArConfig to indicate whether Instant Placement should be enabled or disabled.

Default value is AR_INSTANT_PLACEMENT_MODE_DISABLED.

Properties
AR_INSTANT_PLACEMENT_MODE_DISABLED

Instant Placement is disabled.

When Instant Placement is disabled, any ArInstantPlacementPoint that has AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE tracking method will result in tracking state becoming permanently AR_TRACKING_STATE_STOPPED.

AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP

Enable Instant Placement.

If the hit test is successful, ArFrame_hitTestInstantPlacement will return a single ArInstantPlacementPoint with the +Y pointing upward, against gravity. Otherwise, returns an empty result set.

This mode is currently intended to be used with hit tests against horizontal surfaces.

Hit tests may also be performed against surfaces with any orientation, however:

ArInstantPlacementPointTrackingMethod

 ArInstantPlacementPointTrackingMethod

Tracking methods for ArInstantPlacementPoint.

Properties
AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING

The ArInstantPlacementPoint is being tracked normally and ArInstantPlacementPoint_getPose is using a pose fully determined by ARCore.

ARCore doesn't limit the number of Instant Placement points with AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING that are being tracked concurently.

AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_NOT_TRACKING

The ArInstantPlacementPoint is not currently being tracked.

The ArTrackingState is AR_TRACKING_STATE_PAUSED or AR_TRACKING_STATE_STOPPED.

AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE

The ArInstantPlacementPoint is currently being tracked in screen space and the pose returned by ArInstantPlacementPoint_getPose is being estimated using the approximate distance provided to ArFrame_hitTestInstantPlacement.

ARCore concurrently tracks at most 20 Instant Placement points that are AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE. As additional Instant Placement points with AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE are created, the oldest points will become permanently AR_TRACKING_STATE_STOPPED in order to maintain the maximum number of concurrently tracked points.

Typedefs

ArInstantPlacementPoint

struct ArInstantPlacementPoint_ ArInstantPlacementPoint

Functions

ArInstantPlacementPoint_getPose

void ArInstantPlacementPoint_getPose(
  const ArSession *session,
  const ArInstantPlacementPoint *instant_placement_point,
  ArPose *out_pose
)

Returns the pose of the ArInstantPlacementPoint.

Details
Parameters
session
The ARCore session.
instant_placement_point
The Instant Placement point to retrieve the pose of.
out_pose
An ArPose object already-allocated via ArPose_create into which the pose will be stored.

ArInstantPlacementPoint_getTrackingMethod

void ArInstantPlacementPoint_getTrackingMethod(
  const ArSession *session,
  const ArInstantPlacementPoint *instant_placement_point,
  ArInstantPlacementPointTrackingMethod *out_tracking_method
)

Returns the tracking method of the ArInstantPlacementPoint.

Details
Parameters
session
The ARCore session.
instant_placement_point
The Instant Placement point to retrieve the tracking method of.
out_tracking_method
An already-allocated ArInstantPlacementPointTrackingMethod object into which the tracking method will be stored.