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
Buoyancy and ApplyForce
Re: Buoyancy and ApplyForce
it's local transformIs the rel_pos parameter of the ApplyForce function supposed to be expressed in the rigid body local transform or in world space?
damping works fine for me. I set linear and angular damping with value of 0.9f for objects in water otherwise 0.0f.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.
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/
Re: Buoyancy and ApplyForce
Hi,
Thanks for your answer!
I'll give a try to damping asap...
Congratulations for your game!
Thanks for your answer!
I'll give a try to damping asap...
Congratulations for your game!