Jump to content
  • Advertisement
Geat_Masta

continuous 2D edge-edge collisions.

This topic is 532 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'm having trouble programming a collision system, I had one working reasonably well when only velocity was being handled, or only rotation is being handled, by using light casting algorithms at the verticies, treating one object as stationary, and the other with the sum of the movements. But I can't figure out how have velocity, scaling, rotation, and bounding box changes due to the frame of the sprite changing.  Typically, when I find some instructions there isn't any obvious way to apply it to the bounding box changing.

I'm also unsure if GJK is applicable to this situation, because the objects are meant to stay inside the level geometry, rather than outside of it (this makes visibility testing faster). More specifically, the level is comprised of convex quads, where each edge has a permeability, if that permeability is higher than the object solidity the object doesn't check for collision against it.

So essentially, for each side of the object's bounding box, I have a line segment S1 representing the edge of the object at the start of the tick, and a line segment S2 representing the end of the tick, and a line segment R representing the edge of the level geometry to test collision against.

It occurred to me that I could look for intersections between the face formed by S1 and S2, and the plane formed by R, but that turned out to not be all that helpful.

What's a good way to handle this?

Share this post


Link to post
Share on other sites
Advertisement

It seems there is no other way than to also test all lines between previous vertex positions and new vertex positions

Share this post


Link to post
Share on other sites

If I test the lines between the previous and new vertex positions, then wouldn't the corner of the level colliding with the edge of the object not be detectable?

Share this post


Link to post
Share on other sites

  • 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!