# Stick Colliding with a plane

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

## 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 on other sites
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 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.

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 21
• 10
• 33
• ### Forum Statistics

• Total Topics
633438
• Total Posts
3011882
• ### Who's Online (See full list)

There are no registered users currently online

×