Skip to content

Locomotion

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

Locomotion()

Move the User() around their Reality().

// create a user
var user = new XR.User();

// add locomotion
new XR.Locomotion({
    at: user,
    type:'fly',
    direction: controller[0].orientation(),
    speed:     controller[0].grip(), 
});

Parameters

Name Type Options Description
at object object to move
type string fly teleport walk mode of transport
direction object object to bind direction
speed object object to bind speed

Options

fly

move in 3 dimensions

new XR.Locomotion({
    type:'play',
    bind: controller.right.trigger,
});

teleport

point & click style

new XR.Locomotion({
    type:'teleport',
    bind: controller.right.trigger,
});

walk

move along a plane

new XR.Locomotion({
    type: 'walk',
    bind: controller.left.joystick
});

Links

See the live demo.

Clone this wiki locally