# ArInstantPlacementPoint

Trackable Instant Placement point returned by `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_hittestinstantplacement`.

If ARCore has an accurate 3D pose for the `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` returned by `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_hittestinstantplacement` it will start with tracking method `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking`. Otherwise, it will start with tracking method `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance`, and will transition to `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking` once ARCore has an accurate 3D pose. Once the tracking method is `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking` it will not revert to `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance`.

When the tracking method changes from `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance` in one frame to `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#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 `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#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 `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` in each frame.
2. Wait for the tracking method to change to `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#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.

<br />

## Summary

| ### Enumerations ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementmode{ https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_mode_disabled = 0, https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_mode_local_y_up = 2 }` | enumUsed in `https://developers.google.com/ar/reference/c/group/ar-config#arconfig` to indicate whether Instant Placement should be enabled or disabled. |
| `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpointtrackingmethod{ https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_not_tracking = 0, https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance = 1, https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking = 2 }` | enumTracking methods for `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint`. |

| ### Typedefs ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` | typedef `struct ArInstantPlacementPoint_` ([reference type, long-lived](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)). |

| ### Functions ||
|---|---|
| `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint_getpose(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint *instant_placement_point, https://developers.google.com/ar/reference/c/group/ar-pose#arpose *out_pose)` | `void` Returns the pose of the `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint`. |
| `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint_gettrackingmethod(const https://developers.google.com/ar/reference/c/group/ar-session#arsession *session, const https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint *instant_placement_point, https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpointtrackingmethod *out_tracking_method)` | `void` Returns the tracking method of the `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint`. |

## Enumerations

### ArInstantPlacementMode

```
 ArInstantPlacementMode
```
Used in `https://developers.google.com/ar/reference/c/group/ar-config#arconfig` to indicate whether Instant Placement should be enabled or disabled.

Default value is `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_mode_disabled`.

| Properties ||
|---|---|
| `AR_INSTANT_PLACEMENT_MODE_DISABLED` | Instant Placement is disabled. When Instant Placement is disabled, any `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` that has `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance` tracking method will result in tracking state becoming permanently `https://developers.google.com/ar/reference/c/group/shared-types#ar_tracking_state_stopped`. |
| `AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP` | Enable Instant Placement. If the hit test is successful, `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_hittestinstantplacement` will return a single `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#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: - The resulting Instant Placement point will always have a pose with +Y pointing upward, against gravity. - No guarantees are made with respect to orientation of +X and +Z. Specifically, a hit test against a vertical surface, such as a wall, will not result in a pose that's in any way aligned to the plane of the wall, other than +Y being up, against gravity. - The `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint's` tracking method may never become `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking` or may take a long time to reach this state. The tracking method remains `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance`. until a (tiny) horizontal plane is fitted at the point of the hit test. <br /> |

### ArInstantPlacementPointTrackingMethod

```
 ArInstantPlacementPointTrackingMethod
```
Tracking methods for `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint`.

| Properties ||
|---|---|
| `AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING` | The `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` is being tracked normally and `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint_getpose` is using a pose fully determined by ARCore. ARCore doesn't limit the number of Instant Placement points with `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_full_tracking` that are being tracked concurrently. |
| `AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_NOT_TRACKING` | The `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` is not currently being tracked. The `https://developers.google.com/ar/reference/c/group/shared-types#artrackingstate` is `https://developers.google.com/ar/reference/c/group/shared-types#ar_tracking_state_paused` or `https://developers.google.com/ar/reference/c/group/shared-types#ar_tracking_state_stopped`. |
| `AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_SCREENSPACE_WITH_APPROXIMATE_DISTANCE` | The `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint` is currently being tracked in screen space and the pose returned by `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint_getpose` is being estimated using the approximate distance provided to `https://developers.google.com/ar/reference/c/group/ar-frame#arframe_hittestinstantplacement`. ARCore concurrently tracks at most 20 Instant Placement points that are `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance`. As additional Instant Placement points with `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#ar_instant_placement_point_tracking_method_screenspace_with_approximate_distance` are created, the oldest points will become permanently `https://developers.google.com/ar/reference/c/group/shared-types#ar_tracking_state_stopped` in order to maintain the maximum number of concurrently tracked points. |

## Typedefs

### ArInstantPlacementPoint

```
struct ArInstantPlacementPoint_ ArInstantPlacementPoint
```
([reference type, long-lived](https://developers.google.com/ar/reference/c/group/concepts#object-ownership)).


- Trackable type: `https://developers.google.com/ar/reference/c/group/ar-trackable#ar_trackable_instant_placement_point`
- Release with: `https://developers.google.com/ar/reference/c/group/ar-trackable#artrackable_release`

<br />

## Functions

### ArInstantPlacementPoint_getPose

```
void ArInstantPlacementPoint_getPose(
  const ArSession *session,
  const ArInstantPlacementPoint *instant_placement_point,
  ArPose *out_pose
)
```
Returns the pose of the `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpoint`.


Details Parameters `session` The ARCore session. `instant_placement_point` The Instant Placement point to retrieve the pose of. `out_pose` An `https://developers.google.com/ar/reference/c/group/ar-pose#arpose` object already-allocated via `https://developers.google.com/ar/reference/c/group/ar-pose#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 `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#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 `https://developers.google.com/ar/reference/c/group/ar-instant-placement-point#arinstantplacementpointtrackingmethod` object into which the tracking method will be stored.