Water, Bullet: buoyancy

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Water, Bullet: buoyancy

Post by slapin »

Hi, all!

Is there some bullet water buoyancy implementation I could use made for Bullet and Ogre?
My water is going to be btPairCachingGhostShape below water plane, and the vessel is btRigidBody. Distant vessels are not physical so they don't bother.
I drag my water with camera anyway keeping height at zero.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Water, Bullet: buoyancy

Post by sercero »

Did you look into the Bullet forums?

Urho3D has a buoyancy example and they use bullet if I'm not mistaken

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: Water, Bullet: buoyancy

Post by slapin »

Well, Bullet forums are fruitless on the subject, but I know the theory - I just need Ogre's (not Bullet's) AABB for the entity and current transformed UP vector (node->getRotation() * Ogre::Vector3::UNIT_Y), also I need actual position in 3D. This way I can calculate 4 points on the node on which I check water level using simplified sine formula I use in shader for a surface and time. Knowing water level at each of 4 points, the height of AABB we can calculate how much submerged that point is and upward force at that point. If the body is kinematic it can be just upward velocity/angular velocity.

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 250
Joined: Fri May 23, 2025 5:04 pm
x 16

Re: Water, Bullet: buoyancy

Post by slapin »

Urho is dead for a long time.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 535
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 198

Re: Water, Bullet: buoyancy

Post by sercero »

slapin wrote: Fri Jul 11, 2025 10:49 am

Urho is dead for a long time.

Sort of, you still have the rebel fork: https://github.com/rbfx/rbfx

Here is their example of buoyancy: https://github.com/Lumak/Urho3D-Buoyancy/tree/master