C4 Engine
C4 Engine API Documentation

RigidBodyController::CalculateSubmergedVolume

Defined in:  C4Physics.h
Calculates the submerged volume of a rigid body.
Prototype

float CalculateSubmergedVolume(const Plane3D& plane, Point3D *submergedCentroid) const;

Parameters
plane The planar boundary, in body-space coordinates.
submergedCentroid A pointer to the location where the submerged centroid is returned.
Description
The CalculateSubmergedVolume function determines what portion of a rigid body lies on the positive side of the plane specified by the plane parameter. For each shape composing the rigid body, the exact volume of the part lying on the positive side of the plane is calculated, and the results are summed to produce the return value for this function. The geometric centroid of the submerged volume of each shape is also calculated, and the volume-weighted sum of these centroids, in body-space coordinates, is returned through the submergedCentroid parameter.