Advertisement Jump to content
Sign in to follow this  

Sphere-fluid collision resolution

This topic is 662 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

I have implemented a simple fluid simulator using height-fields in C++ based on this talk here, the actual equations for the fluid simulation is on page 14.


the fluid is abstracted to 2.5D as a large grid, so only height values of the fluid ever changes, at each iteration the velocity of each grid cell is calculated based on the heights of neighboring cells, this all works fine.


I am now trying to implement sphere collision with the fluid, and this is proving difficult, page 16 gives the basics but I'm not sure how to implement it, currently I can detect how much the sphere has been submerged at a given grid cell using trig, so I offset that grid cells velocity by the amount it is submerged, then apply a force against the fluid based on the equation given in the talk, however this leads to the sphere bouncing and makes the fluid very violent, it never settles on the surface, I think my problem lies in how to actually disperse the fluid displaced by the sphere, has anyone implemented anything similar or has any suggestions in reading for this topic? 

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!