AI-generated Key Takeaways
-
Config.InstantPlacementMode is an enum used to select the behavior of Instant Placement, with the default value being DISABLED.
-
You can set the desired Instant Placement mode using the Config.setInstantPlacementMode method.
-
When DISABLED, Instant Placement is turned off, and hit tests for instant placement will return an empty list.
-
The LOCAL_Y_UP mode enables Instant Placement and, upon successful hit tests, returns a point with the +Y axis pointing upwards, intended primarily for horizontal surfaces.
public static final enum
Config.InstantPlacementMode
Select the behavior of Instant Placement. Default value is DISABLED.
Use Config.setInstantPlacementMode(InstantPlacementMode) to set the desired mode.
Inherited Methods
Enum Values
public static final Config.InstantPlacementMode DISABLED
DISABLED
public static final Config.InstantPlacementMode DISABLED
Disable Instant Placement. Frame.hitTestInstantPlacement(float, float, float) will
return an empty list.
When Instant Placement is disabled, any InstantPlacementPoint that has InstantPlacementPoint.TrackingMethod.SCREENSPACE_WITH_APPROXIMATE_DISTANCE tracking method
will result in tracking state becoming permanently TrackingState.STOPPED.
public static final Config.InstantPlacementMode LOCAL_Y_UP
LOCAL_Y_UP
public static final Config.InstantPlacementMode LOCAL_Y_UP
Enable Instant Placement. If the hit test is successful, Frame.hitTestInstantPlacement(float, float, float) will return a single InstantPlacementPoint 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
InstantPlacementPoint's tracking method may never becomeInstantPlacementPoint.TrackingMethod.FULL_TRACKINGor may take a long time to reach this state. The tracking method remainsInstantPlacementPoint.TrackingMethod.SCREENSPACE_WITH_APPROXIMATE_DISTANCEuntil a (tiny) horizontal plane is fitted at the point of the hit test.