how to make waves

Hi! Got b2BuoyancyController working.
How can I simulate waves if some object drop into water?
This is not an easy question to answer. I got a "good enough" implementation working in WCK. There's a demo here (should jump right to the wave demo):

http://www.sideroller.com/wck/?f=6

Basically the misc.Wave and misc.Waves classes are for simulating waves. Then a modified b2BuoyancyController is used to tweak the height of the water per fixture. For each fixture, it checks the Waves object for the height of the water and applies buoyancy based on that.
Thanks, but I'd like to do quite inverse thing.
I'd like the water to react (move) when object hits it.
@adq : They do. You just can't see it very well in that example because of the moving wave and the water level change.

@mayobutter : So if I take a few (or more) looks at those files I should be able to recreate the effect outside of WCK? Or is there something else to it?
Is there easy way to integrate it with Box2D?
Yes, these are the files you'll want to look at:

http://github.com/jesses/wck/raw/master ... yEffect.as -- Buoyancy algorithm is removed from the controller so that it can be applied per fixture. Need to do this to adjust the height per fixture.

http://github.com/jesses/wck/raw/master/misc/Waves.as -- Manages the height of the water (a collection of waves)

http://github.com/jesses/wck/raw/master/misc/Wave.as -- A single wave.

http://github.com/jesses/wck/raw/master/wck/Buoyancy.as -- This is the tricky part. This is a sensor that collects contacts with the buoyant region. For each contact, you'll have to get the height of the water from the misc.Waves object, translate that into Box2D / Buoyancy coordinates, then apply buoyancy with the water height specific to that fixture.
Thanks, I'll fiddle with that when I find time.
What is an idea with those classes? How they work together? How I can integrate them with working Box2DFlash code? I don't see class that inherits from b2Controller.

Original thread: https://box2d.org/forum/viewtopic.php?t=5729