Skip to main content

Function: moveDirection()

function moveDirection(input: MoveInput, yaw: number): [number, number];

Defined in: xrblocks-uiextensions/src/desktop-locomotion.ts:92

Ground-plane movement direction in WORLD space for a given yaw.

Yaw is the camera's heading (0 = looking down -Z, matching three.js). Returns a normalised [x, z] so diagonal movement isn't faster, or [0, 0] when no direction is held.

Parameters

ParameterType
inputMoveInput
yawnumber

Returns

[number, number]