Repository navigation
Land vehicles in water: flooding over time, wading dynamic plants, lake-bed friction - #1542
Merged
Merged
Conversation
…ke-bed friction Fills the three gaps left after wading (#1348). Flooding over time (vehicle.h, wading_desc::flood_area, opt-in). With an area, the cabin and engine bay take the water in through openings at the chassis box's bottom at an orifice's rate, Q = C_d A sqrt(2 g dh), C_d 0.6. The box floats sealed in the field step and the water inside adds its weight at its centroid; out of the water it drains through the same openings. Each step is exact for the outside level at its start, so the level never overshoots. The water inside is state, saved only while there is any (bit 2 of the mode byte), so a vehicle that never holds water saves the bytes it always has. 0 (the default, and both presets) floods at once, as before. The world's vehicles (GB2 open item). Jolt fleets and Ariadne's Jolt vehicles use presets with wading on, so they waded already. The dynamic plants' chassis boxes do take the fluids' sealed-box push in the world, but each substep puts them back at the model's pose, so nothing floated them: they drove through water as on dry ground. dyn_bike_plant and dyn_4w_plant now wade from world::water_at at their tires (dyn_wading.h): drag in the model's drag term, grip lowered by the lifted load and soaked to the material's wet friction, aquaplaning, and the engine flooding past fording_depth (kept in their saves). A vehicle that waded in a tick is not `exact` in entity_plant. Lake beds (GB2 open item). water_deep's mu 0.10 stands for the water where no fluid covers the class; under a fluid the tire is on the bed. The water classes' mu_wet is now their bed's, soaked: water_shallow 0.45 (sand and gravel), water_deep 0.20 (mud). A wading tire runs to wet_friction whether it is below or above friction; physics::wet_friction (rain) never raises a class above its dry mu. scene_world.cpp, set_water and the nav rasters are unchanged. No pinned hash changes: with wading off, or on with no flood_area and no water-class ground, every vehicle saves and steps as before. Tests: PhysicsVehicle.AHardDooredHumveeFloodsOverSecondsAndDrainsOnTheWayOut, PhysicsVehicle.OnALakeBedItBrakesWithTheBedsWetFriction, Dyn4wPlant.DrivesIntoALakeAndWades, DynBikePlant.DrivesIntoALakeAndWades.
Conflict in docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md: master's boat-model paragraph (#1538's hull lift) with this branch's last sentence pointing land vehicles at the new wading section.
transfix
enabled auto-merge (squash)
November 26, 2026 07:01
This was referenced Nov 26, 2026
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
…lant.wading) (#1558) #1542 merged before #1548, so the bindings take its fields: - wading_desc.flood_area (and as_dict); vehicle_state water_inside and water_inside_mass; dyn_bike_plant.wading(i) / waded(i); WorldEntities' wading dict; - world_binding: a tuning.wading.flood_area knob (whether it is 0 stays fixed: set_vehicle refuses the change, so it is ignored) and the water_inside / water_inside_mass telemetry, with key metadata. test_pycvc_physics_water: a hard-doored Humvee (flood_area 0.1) in 0.7 m fills over seconds to the level outside (0.787 m^3 at 60 s), published by the binding; a dyn_bike_plant Humvee in 0.5 m wades (3738 N lifted).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fills the three gaps left after wading (#1348): water flooding a vehicle over time, the world's vehicles in water (GB2 open item), and lake-bed friction (GB2 open item). One of the "fill every water-physics gap" sessions; the ocean roadmap's new "As built (land vehicles in water)" block has the detail.
Flooding over time
wading_desc::flood_area(m², opt-in; 0 floods at once, as before).1 - displacement) take the water in through openings at the chassis box's bottom, at an orifice's rate: Q = C_d A sqrt(2 g dh), with C_d 0.6 and dh the water over the openings outside less the water inside.PhysicsVehicle.AHardDooredHumveeFloodsOverSecondsAndDrainsOnTheWayOut: a Humvee with 0.1 m² of openings, put into 0.7 m of water.A save taken while it drains restores and replays to the same hash. The ledger's residual is 223 J of 372 kJ.
The world's vehicles
GB2 asked whether the
dynamic/dynamic4wchassis boxes get sealed-box buoyancy. I checked:joltfleets and Ariadne's Jolt vehicles use presets with wading on, so they waded already.dyn_bike_plantanddyn_4w_plantnow wade (dyn_wading.h), fromworld::water_atat each tire:fording_depththe engine floods: no drive, the brakes still work. The flag is kept indyn_4w_saved/dyn_bike_saved.A vehicle that waded in a tick is not
exactinentity_plant, because the twin replays no water.Dyn4wPlant.DrivesIntoALakeAndWadesandDynBikePlant.DrivesIntoALakeAndWadesdrive a Humvee into 0.5 m of water, then 1.2 m:Lake beds
water_deepground keeps mu 0.10 under a data node'swater_level:water. That value stands for the water itself where no fluid covers the class. Under a fluid the tire stands on the bed, and wading handles the water's own effects.mu_wetis now their bed's, soaked:water_shallow0.45 (sand and gravel) andwater_deep0.20 (mud). Håkanson and Jansson, Principles of Lake Sedimentology, 1983. Dry mu is unchanged.wet_frictionwhether it is below or abovefriction.physics::wet_friction(the rain's) never raises a class above its dry mu.scene_world.cpp,world_nodes.cpp,set_wateror the nav rasters. I told the terrain generator session on the bus.PhysicsVehicle.OnALakeBedItBrakesWithTheBedsWetFriction: braking from 4 m/s onwater_deepunder 0.5 m of water, the tires use mu 0.196 and the vehicle decelerates at 2.66 m/s², the same as on a 0.20 ground under the same water. With no water over the class, the tires use 0.100 and it decelerates at 1.43 m/s².Hashes
No pinned hash changed. With wading off, or on with no
flood_areaand no water-class ground, every vehicle saves and steps as before.Testing
Each new test fails with its change switched off.
flood_area0 and with master's grip rule and table: the flooding test then finds no water inside at any time (tires at 19.6 kN from the start), and the lake-bed test finds mu 0.099 and 1.45 m/s².Local results (Windows, MSVC Release, cvcGL off): physics_vehicle_test 37/37, physics_dyn_4w_plant_test 9/9, physics_dyn_bike_plant_test 12/12, physics_world_test 47/47, every other physics_* suite, the ocean_* suites, world_surface/geometry/generated, nav_world_grid/planes, nav_plant_test 23/23 and ariadne_scene_world_test 145/145 (both without the Convergence/Stress/Benchmark suites, as CI's main run). physics_replay_test: all 1240 steps match the trace. clang-cl syntax-checks every changed source. git-clang-format is clean on the changed lines
Not run: cvcGL suites, Linux, macOS, wasm (CI).
Not done
world_binding: the bindings session has them.