AnchorPlacement


public final class AnchorPlacement


Creates an AnchorPlacement for a MovableComponent.

This will enable the MovableComponent to automatically anchor the attached entity to a new entity

Summary

Public constructors

Public methods

static final @NonNull AnchorPlacement
createForPlanes(
    @NonNull Set<@NonNull Integer> planeTypeFilter,
    @NonNull Set<@NonNull Integer> planeSemanticFilter
)

Creates an anchor placement for anchoring to planes.

Public constructors

AnchorPlacement

Added in 1.0.0-alpha01
public AnchorPlacement()

Public methods

createForPlanes

Added in 1.0.0-alpha01
public static final @NonNull AnchorPlacement createForPlanes(
    @NonNull Set<@NonNull Integer> planeTypeFilter,
    @NonNull Set<@NonNull Integer> planeSemanticFilter
)

Creates an anchor placement for anchoring to planes.

Setting a PlaneType or PlaneSemantic filter means that the Entity with a MovableComponent will be anchored to a plane of that matches at least one of the specified PlaneType filters and at least one specified PlaneSemantic filters if it is released nearby. If no PlaneType or no PlaneSemantic is set the Entity will not be anchored.

When an entity is anchored to the plane the pose will be rotated so that it's Z-vector will be pointing our of the plane (i.e. if it is a panel it will be flat along the plane. The onMoveEnd callback can be used to listen for the [Entity] being anchored, reanchored, or unanchored. When anchored the parent will be updated to a new anchor entity. When unanchored the parent will be set to the [ActivitySpace].

Parameters
@NonNull Set<@NonNull Integer> planeTypeFilter

The set of plane types to filter by.

@NonNull Set<@NonNull Integer> planeSemanticFilter

The set of plane semantics to filter by.