physics.applyForce

Section: Physics 3D

What it does

physics.applyForce applies Force on a physics object. It takes an options object.

Signature

physics.applyForce({x, y, z})

Arguments

  • {x, y, z}

    Keys:xyz

Example · generated

function update(dt) {  physics.applyForce({ x: 0, y: 2, z: 0 });}

physics.applyForce is called with values of the shape its signature asks for. The code sits in update(dt), which the engine calls every frame: dt is the time since the last one, in seconds.

9 members in physics