NewtonConvexCollisionCalculateBuoyancyVolume
Contents
NewtonConvexCollisionCalculateBuoyancyAcceleration
void NewtonConvexCollisionCalculateBuoyancyAcceleration (const NewtonCollision* const convexCollision, const dFloat* const matrix, const dFloat* const shapeOrigin, const dFloat* const gravityVector, const dFloat* const fluidPlane, dFloat fluidDensity, dFloat fluidViscosity, dFloat* const accel, dFloat* const alpha)
Usage
Add buoyancy force and torque for bodies immersed in a fluid.
Parameters
- const NewtonCollision* const convexCollision
- const dFloat* const matrix
- const dFloat* const shapeOrigin
- const dFloat* const gravityVector
- const dFloat* const fluidPlane
- dFloat fluidDensity
- dFloat fluidViscosity
- dFloat* const accel
- dFloat* const alpha
Return
- (Procedure)
Description
- This function is only effective when called from *NewtonApplyForceAndTorque callback*
- This function adds buoyancy force and torque to a body when it is immersed in a fluid.
- The force is calculated according to Archimedes Buoyancy Principle. When the parameter *buoyancyPlane* is set to NULL, the body is considered
- to completely immersed in the fluid. This can be used to simulate boats and lighter than air vehicles etc..
- If *buoyancyPlane* return 0 buoyancy calculation for this collision primitive is ignored, this could be used to filter buoyancy calculation
- of compound collision geometry with different IDs.