Vixen
c7401864
csharp
public readonly record struct BuoyancyPontoon

One sphere of a floating body, in the body's own frame.

Read the guide page for this →

Remarks

A volumetric approximation cheap enough to run on every crate in a river — [35 § D10](../../docs/plan/35-water.md#d10-buoyancy-is-pontoons-over-jolt-evaluated-at-the-fixed-steps-water-time), and it is the reference's model because it is the right one. Three or four spheres tell a solver everything it needs about how a hull sits: where it floats, how it pitches when somebody stands at the bow, and how it rights itself.

⚠ The radius is the whole of the shape and it is not the collision shape. A pontoon is a displacement volume, not a collider — a barge is four large spheres and a canoe is six small ones along its keel, and matching them to the hull mesh is how a boat ends up floating a hand's width too high.

⚠ [DataContract], because without it BuoyancyBody is a scene component whose only load-bearing field cannot be written in a file. That component is declared to SceneComponentRegistry and every one of its scalars round-trips; its Pontoons array does not, and a body with no pontoons floats nowhere and is not an error — so an authored boat loaded, looked complete in the inspector, and sank. Nothing reported it, because the only thing that could have was a scene naming a pontoon and there was not one in the tree. SplinePoint's reason exactly, one list over.

Fields and properties (3)

  • public Vector3 Offset

    Where its centre sits relative to the body's origin.

  • public float Radius

    How big it is, in metres.

  • public float Volume

    How much water it displaces when it is entirely under the surface, in m³.

Methods (1)

  • public BuoyancyPontoon(Vector3 Offset, float Radius)

    One sphere of a floating body, in the body's own frame.

Used by (8)

  • BuoyancyVixen.Water
  • BuoyancyBodyVixen.Water.Physics
  • BuoyancyDebugDrawVixen.Water.Physics
  • BuoyancySystemTestsVixen.Water.Physics.Tests
  • BuoyancyTestsVixen.Water.Tests
  • TypeRegistrationVixen.Water.Physics
  • Vixen_Water_BuoyancyPontoonSerializerVixen.Water
  • Vixen_Water_Physics_BuoyancyBodySerializerVixen.Water.Physics