ph_num_contacts

The total number of physics contacts of the last frame can be found in this variable. A contact is generated for every vertex of a physics shape intersecting another model or level block. PH_SPHEREs creates one contact point per collision, PH_BOXes up to 4, and PH_POLY an unlimited number of points. You should monitor this variable to see if an excessive number of contacts are being generated and consider calling phent_settype() with a simpler collision shape. The value of this variable is also useful for debugging vehicles to make sure that all wheels/tracks are touching the ground.

Range:

0 .. unlimited

Type:

var, read only

Example:

if (ph_num_contacts < 4) { print("ground contact lost!"); }	

See also:

Physics