next up previous contents index
Next: Computing a distance Up: Collision detection Previous: Initialization

Detection of a collision

The most useful function to detect a collision is int p3d_col_test(void)  . This function checks the whole scene and returns the number of collisions. But the user may also want to check a specific pair. In this case, the function int p3d_col_test_pair(p3d _poly *obj1, p3d_poly *obj2)   must be called : it checks wether the pair (obj1,obj2) collides and returns True or False.

Once the collisions have been checked, some informations on the collisions that may have occured are available.

The function int p3d_col_number(void)   returns the number of collision that were detected by the collision checker. The function void p3d_col_get_report(int ind, p3d_poly *p1, p3d_poly *p2)   reports the collision number ind and the pair of polyhedrons that collided.



Nicola Simeon
Fri Oct 27 09:07:38 MET DST 2000