Skip to content

Boats: the patrol boat on its own baked hull, drawn as its model - #1346

Merged
transfix merged 1 commit into
masterfrom
feat/tactical-boat
Nov 18, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/tactical-boat

Conversation

@transfix

Copy link
Copy Markdown
Owner

The owner's patrol boat (the vehicle-tactical-boat package, cy-pca/graphics-assets#19) as a boat preset that floats on its own hull, drawn on the boat node.

The hull, baked from the model.

  • loft_hull(stations) (new, hull.h/hull.cpp) builds a closed, outward-wound hull_mesh through stations. Each station is a half-section from keel to sheer, mirrored to port and closed across the sheer, with the end stations capped.
  • tools/boat_hulls/bake_loft.py (standard library only) fits a .glb as fit_vehicle_geometry does and slices it. It writes the C++ table and prints the hull's size and draft. Its README covers re-baking and adding a new boat.
  • The tactical hull: 16 stations of 8 points, giving 242 vertices and 480 triangles. It is 6.85 m long and 2.33 m in beam (7.8 m overall with the outboards, a new dyn_boat_desc::length_overall). Its collision shape is the hull's convex hull.
  • At 2800 kg it floats 0.488 m over its keel, about at its chine. A box of the model's size floated 0.16 m over it, with the V barely in the water and the stern clear of it.
  • The physics doesn't depend on the asset: the stations are fixed in code, so the boat floats the same with or without the package installed.

Steering and grip.

  • The outboards are one thrust: 8 kN ahead, 3.5 kN astern, none past 18 m/s, swinging 0.5 rad. They steer by thrust alone.
  • The hull's triangles push back on sideways flow by its normal component squared, which a 20° V bottom barely has. On the loft alone the boat skidded (16° of drift at half lock) and at full lock spun on the spot (0.57 m radius).
  • The preset's rudder slot is therefore the hull's keel, chines and strakes: one fixed 0.4 m² foil (max_angle 0) on the keel at x −0.8, just aft of the centre of mass. Its area and place were found by measuring:
    • further forward (−0.4, 0), it still spins;
    • further aft or larger, it turns no tighter than 45–250 m.
  • At −0.8 it is stable at every throttle tried. At full lock: 21 m at 4.5 m/s, 26 m at 6.7 m/s, 32 m at 9.2 m/s, with 8–11° of drift.
  • A lift term on the hull's own triangles (an opt-in hull_mesh coefficient) would give a V hull its grip without the foil. Not written.
  • Measured (PresetsDoWhatTheySay): top speed 10.5169 m/s; full lock 9.230 m/s at 0.2840 rad/s, a 32.50 m radius. So max_speed is 10.5 and turn_radius 32.5.

The water's cut-out.

  • hull_waterline_box(hull, z) (new) is the largest box on the centre line inside a hull's outline at a waterline.
  • BoatRuntime::cutout() takes it at the boat's fresh-water waterline. The water node keeps out of it (offset along the hull) for boat nodes, and, through a per-archetype cache, for boat world vehicles. It is no longer the hull's bounding box.
  • A box hull's cut-out is its own box, so the launch and jonboat are unchanged (their uniform checks pass at 1e-6).
  • The tactical hull's box is 4.85 × 1.74 m, centred 0.63 m aft. The bounding box's square bow and full beam showed as a light hole in the water around a V hull.

Model fitting.

  • fitted()'s frame is now a public fit_vehicle_geometry(geometry, length, vehicle_fit_axes) in vehicle_view.h.
  • Up axis: the one a file stands on. Its least coordinate is 0 there, and on the other two it reaches past a tenth of its extent each way. Otherwise the shortest extent, as before.
  • The boat's GLB is Y-up, with its beam narrower than its height, so the old rule laid it on its side. Humvee.glb fits exactly as before.
  • make_vehicle_model_cache() and attach_vehicle_model() are added byte for byte as in Clients draw a room entity's model; the tactical boat's model is its default look #1343, so either merge order is clean.

The boat node's model:.

  • A file, or a name found where the vehicle models are (.glb is tried after a bare name); none draws the hull.
  • The model is fitted to length_overall about the hull body's origin, with its keel on the hull's keel. The loft is baked in the model's own fitted frame, so the two line up with no offset.
  • The tactical preset defaults to TacticalBoat, and quietly draws its hull (the loft) when the package isn't installed. A model: that isn't found warns.

terrain_lab. The lake's boat (node launch, Settings > Launch) is now preset: tactical.

Docs:

  • ARIADNE.md "Boats";
  • PHYSICS_API.md (hull.h's new functions, the preset and its measurements);
  • OCEAN-AND-WEATHER-ROADMAP.md D5/D6 as built, including the note that land vehicles are not lofted: a chassis floats as if sealed, and wading is a follow-up;
  • tools/boat_hulls/README.md.

Tests (Windows MSVC Release):

  • physics_hull_test:
    • a loft of rectangles is its box: closed, wound outward, volume and waterline box exact;
    • a V hull's waterline box lies inside it;
    • bad stations are refused.
  • physics_dyn_boat_plant_test:
    • TheTacticalBoatIsItsModelsHull (vertex and triangle counts, size, a 0.488 m draft, the cut-out inside the hull);
    • the three presets do what they say.
  • cvcgl_ariadne_physics:
    • test_fit_vehicle_geometry, synthetic, in CI;
    • test_boat_models_drawn: an OBJ model: is drawn fitted to length_overall on the hull's keel, the water uses BoatRuntime::cutout, a missing model warns, and the tactical boat draws its model or its hull;
    • test_installed_vehicle_models_fit, which skips without the files.
  • ariadne_scene_world_test (terrain_lab's tactical boat reaches its goal by nav), physics_boat_test and cvcgl_ariadne_realize pass.
  • A native terrain_lab snapshot with the package installed shows the boat drawn upright at its new draft, with no hole in the water.

- physics: loft_hull() builds a closed hull through stations (each a
  half-section from keel to sheer); hull_waterline_box() is the largest
  box inside a hull at a waterline. tools/boat_hulls/bake_loft.py bakes a
  .glb's hull into stations.
- dyn_boat_desc::tactical(): the vehicle-tactical-boat package's
  TacticalBoat baked into 16 stations (480 triangles), 2800 kg, floating
  0.49 m over its keel; its outboards steer by thrust, and a fixed 0.4 m^2
  foil gives the V hull its grip sideways. 10.5 m/s, 32.5 m at full lock;
  length_overall 7.8 m.
- BoatRuntime::cutout(): the water keeps out of the box inside each boat's
  hull at its waterline (a boat world vehicle's too), not its bounding box.
- cvcGL: fit_vehicle_geometry() public, its up axis the one a file stands
  on, so a Y-up file stands up; make_vehicle_model_cache() and
  attach_vehicle_model(); the boat node's model: prop, the tactical preset
  drawing TacticalBoat when it is installed.
- terrain_lab's lake boat is the tactical preset.
- Docs and tests.
@transfix
transfix merged commit 36a3c18 into master Nov 18, 2026
29 checks passed
@transfix
transfix deleted the feat/tactical-boat branch November 18, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant