Log inGet started
Package

xr_pointer.module

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

xr_pointer

The pointing hand as the editor's pointer in a headset: the laser's ray, whether it is on a panel, and the trigger's and grip's press and release as edges that every reader of one frame sees identically.

local Pointer = require("@builtin::modules.api.editor.xr_pointer")
local p = Pointer.sample()
if p.worldPressed and p.ray ~= nil then
    -- a trigger press began in the world along p.ray
end

A trigger press belongs to the world when the laser was not on a panel as it began. Pointer.step(down, value, press, release) is the press and release rule with its two thresholds (0.55 and 0.35 for the trigger, 0.6 and 0.4 for the grip).