Where to implement hydrodynamics
Posted: Wed Mar 19, 2014 1:18 am
Hi,
I've successfully implemented a basic buoyancy / hydrodynamics prototype with bullet within the btActionInterface. However, I've noticed it experiences stability issues and also behaves in crazy ways when my objects are not heavy enough.
I'm aware of at least a few issues with this approach, and I was wondering if I am using bullet correctly. Here's what I'm doing inside of the btActionInterface I wrote:
1. Computing the drag / lift forces for each face and applying them in sequence as impulses.
2. Then, computing the buoyancy force as a function of the submerged volume and applying it as an impulse with applyImpulse at the center of the submerged mass.
I believe this is creating the following issues:
1. I'm applying impulses which are effecting the velocity of the body immediately. As a result, when I calculate the next point velocity for the next face it has already accounted for the impulses from the previous face which I don't want. Do I have to accumulate these myself before applying them or is there a way to use forces inside of btActionInterface instead of impulses so the velocity is not immediately effected?
2. For low mass objects with relatively high surface area, the impulses are much too high when I drop the objects from the air and they first touch the water. Presumably this is because they penetrate the water more than they should, and possibly also because I'm not capping the drag/lift appropriately?
I feel like I can keep working through these issues, but I feel like I'm working around bullet more than I should be. Is there a better way to model this in bullet than what i am doing?
Thanks,
Kris
I've successfully implemented a basic buoyancy / hydrodynamics prototype with bullet within the btActionInterface. However, I've noticed it experiences stability issues and also behaves in crazy ways when my objects are not heavy enough.
I'm aware of at least a few issues with this approach, and I was wondering if I am using bullet correctly. Here's what I'm doing inside of the btActionInterface I wrote:
1. Computing the drag / lift forces for each face and applying them in sequence as impulses.
2. Then, computing the buoyancy force as a function of the submerged volume and applying it as an impulse with applyImpulse at the center of the submerged mass.
I believe this is creating the following issues:
1. I'm applying impulses which are effecting the velocity of the body immediately. As a result, when I calculate the next point velocity for the next face it has already accounted for the impulses from the previous face which I don't want. Do I have to accumulate these myself before applying them or is there a way to use forces inside of btActionInterface instead of impulses so the velocity is not immediately effected?
2. For low mass objects with relatively high surface area, the impulses are much too high when I drop the objects from the air and they first touch the water. Presumably this is because they penetrate the water more than they should, and possibly also because I'm not capping the drag/lift appropriately?
I feel like I can keep working through these issues, but I feel like I'm working around bullet more than I should be. Is there a better way to model this in bullet than what i am doing?
Thanks,
Kris