Circle-Circle impulse resolution not working properly

Started by
23 comments, last by Dirk Gregorius 6 years, 9 months ago

I would recommend adding a visual "step" by "step" debug system, so you clearly see when something goes wrong.

You can just use a bool to force to simulate one step or even step a single body pair. Its really hard to solve physics problems when you just look at the final output.

Render your bounding boxes + orientation and render your contact points inluding the surface normal and penetration distance. Start simple like dirk already recommended and build up from there.

Also making a realtime dragging tool to move/rotate two bodies around at realtime helps a lot!

I made such stuff in the past for javascript if you are interested: http://root.xenorate.com/final/jsstuff/

Advertisement
5 hours ago, Randy Gaul said:

I'd like to help but the question you're asking is very open ended. There isn't really a specific piece I can help you with here. I'd love to help, but it sounds like you're not sure where the problem is yet.

Here is the problem, as explicitly as I can describe it: sometimes, when my circles are moving with velocities not perpendicular to the X or Y axes, when they are supposed to collide, they just get stuck in each other.

This is not what it would be like in real life, and I know that I am supposed to somehow find the penetration vector of the circles and them move them apart.

Now what I want you to do is to tell me how to get the penetration vector and then when to move the circles apart from each other.

29 minutes ago, Bob Dylan said:

Now what I want you to do is to tell me how to get the penetration vector and then when to move the circles apart from each other.

That's not something answerable on a forum. You're basically asking how to create an entire physics sim. That said, the answers are in the link you posted earlier. If you can't find them in the link, I'm not really sure anyone can help you here.

29 minutes ago, Bob Dylan said:

Here is the problem, as explicitly as I can describe it: sometimes, when my circles are moving with velocities not perpendicular to the X or Y axes, when they are supposed to collide, they just get stuck in each other.

I appreciate the explicit description. I can't help you because what you are describing is not explicit, even though the description of it is clear. Your problem is vague, even though you described it nicely.

There are many reasons why circles may get stuck inside each other, and the problems could be anywhere. There is no simple answer of "how to make them not stick together".

 

One thing you can do is to setup similar situations both in Randy's and your simulators and step through them side by side. Or write down an analytical solution and confirm your results in debugger. The problem is that you need to debug your code and nobody else is going to do this for you.

This topic is closed to new replies.

Advertisement