FTE's solid-body movement (sv_phys.c): sliding along what a box hits
(WPhys_FlyMove), moving a box at once (WPhys_PushEntity), the touches two entities
run when they meet (WPhys_Impact), and the velocity clip a surface gives
(ClipVelocity).
{server, blocked, step} = QuakeServer.Physics.Move.fly(server, entity, 0.05)
{server, trace} = QuakeServer.Physics.Move.push(server, entity, {0.0, 0.0, 18.0})Gravity runs along -z.
Summary
Functions
velocity slid along a surface of normal, overbounce times its push away; parts under 0.1 become 0.
Move entity along its velocity for seconds, sliding along up to four surfaces and
running the touches of what it hits (WPhys_FlyMove). Returns {server, blocked, step}: blocked has bit 1 for a floor, 2 for a wall, 4 for a dead stop (3 when
trapped, 7 caught between more than two planes); step is the trace of the last wall
hit, or nil.
Run the touches of entity and what trace hit, each that has one and is solid, with
the trace globals set from trace (WPhys_Impact); self and other are put back.
Move entity by push at once, relink it touching triggers, and run the touches of
what it hit (WPhys_PushEntity); its velocity is not changed. Returns {server, trace}.
Functions
@spec clip_velocity(Cauldron3D.Vec.t(), Cauldron3D.Vec.t(), number()) :: Cauldron3D.Vec.t()
velocity slid along a surface of normal, overbounce times its push away; parts under 0.1 become 0.
@spec fly(QuakeServer.Server.t(), non_neg_integer(), number()) :: {QuakeServer.Server.t(), integer(), map() | nil}
Move entity along its velocity for seconds, sliding along up to four surfaces and
running the touches of what it hits (WPhys_FlyMove). Returns {server, blocked, step}: blocked has bit 1 for a floor, 2 for a wall, 4 for a dead stop (3 when
trapped, 7 caught between more than two planes); step is the trace of the last wall
hit, or nil.
@spec impact(QuakeServer.Server.t(), non_neg_integer(), map()) :: QuakeServer.Server.t()
Run the touches of entity and what trace hit, each that has one and is solid, with
the trace globals set from trace (WPhys_Impact); self and other are put back.
@spec push(QuakeServer.Server.t(), non_neg_integer(), Cauldron3D.Vec.t()) :: {QuakeServer.Server.t(), map()}
Move entity by push at once, relink it touching triggers, and run the touches of
what it hit (WPhys_PushEntity); its velocity is not changed. Returns {server, trace}.