It is clear that a collision checker can not be started if a scene has not been described.
The function void p3d_col_init_coll(void) sets all the bolean indicating that the collision checkers have initialized to null. It must be called when the user wants to reinitialize all the collision checkers.
To start a collision checker, the user can choose among the three following functions :
Those three function will allocate and initialize all the variables needed for the chosen algorithm of collision detection.
If the user has chosen I-collide, he can then choose the kind of bounding box will be used for the polyhedrons. The function int p3d_switch_all_to_cube(void) sets the bounding boxes to cuboid bounding box, lined up on the axis, containing the polyhedrons for any orientation, whereas int p3d_switch_all_to_DBB(void) sets the bounding box to Dynamic Bounding Boxes, also lined up on the axis, changing of size everytime the polyhedrons change of orientation. The collision checker V-collide only use cuboid bounding boxes. Those bounding boxes are used in Move3D to cumpute the bounding boxes of the obstacles and robots.
Once the collision checkers have been initialized, the user must indicate the pairs of polyhedron, among all the possible pairs, that may collide. Three functions are vailable :
Of course, an active pair can also be deactivate. The three previous activation functions have their equivalent for deactivation : void p3d_col_deactivate_pair(p3d_poly *obj1,p3d_poly *obj2) , void p3d_col_deactivate_full(p3d_poly *obj) and void p3d_col_deactivate_all(void) .
It is clear that for a complex scene, the user could spend days listing those pairs. Some function are available in Move3D in order to simplify the activation of a whole scene. The idea is simple : in a scene, only the robots move. So the only pairs to activate are the pairs of one polyhedron of a robot with one polyhedron of an obstacle, the pairs of one polyhedron of a robot with one polyhedron of another robot, and the pairs of polyhedrons of the robot that do not belong to two adjacent bodies (so we can detect the auto-collisions). Those tree functionality are gathered in the function int p3d_col_activate_env(void) that activates all the useful pairs of the current environment.
If the user wants to change collision checker during a session, he firts has to stop the current one. The function void p3d_col_stop(void) stops the collision checker whose type has been stored as an integer in the global variable p3d_col_mode, and deletes all its datas. The function void p3d_col_stop_all(void) does the same, but for all collision checkers.
Once a collision checker and the active pairs of the environment have been initiallized, collisions can be detected at any time.