Buoyancy and ApplyForce

Post Reply
Reload
Posts: 2
Joined: Wed Aug 01, 2012 12:29 pm

Buoyancy and ApplyForce

Post by Reload »

Hi,

I'm trying to implement buoyancy using Bullet.
As others have done before me, I attach some 'floaters' (just spheres atm) to a rigid body and compute the submerged volume of those floaters to apply an Archimedes' force on the rigid body at the floaters' positions.

I use ApplyForce to do that, and the resulting force direction seems ok, but the resulting torque does not.
My object (a flat box, raft-like, with one floater in each corner) keep on turning (around an axis parallel to the water plane) faster and faster... :-(

So basically, my first question is :
Is the rel_pos parameter of the ApplyForce function supposed to be expressed in the rigid body local transform or in world space?

As I stated before, the resulting force direction is ok, but it takes waaaaaay too long for this force to counter-act the gravity, so it results in a sinusoidal movement where the object drowns into the water then jumps out of it ad vitam...
I thought of adding a kind of linear (and maybe also angular) damping to the buoyant objects and wanted to know if it was a good idea or if better solutions existed.

Thanks in advance!
Laury
marios
Posts: 52
Joined: Mon Jul 19, 2010 3:11 am
Contact:

Re: Buoyancy and ApplyForce

Post by marios »

Is the rel_pos parameter of the ApplyForce function supposed to be expressed in the rigid body local transform or in world space?
it's local transform
I thought of adding a kind of linear (and maybe also angular) damping to the buoyant objects and wanted to know if it was a good idea or if better solutions existed.
damping works fine for me. I set linear and angular damping with value of 0.9f for objects in water otherwise 0.0f.
I have written about physical water some time ago on my blog, check it out (video with results included) http://szamq.wordpress.com/2012/02/11/water/
Reload
Posts: 2
Joined: Wed Aug 01, 2012 12:29 pm

Re: Buoyancy and ApplyForce

Post by Reload »

Hi,

Thanks for your answer!

I'll give a try to damping asap...

Congratulations for your game!
Post Reply