C4 Engine
C4 Engine API Documentation

RigidBodyContact::GetWorldContactPosition

Defined in:  C4Contacts.h
Returns the world-space contact position and normal vector.
Prototype

void GetWorldContactPosition(const RigidBodyController *rigidBody, Point3D *position, Bivector3D *normal) const;

Parameters
rigidBody One of the rigid bodies involved in the contact.
position A pointer to a location that receives the world-space position.
normal A pointer to a location that receives the world-space normal bivector.
Description
The GetWorldContactPosition function returns the world-space position and normal vector corresponding to one of the two rigid bodies involved in a rigid body contact. The rigidBody parameter must be a pointer to one of the rigid bodies connected in the contact graph by the RigidBodyContact object for which this function is called. It would ordinarily be set to either a pointer to the object for which the RigidBodyController::HandleNewRigidBodyContact function has been called or to the contactBody parameter passed to the RigidBodyController::HandleNewRigidBodyContact function.

The position parameter should specify a location to which the world-space contact position is written. This position represents the point on the surface of the other rigid body that is closest to the deepest penetration between the two rigid bodies.

The normal parameter should specify a location to which the world-space contact normal bivector is written. The normal bivector is always oriented so that its complement points outward with respect to the rigid body specified by the rigidBody parameter. (If the GetWorldContactPosition were to be called for both rigid bodies involved in the contact, the normals returned would be negatives of each other.)
See Also

RigidBodyController::HandleNewRigidBodyContact