API

Interface XrTeleportationOptions

interface XrTeleportationOptions {
    blockAllPickableMeshes?: boolean;
    blockedColor?: readonly [number, number, number];
    blockerPredicate?: (mesh: Mesh) => boolean;
    color?: readonly [number, number, number];
    floorMeshes?: readonly Mesh[];
    floorPredicate?: (mesh: Mesh) => boolean;
    gravity?: number;
    maxLength?: number;
    parabolaSpeed?: number;
    parabolic?: boolean;
    pickBlockerMeshes?: readonly Mesh[];
    rotateToDirection?: boolean;
    rotationAngle?: number;
    snapTurn?: boolean;
    thumbstickThreshold?: number;
}
Index
blockAllPickableMeshes?: boolean

Treat every pickable mesh that isn't floor as a blocker, so you can't teleport through or past solid geometry. Default false.

blockedColor?: readonly [number, number, number]

Arc tint while the aim is blocked. Default red [1, 0.25, 0.25] (Babylon blocked-ray red).

blockerPredicate?: (mesh: Mesh) => boolean

Predicate selecting blocker meshes (in addition to pickBlockerMeshes).

color?: readonly [number, number, number]

Reticle + arc tint while aiming at valid floor. Default Babylon teleport blue.

floorMeshes?: readonly Mesh[]

Meshes that count as teleportable floor. A ray only teleports when it lands on one of these. Mutually exclusive with floorPredicate.

floorPredicate?: (mesh: Mesh) => boolean

Predicate selecting teleportable floor meshes (alternative to floorMeshes). When neither is given, any surface whose world normal points roughly up is floor.

gravity?: number

Downward acceleration (m/s²) applied to the parabolic arc. Default 9.8.

maxLength?: number

Max horizontal reach of the aim arc in metres. Default 20.

parabolaSpeed?: number

Launch speed (m/s) of the parabolic arc — higher flattens it, lower curves it more. Only affects arc shape, not reach. Default 7.

parabolic?: boolean

Parabolic aim arc (curves down under gravity so you can aim up/down onto floors at other heights). Set false for a straight ray. Default true.

pickBlockerMeshes?: readonly Mesh[]

Meshes that BLOCK the teleport ray (e.g. walls): aiming so the arc lands on one shows the arc in blockedColor and refuses to teleport, even if the surface would otherwise read as floor. Explicit blockers win over the floor test. Combine with blockerPredicate / blockAllPickableMeshes.

rotateToDirection?: boolean

Let the stick's left/right lean set the heading you face after teleporting, previewed by a floor arrow. Default true.

rotationAngle?: number

Snap-turn step in radians. Default Math.PI / 4 (45°).

snapTurn?: boolean

Enable thumbstick left/right snap-turn (when not aiming). Default true.

thumbstickThreshold?: number

Thumbstick magnitude past which forward = aim and sideways = turn. Default 0.7.