data-comp-anchor

<mr-entity data-comp-anchor="type: plane; label: table"></mr-entity>

Anchoring is achieved using the anchoring component data-comp-anchor on any mr-entity. It has 4 attributes:

type

There are currently three types of anchors:

If no label or orientation is specified, the element will be anchored to the nearest plane.

Note: each plane is limited to one anchor for simplicity. To anchor multiple entities to a single plane, group them under a parent entity and anchor the parent entity.

Plane anchor attributes

These attributes are only relevant to plane anchors.

orientation (optional)

This attribute is useful when you wish to anchor to a plane of any given orientation, regardless of label.

Supported values: horizontal, vertical

label (optional)

Use this to target a specific type of plane, such as a table or wall.

Supported values: wall, floor, ceiling, table

occlusion

By default, planes occlude virtual content behind them, use this flag to disable occlusion.

Values: true (default), false