โ† All examples

godot components

Probe buoyancy and water drag for RigidBody3D

Float a RigidBody3D on water from probe points: depth-proportional upward force per probe, travelling sine waves for the surface height, water drag and signals for entering and leaving the water.

What this component contains

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • buoyancy_probes_3d.gd
  • component.json
  • inspect_gdscript.py
  • run_tests.gd
  • test_package.py
  • tests/test_buoyancy_probes_3d.gd
  • verification/native.json

How it works

Class
BaltorBuoyancy3D, extends Node
Methods
wave_height_at(point: Vector2, time: float, base_height: float, wave_list: PackedVector4Array) -> float; surface_height(world_position: Vector3) -> float; probe_force(depth: float, mass_share: float) -> float; get_submerged_ratio() -> float; get_time() -> float; apply_forces(body: RigidBody3D, delta: float) -> void
Signals
entered_water, left_water
Exports
water_height, waves, probes, probe_depth, buoyancy, gravity, water_drag, water_angular_drag
Placement
res://baltor/godot_components/buoyancy_probes_3d/

Recorded checks

godot 4.7.2.stable.official.ed1daf0bf

  • godot_parse_check_only
  • godot_gdscript_tests
  • godot_tests_reject_gutted_component
  • godot_editor_import
  • godot_contract_reflection
  • godot_readme_usage_compiles

Limits to consider

Not a fluid simulation: probes ignore hull shape and displaced volume, and waves are sums of sines without Gerstner sideways motion. Light default drag lets bodies bob for a while. The surface function must match any water shader you pair it with. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.