Jump to content
  • Advertisement
Sign in to follow this  
Mystery

Stick Colliding with a plane

This topic is 4887 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

I just realized there is a bug in my simulation. I did not handle the plane collision correctly. My current approach is simply to project those particles/points that have the z-component below the collision plane back to the plane. However this violates the stick constraint. Even if I do another relaxation on the sticks, it may cause the stick to penetrate the plane again. Anyone has any suggestion how should I resolve this in a quick and easy manner? The suggestion proposed in the article "Advanced Character Physics" looks rather complicated. :( Not sure if this is related to the problem that I had pointed out in my earlier thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=291135

Share this post


Link to post
Share on other sites
Advertisement
Come to think of it, I might be right afterall.

Here is what I did:

- Check that all the particles are above or on the plane. If it is not, project it back to the plane surface.
- Loop through all the sticks and apply the stick constraint.

Repeat the above 2 steps for a number of times. Personally I feel that some particles will still penetrate through the plane since it is the 2nd step.

Anyone care to comment?

Share this post


Link to post
Share on other sites
Yes, but that is the nature of that sort of iterative method, where you independently handle the constraints. The nice thing about the algorithm is that eventually it will tend to find a solution after a certain # of iterations.

For instance, if your two particles have the same mass, when you apply the stick constraint by making it longer again, each particle will move half the distance, making the offending particle less below the plane that it started off.

Also, it's not typically a requirement for the stick to never be below the plane for a frame, it can always continue to resolve it next physics frame.

This is what I like about this iterative projection approach. My old swept-sphere code relied on there never being a sphere inside of a triangle to start a physics frame, which was not possible to guarantee in all situations. By using projection to force it out of all triangle contacts, it doesn't have an invalid configuration issue.

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!