Jump to content
  • Advertisement
Sign in to follow this  
Electrikjam

Sphere-fluid collision resolution

This topic is 482 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 http://matthias-mueller-fischer.ch/talks/GDC2008.pdf, 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!