# 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.

## 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 on other sites

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

##### 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?

1. 1
2. 2
3. 3
Rutin
20
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633655
• Total Posts
3013175
×