Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit9a85df95a3

README.md

xr_gestures

What the gestures of bare hands do in the world. The engine reads them from the joints of each hand (xr.gestures()) and makes the menu button and the snap turn itself; this module is the teleport.

  • Menu. The left palm faces the person and the fingers pinch: the left menu button is held for as long as the pinch is.
  • Turn. The right hand pinches and flicks to the left or the right: one snap turn step that way.
  • Teleport. The left hand points (middle, ring and little finger curled) and holds a pinch: an arc leaves the hand along its aim and a marker stands where it lands. Letting go after a short hold lands it, moving the player's body in play mode and the editor's camera in edit mode; letting go sooner cancels it.
  • Grab. A pinch that begins with the laser on an object grips it in the editor (xr_edit).
local Gestures = require("@builtin::modules.api.engine.xr_gestures")
Gestures.tick({ mode = engine.mode, body = bodyEntityId })

arcPoints, landing and lookRotation are the arc's pure rules. setInput(source) reads the gestures, the aim pose and the ray cast from a table in place of the XR session; status() says whether an arc is drawn and how many teleports have landed.