QuakeServer.Physics.Walk (quake_server v0.1.0)

Copy Markdown View Source

FTE's walking movement (sv_phys.c), for walking entities other than players that move themselves: gravity (WPhys_AddGravity), the water check (WPhys_CheckWater), getting out of the world when stuck (WPhys_CheckStuck), and the walk itself with stepping up and down stairs (WPhys_WalkMove), slowed against walls it faces (WPhys_WallFriction).

server = QuakeServer.Physics.Walk.move(server, entity)

Steps are QuakeServer.Physics.step_size/1 high; gravity runs along -z.

Summary

Functions

Add a frame of gravity to entity's velocity, scaled by its gravity field (0.5 for a bouncing missile with none).

Leave entity where it is when it is not stuck, remembering the spot in oldorigin; otherwise move it back there, or failing that to the first free spot up to a step above and a unit to each side.

Set entity's waterlevel (0 to 3) and watertype from the contents at its feet, middle and eyes, brush entities included, and its pmove_flags ladder bit from the contents its box is in; {server, waterlevel > 1}.

Walk entity along its velocity for the frame, stepping up and down stairs.

Functions

add_gravity(server, entity)

Add a frame of gravity to entity's velocity, scaled by its gravity field (0.5 for a bouncing missile with none).

check_stuck(server, entity)

Leave entity where it is when it is not stuck, remembering the spot in oldorigin; otherwise move it back there, or failing that to the first free spot up to a step above and a unit to each side.

check_water(server, entity)

Set entity's waterlevel (0 to 3) and watertype from the contents at its feet, middle and eyes, brush entities included, and its pmove_flags ladder bit from the contents its box is in; {server, waterlevel > 1}.

move(server, entity)

Walk entity along its velocity for the frame, stepping up and down stairs.