Skip to content

Pointer

Josh Stovall edited this page Dec 21, 2020 · 2 revisions

Pointer()

track what use is pointing at

in VR, it creates a raycaster on their controller
in 2D, it tracks the mouse location

See the live demo.

Parameters

Name Type Options Description
type string 2D 3D type of pointer
length float length of pointer
action functions function to call on click

Example

// setup controller
var controller = new XR.Gamepad();

// setup pointer
new XR.Pointer({
   type: '3D',
   length: 10,
   action: myFunction,
   bind: controller.right
});

Clone this wiki locally