public struct BuoyancyBodyWhat a scene says about a floating body: its pontoons, and how they float.
Remarks
[35 § D10](../../docs/plan/35-water.md#d10-buoyancy-is-pontoons-over-jolt-evaluated-at-the-fixed-steps-water-time), the world-facing half. The arithmetic is Buoyancy's and is tested against an analytic rest displacement; what this adds is an entity, a rigid body and a fixed step.
⚠ The pontoons are a displacement volume and not the collision shape. A barge is four large spheres and a canoe is six small ones along its keel; matching them to the hull mesh is how a boat ends up floating a hand's width too high, and matching them to the collider is how it ends up floating on its bounding box.
⚠ An array makes this a managed component, on WaterBodyComponent's terms: its values live in the world's store and the chunk holds handles, so BuoyancySystem reads it an entity at a time. A fixed inline list would be a cap on how many pontoons a hull may have, chosen here, for every game.
⚠ A body with no pontoons floats nowhere and is not an error. It is what an entity part-way through being authored looks like, and it costs one length check per step.
Fields and properties (8)
public BuoyancyPontoon[] PontoonsThe spheres, in the body's own frame.
public float CoefficientA multiplier on the displaced weight. One is Archimedes.
public float DampingFirst-order damping on the submerged part's velocity, per second.
public float QuadraticDampingSecond-order damping, which is what gives a boat a top speed.
public float MaximumForceThe most upward force one pontoon may produce, in newtons. Zero for no limit.
public float FlowDragHow hard a current drags a submerged pontoon along with it, per second.
public static BuoyancyBody DefaultA crate: Archimedes exactly, damped enough to settle in a couple of seconds.
public readonly BuoyancySettings SettingsThis component as the kernel's own description.
Methods (2)
public static BuoyancyBody Sphere(float radius)A single sphere of a radius, which is what a crate or a barrel is.
public static BuoyancyBody Raft(float halfLength, float halfWidth, float radius, float height = 0)Four pontoons at the corners of a hull, which is what a raft is.
Used by (11)
- BuoyancyDebugDrawVixen.Water.Physics
- BuoyancyDebugDrawTestsVixen.Water.Physics.Tests
- BuoyancySystemVixen.Water.Physics
- BuoyancySystemTestsVixen.Water.Physics.Tests
- ComponentRegistrationVixen.Water.Physics
- TypeRegistrationVixen.Water.Physics
- Vixen_Water_Physics_BuoyancyBodySerializerVixen.Water.Physics
- EditorApplicationVixen.Editor.App
- MaterialIconsVixen.Editor.App
- SceneWaterComponentTestsVixen.Editor.Assets.Tests
- WaterSceneRunsTestsVixen.Editor.Assets.Tests