2
votes

I'm making a game and i want to have a water in it. Physically it is simulated just as a static shape sensor which is applying some forces to the bodies in it. But how can i simulate the surface of the water ? I want to be able for example to provide some waves, when some body falls in the water. Thanks

2

2 Answers

4
votes

You might want to have a look at Cem Yuksel's work on wave particles, as well as the references included in his paper. Or Google for "Shallow Water Equations". There have been several implementations for real-time use. There might also be a couple of useful links here.

0
votes

I'm not sure which language you are using, but you should probably use a physics engine like Box2D. It's written in C/C++, but has been ported to many different languages like Actionscript. You can set stuff like buoyancy, density, etc. to simulate the water and the objects falling into it.