AnchorPlacement


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 companion functions

AnchorPlacement
createForPlanes(planeTypeFilter: Set<Int>, planeSemanticFilter: Set<Int>)

Creates an anchor placement for anchoring to planes.

Public constructors

Public companion functions

createForPlanes

Added in 1.0.0-alpha01
fun createForPlanes(
    planeTypeFilter: Set<Int> = setOf(PlaneType.ANY),
    planeSemanticFilter: Set<Int> = setOf(PlaneSemantic.ANY)
): AnchorPlacement

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
planeTypeFilter: Set<Int> = setOf(PlaneType.ANY)

The set of plane types to filter by.

planeSemanticFilter: Set<Int> = setOf(PlaneSemantic.ANY)

The set of plane semantics to filter by.

Public constructors

AnchorPlacement

Added in 1.0.0-alpha01
AnchorPlacement()