🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Physics2D, How would I handle this collision?

Started by
1 comment, last by fleabay 4 years, 4 months ago

I have a point, and a line.

The point can move, the line cannot.

When the point moves into the line, it should not be able to cross it, but should be able to press flush against it. And if the line is sloped, a portion of the motion should be converted along the line.

At the moment, when the point hits the line, its speed is set to zero, then because it directly intersects the line, it is always hitting the line, and it does not matter if it is moving away from the line because it is still in collision with the line, and therefore the speed is set to zero. How do i use the line's normals in addition to the point's direction of movement to fix this?

Advertisement

This video should help. Warning about the bad audio. The video is about bouncing off a wall but he talks about wall sliding also.

https://www.youtube.com/watch?v=6fIzCVVPnYY&list=PLRwVmtr-pp04XomGtm-abzb-2M1xszjFx&index=155

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

This topic is closed to new replies.

Advertisement