libmove3d  3.13.0
Classes | Typedefs | Functions | Variables
/home/slemaign/softs-local/BioMove3D-git/p3d/p3d_BB.c File Reference

Bounding box management. More...

#include "Util-pkg.h"
#include "P3d-pkg.h"

Classes

struct  BB_env
 Structure to store the data of each environment. More...

Typedefs

typedef struct BB_env p3d_BB_env
 Structure to store the data of each environment.

Functions

void p3d_BB_set_selection_method (p3d_BB_selection_type type)
p3d_BB_selection_type p3d_BB_get_selection_method (void)
void p3d_BB_set_computation_method (p3d_BB_compute_type type)
p3d_BB_compute_type p3d_BB_get_computation_method (void)
void p3d_BB_set_mode_close (void)
void p3d_BB_set_mode_large (void)
void p3d_BB_set_mode_col (void)
void p3d_BB_get_BB_poly1 (p3d_poly *p, double *x1, double *x2, double *y1, double *y2, double *z1, double *z2)
void p3d_BB_update_BB_obj1 (p3d_obj *obj, p3d_matrix4 mat)
void p3d_BB_init_BB0 ()
void p3d_BB_update_BB_obj2 (p3d_obj *obj, p3d_matrix4 mat)
void p3d_BB_update_BB_rob (p3d_rob *rob)
int p3d_BB_overlap_obj_obj (p3d_obj *obj1, p3d_obj *obj2)
int p3d_BB_overlap_rob_obj (p3d_rob *rob, p3d_obj *obj)
int p3d_BB_overlap_rob_rob (p3d_rob *rob1, p3d_rob *rob2)
double p3d_BB_obj_obj_extern_dist (p3d_obj *obj1, p3d_obj *obj2, double *dist_ut)
p3d_BB_handlep3d_BB_handle_create (void)
 Create a new handle for the current environment.
void p3d_BB_handle_destroy (p3d_BB_handle *handlePt)
 Destroy a handle for bounding box collisions.
void p3d_BB_clear (void)
 Clean all variables use for the management of bounding box collision handle.
void p3d_BB_set_cur_handle (p3d_BB_handle *handlePt)
 Select a new bounding box collision handle.
p3d_BB_handlep3d_BB_get_cur_handle (void)
 Get the current bounding box collision handle.
void p3d_BB_activate_pair (p3d_BB_handle *handlePt, p3d_obj *obj1, p3d_obj *obj2)
 This function activates the computation of distances between the two object's bounding boxes.
void p3d_BB_activate (p3d_obj *obst)
void p3d_BB_deactivate_pair (p3d_BB_handle *handlePt, p3d_obj *obj1, p3d_obj *obj2)
 This function deactivates the computation of distances between the two object's bounding boxes.
void p3d_BB_activate_env (p3d_BB_handle *handlePt, p3d_obj *obj)
 This function activates the computation of distances between one body and all the objects in the environment.
void p3d_BB_deactivate_env (p3d_BB_handle *handlePt, p3d_obj *obj)
 This function deactivates the computation of distances between one body and all the objects in the environment.
void p3d_BB_deactivate_all (p3d_BB_handle *handlePt)
 This function deactivates all the computation of distances for all robots.
void p3d_BB_handle_copy_into (p3d_BB_handle *src_handlePt, p3d_BB_handle *dest_handlePt)
 This function copy src_handlePt a bounding box collision handle into dest_handlePt.
p3d_BB_handlep3d_BB_handle_copy (p3d_BB_handle *src_handlePt)
 This function copy src_handlePt a bounding box collision handle.
void p3d_BB_handle_add_into (p3d_BB_handle *src_handlePt, p3d_BB_handle *dest_handlePt)
 Merge two bounding box collision handle (sum of collision tests)
void p3d_BB_handle_sub_into (p3d_BB_handle *src_handlePt, p3d_BB_handle *dest_handlePt)
 Merge two bounding box collision handle (substraction of collision tests)
void p3d_BB_start (void)
 Initialize collision pair to start a new environment.
void p3d_BB_stop (void)
 Release the memory for collision pair in all environment.
void p3d_BB_dist_robot (p3d_rob *robotPt, double *distances)
 This function compute the distances between the bounding boxes for the robot specified.

Variables

p3d_BB_update_BB_fct_type p3d_BB_update_BB_obj
p3d_BB_get_BB_poly_fct_type p3d_BB_get_BB_poly

Detailed Description

Bounding box management.

These functions defined the computation method of bounding box, and the selection of the objets to take into account for this computation.


Function Documentation

void p3d_BB_activate_env ( p3d_BB_handle handlePt,
p3d_obj obj 
)

This function activates the computation of distances between one body and all the objects in the environment.

Parameters:
handlePt,:The bounding box handle collision table.
obj,:The body.
Note:
If handlePt == ::NULL then use the current handle.
void p3d_BB_activate_pair ( p3d_BB_handle handlePt,
p3d_obj obj1,
p3d_obj obj2 
)

This function activates the computation of distances between the two object's bounding boxes.

Parameters:
handlePt,:The bounding box handle collision table.
obj1,:The first object.
obj2,:The second object.
Note:
Check if this pair already exist.
If handlePt == ::NULL then use the current handle.
void p3d_BB_deactivate_all ( p3d_BB_handle handlePt)

This function deactivates all the computation of distances for all robots.

Parameters:
handlePt,:The bounding box handle collision table.
Note:
If handlePt == ::NULL then use the current handle.
After this function the distances computed are HUGE_VAL.
void p3d_BB_deactivate_env ( p3d_BB_handle handlePt,
p3d_obj obj 
)

This function deactivates the computation of distances between one body and all the objects in the environment.

Parameters:
handlePt,:The bounding box handle collision table.
obj,:The body.
Note:
If handlePt == ::NULL then use the current handle.
void p3d_BB_deactivate_pair ( p3d_BB_handle handlePt,
p3d_obj obj1,
p3d_obj obj2 
)

This function deactivates the computation of distances between the two object's bounding boxes.

Parameters:
handlePt,:The bounding box handle collision table.
obj1,:The first object.
obj2,:The second object.
Note:
If handlePt == ::NULL then use the current handle.
void p3d_BB_dist_robot ( p3d_rob robotPt,
double *  distances 
)

This function compute the distances between the bounding boxes for the robot specified.

Parameters:
robotPt,:The robot
Return values:
distances,:The array of distances.
p3d_BB_handle* p3d_BB_get_cur_handle ( void  )

Get the current bounding box collision handle.

Returns:
The current bounding box collision handle table.
void p3d_BB_handle_add_into ( p3d_BB_handle src_handlePt,
p3d_BB_handle dest_handlePt 
)

Merge two bounding box collision handle (sum of collision tests)

Parameters:
src_handlePt,:The source bounding box collision handle.
dest_handlePt,:The bounding box collision handle that must store the sum.

It is like an "or" opperation between all pair.

Note:
If src_handlePt == ::NULL then use the current handle.
If dest_handlePt == ::NULL then use the current handle.
p3d_BB_handle* p3d_BB_handle_copy ( p3d_BB_handle src_handlePt)

This function copy src_handlePt a bounding box collision handle.

Parameters:
src_handlePt,:The bounding box collision handle that must be copied.
Returns:
The copy of the bounding box collision handle.
Note:
If src_handlePt == ::NULL then use the current handle.
void p3d_BB_handle_copy_into ( p3d_BB_handle src_handlePt,
p3d_BB_handle dest_handlePt 
)

This function copy src_handlePt a bounding box collision handle into dest_handlePt.

Parameters:
src_handlePt,:The bounding box collision handle that must be copied.
dest_handlePt,:The bounding box collision handle that must store the copy.
Note:
If src_handlePt == ::NULL then use the current handle.
If dest_handlePt == ::NULL then use the current handle.
p3d_BB_handle* p3d_BB_handle_create ( void  )

Create a new handle for the current environment.

Returns:
The new handle of collision (::NULL if there is an error).
Note:
No collision is activate.
void p3d_BB_handle_destroy ( p3d_BB_handle handlePt)

Destroy a handle for bounding box collisions.

Parameters:
Thehandle (::NULL to destroy the current handle).
Note:
This function cannot destroy the default environment. To do that use p3d_BB_clear().
void p3d_BB_handle_sub_into ( p3d_BB_handle src_handlePt,
p3d_BB_handle dest_handlePt 
)

Merge two bounding box collision handle (substraction of collision tests)

Parameters:
src_handlePt,:The source bounding box collision handle.
dest_handlePt,:The bounding box collision handle that must store the substraction.

It is like an "dest and not src" opperation between all pair.

Note:
If src_handlePt == ::NULL then use the current handle.
If dest_handlePt == ::NULL then use the current handle.
void p3d_BB_set_cur_handle ( p3d_BB_handle handlePt)

Select a new bounding box collision handle.

Parameters:
handlePt,:The bounding box collision handle table.
void p3d_BB_start ( void  )

Initialize collision pair to start a new environment.

This function must be used each time there is a new environment, or each time that the environment switches.

void p3d_BB_stop ( void  )

Release the memory for collision pair in all environment.

This function must be used at the end of the application to release the memory.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines