Vehicles: ships, submarines, balloons
Skill ferret-physics-vehicles · download all skills · SKILL.md
When to use#
Anything that floats, dives, flies on gas, or is pushed by a screw or a sail.
The model#
A Vessel (VesselSpec) is one body with parts: hull (cells), tanks, compartments (flood through breach and doors), envelopes, thrusters, surfaces (rudders, foils, sails). Draft = mass / (ρ × waterplane area). stability() gives the metacentric height gm: positive rights itself, negative rolls over.
Steps#
- Size the hull so mass matches displacement; set
coglow. - Add
hullDampingandangularDamping,addedMass0.1–1. - Submarines:
fill/blowtanks; neutral fill =(displacement − dry mass) / tank capacity;crushDepth. - Drive by
vessel.thrust, rudders, sails (sailPolar). - Commands:
vessel.add|info|state|fill|thrust|breach|blow|surface.
Check afterwards#
Light and loaded drafts follow Archimedes; gm is positive; a breach floods the named compartment.
What usually goes wrong#
- Floats too high or low: mass and hull do not match.
- Rolls over:
gmnegative; lowercog, widen, empty part-filled tanks. - Never settles: no damping.
- Passes through the shore: light kernel or
body: false; use Havok. vessel.breachrefused: unknown compartment name.
Files#
reference/vehicles.md— A vessel is one body with parts: a hull that displaces water, ballast tanks, flooding compartments, gas envelopes, thrusters, rudders and sails. How to build one, drive it and read its stability.reference/api-physics-vehicles.md— every export of@ferret/physics-vehicleswith signature and doc commentreference/commands.md— 7 commands of these packages with their argumentsrecipes/water-and-boats.md— Six recipes: tanks that equalise, a U-tube of two liquids, a wave that slows on a beach, a boat that sinks deeper with cargo, a wing that stalls, a ball that curves.