Floating objects


I have a question considering floating objects.

Goal: Have a boat floating on a water plane.

How do i get such a situation? I have one box as the water plane (static) and a cube as the "boat" (dynamic). Is it possible to get a floating effect where the cube floats on the surface instead of bouncing on it?

Another situation would be a swamp where a player gets stuck and eventually gets swallowed in the swamp.

Any ideas?

Thanks in advance!

Humm I don’t think the current physics system can handle dynamic fluids simulations :?

You’ll have to do it yourself (it’s a lot of maths I don’t know much) or wait for a future physics system release…

Too bad, i’m taking the challenge though. Expect some results soon :slight_smile:

Heh, i have plans for some that dont require alot of maths and stuff…perhaps we can talk about them over MSN see which ever one of our approaches is best?


Sure thing,

I would like to set this up as good as possible from the start, i’ll contact you when you come online asap.

ok, so these are my thoughts on this:


Adding a FluidObject to a FluidManager and thats it basically. FluidObject is an extended StaticPhysicsObject.

Behind the Scenes

Once any object comes into contact with a FluidObject, their contact is canclled. I.e the object is allowed to penetrate the fluidObject. However, because ode is made up of a collision library and a physics library, the collision library will keep sayin those two have collided. Once they are colliding, we add a force that is proportionate to the viscousity of the liquid in the opposite direction of movement of the dynamic object. Also with that force, add a force upwards so that the object floats. This is for directional forces.

For angular forces, add a torque in the opposite direction of the current torque that has a force proportionate to the viscousity of the liquid.

Is this ok with everyone?


The PhysicsParticleManager will be helpful in this situation.

Check the test out in CVS (PhysicsParticleManagerTest IIRC)


Sorry for digging out an old topic  8)

Has there been any result of your discussion. I am planning a projekt involving boats and water and stumbled over the wonderful jME Screenshots and Test (ProjectedGridWater etc). Now I am wondering how to have a good physic for this water and floating objetcs in it (actually ON it would suffice).

Any hints appreciated,