cd_vcollide.h File Reference

Detailed Description

Headers of the C interface for the vcollide collision detection engine.

See Also
cd_vcollide.cpp

Definition in file cd_vcollide.h.

Typedefs

typedef void Tvcollide
 The Vcollide object. More...
 

Functions

TvcollideInitVcollide ()
 Initializes a Vcollide object. More...
 
unsigned int AddPolyhedron2Vcollide (double **v, unsigned int nf, unsigned int *nvf, unsigned int **fv, Tvcollide *vc)
 Adds a polyhedron to the vcollide object. More...
 
void ActivateCollisionsVcollide (unsigned int o1, unsigned int o2, Tvcollide *vc)
 Activates the collision between a pair of objects. More...
 
void DeactivateCollisionsVcollide (unsigned int o1, unsigned int o2, Tvcollide *vc)
 Deactivates the collisions between a pair of object. More...
 
void MoveVcollideObject (unsigned int o, THTransform *t, Tvcollide *vc)
 Moves a given v-collide object. More...
 
boolean VcollideTest (Tvcollide *vc)
 Test for collision. More...
 
void DeleteVcollideObject (unsigned int o, Tvcollide *vc)
 Deletes a given vcollide object. More...
 
void DeleteVcollide (Tvcollide *vc)
 Deletes a vcollide object. More...
 

Typedef Documentation

typedef void Tvcollide

The vcollide object.

Definition at line 33 of file cd_vcollide.h.

Function Documentation

Tvcollide* InitVcollide ( )

Initializes a Vcollide object.

Returns
The initialized object.

Definition at line 21 of file cd_vcollide.cpp.

Referenced by InitVcollideCD().

unsigned int AddPolyhedron2Vcollide ( double **  v,
unsigned int  nf,
unsigned int *  nvf,
unsigned int **  fv,
Tvcollide vc 
)

Adds a polyhedron to the vcollide system. Note that vcollide only accepts triangulated geometry. So spsheres and cylinders need to be triangulated to send them to vcollide. This implies a reduction in the accuracy of the collision detection. Moreover, non-triangular faces of the polyhedron must be triangulated.

Parameters
vThe vertexes of the polyhedron.
nfNumber of faces.
nvfNumber of vertices per face.
fvThe indexes of the vertexes forming each face.
vcThe vcollide object to modify.
Returns
The identifier assigned to the new object.

Definition at line 30 of file cd_vcollide.cpp.

References Error().

Referenced by InitVcollideCD().

void ActivateCollisionsVcollide ( unsigned int  o1,
unsigned int  o2,
Tvcollide vc 
)

Activates the collision between a pair of objects.

Parameters
o1The identifier of the first object (as returned by AddPolyhedron2Vcollide).
o2The identifier of the second object (as returned by AddPolyhedron2Vcollide).
vcThe vcollide object to modify.

Definition at line 60 of file cd_vcollide.cpp.

Referenced by InitVcollideCD().

void DeactivateCollisionsVcollide ( unsigned int  o1,
unsigned int  o2,
Tvcollide vc 
)

Deactivates the collision between a pair of objects.

Parameters
o1The identifier of the first object (as returned by AddPolyhedron2Vcollide).
o2The identifier of the second object (as returned by AddPolyhedron2Vcollide).
vcThe vcollide object to modify.

Definition at line 69 of file cd_vcollide.cpp.

Referenced by InitVcollideCD().

void MoveVcollideObject ( unsigned int  o,
THTransform t,
Tvcollide vc 
)

Moves a vcollide object.

Parameters
oThe identifier of the object (as returned by AddPolyhedron2Vcollide).
tThe transform encoding the object motion.
vcThe vcollide object to modify.

Definition at line 78 of file cd_vcollide.cpp.

Referenced by CheckCollisionVcollide().

boolean VcollideTest ( Tvcollide vc)

Test for collision.

Parameters
vcThe vcollide object to use in the test.
Returns
TRUE if there is a collision.

Definition at line 87 of file cd_vcollide.cpp.

References FALSE, and TRUE.

Referenced by CheckCollisionVcollide().

void DeleteVcollideObject ( unsigned int  o,
Tvcollide vc 
)

Deletes a given vcollide object.

Parameters
oThe identifier of the object (as returned by AddPolyhedron2Vcollide).
vcThe vcollide object to modify.

Definition at line 102 of file cd_vcollide.cpp.

Referenced by DeleteVcollideCD().

void DeleteVcollide ( Tvcollide vc)

Deletes a vcollide object.

Parameters
vcThe vcollide object to delete.

Definition at line 111 of file cd_vcollide.cpp.

Referenced by DeleteVcollideCD().