Callisto function reference  5.2
Collision detection

Data Structures

struct  SCALResult
 Structure to receive collision info. More...
 

Functions

int CAL_CheckGroupCollision (int group0, int group1, bool multiple, int *nrCols)
 
int CAL_CheckLineCollision (int groupID, CAL_scalar x0, CAL_scalar y0, CAL_scalar z0, CAL_scalar x1, CAL_scalar y1, CAL_scalar z1, bool multiple, int *nrCols)
 
int CAL_CheckPointCollision (int groupID, CAL_scalar x, CAL_scalar y, CAL_scalar z, bool multiple, int *nrCols)
 
int CAL_GetClosestPairs (int groupID0, int groupID1, int *nrPairs)
 
int CAL_GetPenetrationDepths (int groupID0, int groupID1, int *nrPairs)
 
int CAL_GetResults (void *userResults)
 

Detailed Description

Function Documentation

int CAL_CheckGroupCollision ( int  group0,
int  group1,
bool  multiple,
int *  nrCols 
)

Check whether two groups collide. Groups cannot be each others subgroups.

Parameters
group0The ID of the first group.
group1The ID of the second group.
multipleFlag whether to find all results, or just the first (faster).
*nrColsThe number of collisions.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CheckLineCollision ( int  groupID,
CAL_scalar  x0,
CAL_scalar  y0,
CAL_scalar  z0,
CAL_scalar  x1,
CAL_scalar  y1,
CAL_scalar  z1,
bool  multiple,
int *  nrCols 
)

Check whether a line collides with a group.

Parameters
groupIDThe group ID to check with.
x0The x coordinate of the first point to check.
y0The y coordinate of the first point to check.
z0The z coordinate of the first point to check.
x1The x coordinate of the second point to check.
y1The y coordinate of the second point to check.
z1The z coordinate of the second point to check.
multipleFlag whether to find all results, or just the first (faster).
*nrColsThe number of collisions.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_CheckPointCollision ( int  groupID,
CAL_scalar  x,
CAL_scalar  y,
CAL_scalar  z,
bool  multiple,
int *  nrCols 
)

Check whether a point collides with a group.

Parameters
groupIDThe group ID to check with.
xThe x coordinate of the point to check.
yThe y coordinate of the point to check.
zThe z coordinate of the point to check.
multipleFlag whether to find all results, or just the first (faster).
*nrColsThe number of collisions.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_GetClosestPairs ( int  groupID0,
int  groupID1,
int *  nrPairs 
)

Get the two positions where the distance between two groups is smallest.

Parameters
groupID0The ID of the first group.
groupID1The ID of the second group.
nrPairsThe number of results.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_GetPenetrationDepths ( int  groupID0,
int  groupID1,
int *  nrPairs 
)

Get the two positions where the penetration of two groups is largest.

Parameters
groupID0The ID of the first group.
groupID1The ID of the second group.
nrPairsThe number of results.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.
int CAL_GetResults ( void *  userResults)

Get the results of the objects involved in the last collision check/penetration depth/closest pair.

Parameters
userResultsA list of type SCALResult which contains the results. The client is reponsible of creating the list with the right size (size == count). The results for closest pairs and penetration depths are sorted on distance.
Returns
The function returns CAL_SUCCESS on success, and an errorcode on failure.