GroundBoundMovementScript

GroundBoundMovementScript

A script for handling basic movement and jumping over a terrain.
The standard usage of this script will likely also need some input listener and camera handling.

Constructor

new GroundBoundMovementScript(properties)

Parameters:
Name Type Description
properties Object

Methods

applyForward(amount)

Request script to move along its forward axis. Becomes
backwards with negative amount.

Parameters:
Name Type Description
amount number

applyJump(amount)

Applies jump input.

Parameters:
Name Type Description
amount number

applyStrafe(amount)

Applies strafe amount for sideways input.

Parameters:
Name Type Description
amount number

applyTurn(amount)

Applies turn input for rotation around the y-axis.

Parameters:
Name Type Description
amount number

getTerrainSystem() → {WorldFittedTerrainScript}

Returns the terrain system.

setTerrainSystem(terrainScript)

Sets the terrain script. This class requires that the terrain system can provide
height and normal for a given position when applicable. Without a terrain system the
script will fallback to the worldFloor height. (Defaults to -Infinity).

Parameters:
Name Type Description
terrainScript WorldFittedTerrainScript