Dev Log: Polygon Collisions
I never thought I'd be able to get polygon collisions working in Otter but this past week I managed to jam out a quick prototype of an overlapping polygon test that seems to be working.
![Image](http://kpulv.com/upload/files/141004devlog.jpg)
Probably not the most exciting image in the world, but it's pretty dang cool to me. I found this tutorial on the Separating Axis Theorem. This tutorial specifically has some great images, and amazing pseudocode with explanations that allowed me to finally understand what the hell to do. I still don't understand some things, like what exactly projecting a vector onto an axis means, but right now I think I have the core of it working.
I'll be working on getting the PolygonCollider integrated into Otter properly over the next few days. That means I'll have to get it working with each other Collider type which shouldn't be too crazy, but we'll see if I end up getting stumped by something!
![Image](http://kpulv.com/upload/files/141004devlog.jpg)
Probably not the most exciting image in the world, but it's pretty dang cool to me. I found this tutorial on the Separating Axis Theorem. This tutorial specifically has some great images, and amazing pseudocode with explanations that allowed me to finally understand what the hell to do. I still don't understand some things, like what exactly projecting a vector onto an axis means, but right now I think I have the core of it working.
I'll be working on getting the PolygonCollider integrated into Otter properly over the next few days. That means I'll have to get it working with each other Collider type which shouldn't be too crazy, but we'll see if I end up getting stumped by something!
Comments
I guess I don't have any excuse to keep procrastinating on it myself now.
Tutorial: http://www.metanetsoftware.com/technique/tutorialA.html
Also, as for projection onto an axis, the easiest way to think of it is to imagine you're taking the shadow of a vector, so to say. So if you had a diagonal line, the projection onto the x-axis would be its shadow on the ground if the line was directly above it.
Jacob: Feel free to just copy pasta my code if you want, haha!
Rusty: <3
Post your comment!