physics.raycast

Section: Physics 3D

What it does

physics.raycast acts on physics: it casts a ray. It takes origin, dir and maxDist. maxDist is optional.

Signature

physics.raycast(origin, dir, maxDist?)

Arguments

  • origin
  • dir
  • maxDistoptional

Example · generated

function update(dt) {  physics.raycast(1, 1);}

physics.raycast 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