libmove3d  3.13.0
Functions | Variables
/home/slemaign/softs-local/BioMove3D-git/collision/Kcd/kcd_dist.c File Reference

Functions concerning exact distance calculation. More...

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

Functions

void kcd_dist_init_list_aabb ()
void kcd_dist_set_min_dist (double d)
double kcd_dist_get_min_dist ()
void kcd_dist_init_min_dist ()
void kcd_dist_init_closest_points ()
void kcd_dist_get_closest_points (kcd_vector3 pointA, kcd_vector3 pointB)
void kcd_dist_set_closest_points (kcd_vector3 pointA, kcd_vector3 pointB)
void kcd_set_kcd_exact_epsilon (double value)
double kcd_get_kcd_exact_epsilon ()
int kcd_gjk_between_2_OBB (kcd_bb *obbox1, kcd_bb *obbox2, kcd_matrix4 *BwrtA, double *min_distance)
 exact distance between two OBB's, used for min_max filtering when testintg two OBB-trees
void kcd_min_dist_est_between_2_OBB (kcd_bb *obbox1, kcd_bb *obbox2, kcd_matrix4 BwrtA, double *min_distance)
 Minimum distance estimate between two OBB (underestimation)
void kcd_max_dist_est_between_2_OBB (kcd_bb *obbox1, kcd_bb *obbox2, kcd_matrix4 BwrtA, double *max_distance)
 Maximum distance estimate between two OBB (overestimation)
int kcd_dist_exact_between_2_obbtrees (kcd_bb *rob_box, kcd_matrix4 invM2, kcd_matrix4 mat2, kcd_matrix4 a_box_pos, kcd_bb *second_box, kcd_matrix4 *THISmat9, kcd_matrix4 *THISmat8, double *distance_estimate, int *nearest_obstacle, int which_trees)
 calculate the exact distance and the correponding closest points between the objects inside two given OBB-trees.
int kcd_visit_2_obbtrees (kcd_bb *rob_box, kcd_matrix4 invM2, kcd_matrix4 mat2, kcd_matrix4 a_box_pos, kcd_bb *second_box, kcd_matrix4 *THISmat9, kcd_matrix4 *THISmat8, double *distance_estimate, double *max_param, double *min_param)
int kcd_visit_obbtree_robot (kcd_bb *rob_box, kcd_matrix4 invM2, kcd_matrix4 mat3, kcd_bb *second_box, double *distance_estimate, double *max_param, double *min_param)
int kcd_visit_2_robot_obbtrees (kcd_bb *rob_box, kcd_matrix4 invM2, kcd_matrix4 mat2, kcd_matrix4 mat1, kcd_matrix4 thisM1, kcd_bb *second_box, kcd_matrix4 *THISmat8, kcd_matrix4 *THISmat9, double *distance_estimate, double *max_param, double *min_param)
int filter_min_max_OBB (kcd_bb *bb1, kcd_bb *bb2)
int filter_min_gjk_OBB (kcd_bb *obb, double min_gjk_dist)
int filter_min_gjk_OBB_with_eps (kcd_bb *obb, double min_gjk_dist)
int filter_min_max_OBB_2 (double max, double min)
int filter_min_gjk_OBB_2 (double min_obb, double min_gjk_dist)
double aabbs_maximum_distance (int b1_nr, int b2_nr)
double aabbs_maximum_square_distance (int b1_nr, int b2_nr)
int kcd_dist_mo_in_collision (int mobj_id, int bb_id_of_body, double *min_distance)
int kcd_dist_test_robot_vs_static_obbs (int mobj_id, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, int with_report, double *minimal_distance_estimate, int *nearest_obstacle, int current_bb_id)
int kcd_gjk_between_2_OBB_volume_boxes (kcd_bb *obbox1, kcd_bb *obbox2, kcd_matrix4 MOwrtSO, double *min_distance)
 exact distance between two OBB's and the corresponding closest points, this function is called to test two volume boxes against eachother
int kcd_gjk_between_2_robot_OBB_volume_boxes (kcd_bb *obbox1, kcd_bb *obbox2, kcd_matrix4 MO1wrtMO2, kcd_matrix4 MO2wrtW, double *min_distance)
 exact distance between two OBB's and the corresponding closest points, this function is called to test two volume boxes against eachother. This function is specificly for testing two OBB's around moving objects
void kcd_init_distance_exact ()
void kcd_clean_up_dist ()

Variables

double kcd_tolerance

Detailed Description

Functions concerning exact distance calculation.

This file contains a set of functions and static variables used to obtain the exact distances written by Pepijn Raeymaekers (KINEO) july 2001


Function Documentation

int kcd_dist_exact_between_2_obbtrees ( kcd_bb rob_box,
kcd_matrix4  invM2,
kcd_matrix4  mat2,
kcd_matrix4  a_box_pos,
kcd_bb second_box,
kcd_matrix4 *  THISmat9,
kcd_matrix4 *  THISmat8,
double *  distance_exact,
int *  nearest_obstacle,
int  which_trees 
)

calculate the exact distance and the correponding closest points between the objects inside two given OBB-trees.

Parameters:
*rob_boxpointer to the BB around a movable object
invM2information position wrt joint
mat2information concerning position of joint
a_box_poscould be second_box wrt W
*second_boxpointer to the BB, this migth be the BB around a static or a movable object
*THISmat9could be W wrt Rob_box
*THISmat8also a sort of second_box wrt W
*distance_exact
Returns:
The exact distances and the corresponding closest points will be written in the report
Note:
The placement matrices contain different information depending on the utilisation, the information inside could be what is written in the explication of the parameters
Todo:
remove the nearest_obstacle parameter
int kcd_gjk_between_2_OBB ( kcd_bb obbox1,
kcd_bb obbox2,
kcd_matrix4 *  BwrtA,
double *  min_distance 
)

exact distance between two OBB's, used for min_max filtering when testintg two OBB-trees

Parameters:
*obbox1pointers to OBB 1
*obbox2pointers to OBB 2
BwrtAB with respect to A (placement matrix)
Returns:
min_distance, exact distance between two OBB's
Note:
BwrtA is used together with AwrtA, we will retrieve the exact distance but the closest points will not be valid
int kcd_gjk_between_2_OBB_volume_boxes ( kcd_bb obbox1,
kcd_bb obbox2,
kcd_matrix4  MOwrtSO,
double *  min_distance 
)

exact distance between two OBB's and the corresponding closest points, this function is called to test two volume boxes against eachother

Parameters:
*obbox1pointer to OBB 1 (Movable object)
*obbox2pointer to OBB 2 (Static object)
MOwrtSOmovable object with respect to static object (placement matrix)
Returns:
min_distance, exact distance between two OBB's
Warning:
the placement matrix for the static object will be retrieved in the kcd_bb *obbox2
Note:
The closest points (in kcd_dist.c) will be filled in and will be valid, these are the points filled in the report afterwards
int kcd_gjk_between_2_robot_OBB_volume_boxes ( kcd_bb obbox1,
kcd_bb obbox2,
kcd_matrix4  MO1wrtMO2,
kcd_matrix4  MO2wrtW,
double *  min_distance 
)

exact distance between two OBB's and the corresponding closest points, this function is called to test two volume boxes against eachother. This function is specificly for testing two OBB's around moving objects

Parameters:
*obbox1pointer to OBB 1 (Movable object 1)
*obbox2pointer to OBB 2 (Movable object 2)
MO1wrtMO2movable object with respect to static object(placement matrix)
MO2wrtWmovable object wrt to Workspace(placement matrix)
Returns:
min_distance, exact distance between two OBB's
Note:
The closest points (in kcd_dist.c) will be filled in and will be valid, these are the points filled in the report afterwards
void kcd_max_dist_est_between_2_OBB ( kcd_bb obbox1,
kcd_bb obbox2,
kcd_matrix4  BwrtA,
double *  max_distance 
)

Maximum distance estimate between two OBB (overestimation)

Parameters:
*obboxpointers to the two OBB
BwrtAB with respect to A (placement matrix)
Returns:
max-distance, maximum distance estimate
Note:
used for min max filtering, this function is slightly modified to filter more efficient, the maximum distance is actually the distance between the two centers of the OBB
void kcd_min_dist_est_between_2_OBB ( kcd_bb obbox1,
kcd_bb obbox2,
kcd_matrix4  BwrtA,
double *  min_distance 
)

Minimum distance estimate between two OBB (underestimation)

Parameters:
*obboxpointers to the two OBB
BwrtAB with respect to A (placement matrix)
Returns:
minimum distance estimate ( >= 0 )
Note:
is a better minimum estimate then obb_overlap but not always. Migth be usefull for min_max filtering.
not used
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines