continuous 2D edge-edge collisions.

Started by
2 comments, last by Geat_Masta 7 years, 2 months ago

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?

Advertisement

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

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?

This topic is closed to new replies.

Advertisement