Arcade.Physics.Kinematics
Functions
One step of dt under acceleration a: the velocity first, then the position with the new velocity. Returns (position, velocity).
fnballistic_heightballistic_height(z : Float, vz : Float, g : Float, dt : Float) : (Float, Float) needs ()#
The same step on one axis under a pull of g toward minus: vz -. g *. dt, then z +. vz *. dt. Returns (height, vertical speed).
fnclamp_to_boundclamp_to_bound(x : Float, v : Float, bound : Float, restitution : Float) : Option((Float, Float)) needs ()#
fnintegrate_frictionintegrate_friction(p : Vec2, v : Vec2, pull : Vec2, decel : Float, dt : Float) : (Vec2, Vec2) needs ()#
One step of dt under pull, less a friction deceleration of decel against the direction of travel (none when the body is still). Returns (position, velocity).
v reflected off a surface with unit normal n, keeping restitution of the normal component: v - (1 + e) (v . n) n.