Jump to content
  • Advertisement
Sign in to follow this  
Narf the Mouse

Contact/collision problem

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

Due to the following sequence of events, my physics system (boxes only) is unstable - I'm looking for solutions:

1) A box does not drop flat onto a side (ie., its angular rotation (I use matrix rotation, this is for reference) is not a multiple of 90 degrees).

2) The box settles, but not exactly onto a side, due to floating-point imprecision, as well as momentum.

3) The box doesn't always have four contacts hitting the ground, resulting in occasionally-unbalanced contact resolution (all contacts between two objects are resolved by adding their linear and angular components and averaging) - Ie, if only three contacts hit the ground (engine does not now have continuous/swept collision), then it'll tilt towards the other corner point.

4) These "jitter impulses" build up until the box is rocking back and forth; after a while, it'll settle down.

Current ideas (comments, critique and additional ideas, please):

1) Re-introduce and test potential contacts from previous frames (suggested by "Game Physics Engine Development: How To Build A Robust Commercial-Grade Physics Engine For Your Game", by Ian Millington).

Thanks.

2) Some sort of "Forced zeroing" function, that will take effect when numbers grow small enough.

3) Continue reading the book mentioned in 1) (Only idea I'm acting on right now; mentioned to get the obvious out of the way)

4) Get a video of this up (Fraps? Something else? VirtualDub, I remember as being good at compression and free - What's current?)

Share this post


Link to post
Share on other sites
Advertisement

Oh, and since editing is apparently impossible -

Thanks. smile.png


I've heard that if you refresh the page the 'edit' appears.

-Josh

Share this post


Link to post
Share on other sites
You really want something which will give you all contacts between the box and the ground on the current frame, without caching or looking up previous results - it will be more stable this way.

Start with the best case (having all contacts), then work back from there if you really need. It should be possible to get it very stable.

I found using an approach like speculative contacts dramaticaly increased the stability of my physics engine in 2d; I see no reason it wouldn't work in 3d as well:

http://www.wildbunny.co.uk/blog/2011/03/25/speculative-contacts-an-continuous-collision-engine-approach-part-1/

Cheers, Paul.

Share this post


Link to post
Share on other sites

[quote name='Narf the Mouse' timestamp='1326568801' post='4902726']
Oh, and since editing is apparently impossible -

Thanks. smile.png


I've heard that if you refresh the page the 'edit' appears.

-Josh
[/quote]
Did that, hit "Save Changes", no change apparent.

You really want something which will give you all contacts between the box and the ground on the current frame, without caching or looking up previous results - it will be more stable this way.

Start with the best case (having all contacts), then work back from there if you really need. It should be possible to get it very stable.

I found using an approach like speculative contacts dramaticaly increased the stability of my physics engine in 2d; I see no reason it wouldn't work in 3d as well:

http://www.wildbunny...pproach-part-1/

Cheers, Paul.

Thanks, reading it.

Interesting - How do you handle coefficients of restitution? I didn't see any "bounce" in your demos.

Share this post


Link to post
Share on other sites

Thanks, reading it.

Interesting - How do you handle coefficients of restitution? I didn't see any "bounce" in your demos.


That's one of the trade-offs; its only possible to simulate fully plastic collisions :)

Share this post


Link to post
Share on other sites

[quote name='Narf the Mouse' timestamp='1326574364' post='4902760']
Thanks, reading it.

Interesting - How do you handle coefficients of restitution? I didn't see any "bounce" in your demos.


That's one of the trade-offs; its only possible to simulate fully plastic collisions smile.png
[/quote]
Unfortunately, I need elestic collisions. :(

Thanks anyway. :)

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.

GameDev.net 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!