C4 Engine
C4 Engine API Documentation

CharacterController::GetGroundContact

Defined in:  C4Character.h
Returns a contact with the ground.
Prototype

const CollisionContact *GetGroundContact(voidconst;

Description
The GetGroundContact function returns a pointer to a collision contact with the ground, if such a contact exists. Whether a character is in contact with the ground is determined by searching for any contact for which the dot product between the surface normal and the up direction is greater than the minimum ground cosine. The first contact found that satisfies this condition is returned. If no ground contact is found, then the return value is nullptr.

The minimum ground cosine can be changed using the CharacterController::SetGroundCosine function. The default value is 0.6875. The up direction is always (0,0,1) in world space.
See Also

CharacterController::GetGroundCosine

CharacterController::SetGroundCosine