ph_check_distance
Determines the 'depth' of physics collision detection.
Physics collision detection is performed at the end of every render frame. If
physics entities intersect other models or blocks, the physics system will try
to push these entities apart. Collision detection, however, is not continuous:
if a small, fast moving object is on one side of a wall and would be on the other
side of the wall at the end of the frame, this will not be detected by the collision
routines.
Some obvious work-arounds are: use larger objects, move them more slowly, and
increase the checking rate of the physics collision detection (see ph_fps_max_lock).
If these options are not feasible in your application, the engine alternativele
performs a c_trace from the previous entity origin point to its new origin
point. If an intersection is detected, the moving entity instead gets moved to
a position approximately in front of the penetrated wall or model.
Performing such traces for all physics entities can be time-consuming and is not
really necessary for slow-moving entities. Thus a speed/distance check is performed
first. If a physics entity has moved more than ph_check_distance quants
in the past physics frame, this additional trace test will be performed. If it
did not move that much, no special processing is done.
Lower values of ph_check_distance improve reliability of collision detection
but decrease performance. The optimum value depends on how fast your physics entities
are moving and how large they are. If your entity had a 5 quant radius and moving
at 250 quants/sec with a ph_fps_max_lock value of 100, the optimal value
for ph_check_distance is 2.5. Since, physics step size: 1/100= 0.01 secs
per step, velocity: 5 quants in 5/250 secs= 5 quants in 0.02 secs, thus with a
stepsize of 0.01 it will have travelled 5/2 = 2.5 quants.
Range:
0 .. 100 (default = 10)
Type:
var
Example:
ph_check_distance = 2.5;
See also:
Physics, ph_fps_max_lock