RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
990 stars 175 forks source link

Added water options to 'TopMenubar/Settings' menu. #3142

Open ohlidalp opened 3 months ago

ohlidalp commented 3 months ago

I tried to investigate #3137 but got nothing. So I at least analyzed the water code and added UI for tweaking HydraX water.

Both basic water with waves and HydraX water boil down to the same thing: a dynamic grid-mesh updated in code. The only major difference is how the waves are calculated: Basic uses configurable "wave trains", HydraX uses Perlin noise with adjustable params (via .hdx config file). Since both systems are in our codebase, it would make sense to unify them. To better understand how the system operates, I added the UI.

obrazek

ohlidalp commented 3 months ago

I got curious if I could change water type in-game by simply destroying the water subsystem and initing it again. Well, it works. obrazek Also waves are now toggleable there, that was already possible before just the UI was missing. Note the HydraX options only show up when HydraX is active.

ohlidalp commented 2 days ago

I've bumped this PR with one small fix. I couldn't fix the glitch but I got closer, see https://github.com/RigsOfRods/rigs-of-rods/issues/3137#issuecomment-2198713608