ArInstantPlacementPoint
Trackable Instant Placement point returned by ArFrame_hitTestInstantPlacement
.
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:
- Keep track of the pose and tracking method of the
ArInstantPlacementPoint
in each frame. - Wait for the tracking method to change to
AR_INSTANT_PLACEMENT_POINT_TRACKING_METHOD_FULL_TRACKING
. - 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.
- Calculate the apparent change in scale due to the change in distance from the camera.
- 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.
- Optionally, smoothly adjust the scale of the object back to its original value over several frames.
Summary
Enumerations |
|
---|---|
ArInstantPlacementMode{
|
enum Used in ArConfig to indicate whether Instant Placement should be enabled or disabled. |
ArInstantPlacementPointTrackingMethod{
|
enum Tracking methods for ArInstantPlacementPoint . |
Typedefs |
|
---|---|
ArInstantPlacementPoint
|
typedefstruct 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 |
AR_INSTANT_PLACEMENT_MODE_LOCAL_Y_UP
|
Enable Instant Placement. If the hit test is successful, 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
.
Typedefs
ArInstantPlacementPoint
struct ArInstantPlacementPoint_ ArInstantPlacementPoint
- Trackable type:
AR_TRACKABLE_INSTANT_PLACEMENT_POINT
- Release with:
ArTrackable_release
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 |
|
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 |
|