MovementComponent

MovementComponent

Holds the movement parameters of an entity.
Typically useful for anything which has a speed and/or
rotation.

Constructor

new MovementComponent()

Methods

addRotationVelocity(vec3)

Adds rotational velocity to movement. Typically useful for spinning or turning things.

Parameters:
Name Type Description
vec3 Vector3

rotational velocity impulse vector.

addVelocity(vec3)

Adds velocity to movement. Typically useful for things such as gravity and slingshots.

Parameters:
Name Type Description
vec3 Vector3

velocity impulse vector.

getRotationVelocity() → {Vector3}

Read the rotational velocity of movement

getVelocity() → {Vector3}

Reads the movement velocity vector

setRotationVelocity(vec3)

Sets rotational velocity of the movement.

Parameters:
Name Type Description
vec3 Vector3

rotational velocity vector.

setVelocity(vec3)

Adds velocity to movement. Typically useful for things such as gravity and slingshots.

Parameters:
Name Type Description
vec3 Vector3

velocity impulse vector.