Buoyancy
Last updated
Last updated
Found in namespace:
We recommend using aliases to reduce typing and simplify names.
doing this you can fully qualify the name of this class as
This API is used to calculate the effective buoyancy force applied to a body given that bodies physics data and information about the environment its in.
Put more simply we can use this to make things float.
The main function of this API is to calculate the buoyancy effect. That is to tell us how much force is being applied counter to gravity. Note we don't need to know what direction that is only how strong the effect is we can then use that information along with other physics data to simulate a floating object.
Effect can be calculated in three ways
A simpler and generally more stable method for most use cases is:
The final method is the simplest but makes the most assumptions.
This expects you to provide it with the volume of the geometry submerged and the density of the environment the body is in.
Finds the volume of the provided mesh that is displacing the target surface volume.
This is the most complex method and pulls hull information from the provided to test each vertex point giving a reasonably accurate estimate on the submerged volume. You can use the submergedPoints returned and the ratio of the total submerged volume to distribute the applied force across the subject. This is the method used by the when in complex mode.