C3DObject::ObjectCollided

Top  Previous  Next

Syntax:

 

ObjectCollided(C3DObject pTarget, int  bChildren), int

 

Purpose:

Checks for collisions between meshes.

 

Parameters:

pTarget - A C3DMesh object or derivatives.

bChildren - TRUE to test for collisions between any attached child objects and the target.

 

Returned value(s):

TRUE if this object has collided with the target object, FALSE otherwise.

 

Application:

mesh1.InitCollision()
mesh2.InitCollision()
...
if mesh1.ObjectCollided(mesh2,FALSE)
   HandleCollisions(mesh1,mesh2)
endif

 

Class Hierarchy

C3DObject

 

Additional Info:

For collision testing to work the InitCollision method must have been called on all objects involved in the test. This method is only valid for objects that contain validly loaded or created geometry, such as C3DMesh.

 

The base class method does nothing, unless bChildren is specified in which case all child objects that contain a mesh will be collision tested against the target object.

 

See Also:

InitCollision, RayCollided, SphereCollided, GetCollisionPoint