Skip to content

Spatial Entities #876

@bjornbytes

Description

@bjornbytes

OpenXR just released a new bundle of spatial entities extensions. They let you do 3 things:

  • Scan for planes in the environment.
  • Scan for markers (QR codes, april tags, etc.) in the environment.
  • Place custom anchors in the world, which will be specially tracked in physical space and always remain locked even if you recenter, reconfigure your play area, or restart the app.

Here's the proposed API to add all this to LÖVR.

lovr.headset.newScanner(type, options)
Scanner:getType() --> surface or marker
Scanner:isScanning()
Scanner:start() --> starts scanning, will periodically update its anchors automatically
Scanner:stop()
Scanner:scan() --> force a manual scan, not normally needed
Scanner:getAnchors() --> table of currently detected Anchor objects
Scanner:anchors() --> iterates over currently detected Anchors (garbage free)

lovr.scancomplete(scanner) --> lets you know when scanner has new data

lovr.headset.newAnchor(x, y, z, angle, ax, ay, az) --> create custom anchor
Anchor:getType() --> custom, surface, marker
Anchor:getStatus() --> tracked, untracked, invalid
Anchor:getPosition/Orientation/Pose/Normal()
Anchor:getWidth/Height/Depth/Dimensions() --> zero for custom anchor, otherwise size of surface/marker
Anchor:getLabel() --> QR code string, or surface label like "floor", "wall" etc.
Anchor:getTriangles() --> get mesh for surface

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions