Hey all,
I just wanted to share a great little article which covers how to implement collision detection between rotated polygons, or in this case, rectangles in particular.
http://www.gamedev.net/reference/progra ... /page3.asp
It was recently incredibly useful to me and I thought somebody else might find it interesting. It's written to be specific to rectangles but the algorithm can easily be expanded to any sort of 2D Polygon by increasing the number of axes you test.
Collision detection using separate axis theorem,
Re: Collision detection using separate axis theorem,
I've used this before, I switched over to my on algorithm, which involves a lot of rotating in a relativistic fashion. I'll [eventually] make a tutorial on how to use it.
Hello, I am not dead.
Re: Collision detection using separate axis theorem,
If you wouldn't mind, I would love to profile the two methods and see which is faster. I don't do a lot of collision checks in the program I'm using this in quite yet, but if I start testing many objects against many objects, the amount of checks will grow exponentially. I thought about a solution involving first rotating one rectangle you're testing to be on the standard plane, rotating the second rectangle by the same angle, and then checking whether or not the vertices of the second rectangle is within its bounds. I decided that since the "separated axis theorem"-method is flexible to support any polygon, I would learn it first.zac352 wrote:I've used this before, I switched over to my on algorithm, which involves a lot of rotating in a relativistic fashion. I'll [eventually] make a tutorial on how to use it.
Who is online
Users browsing this forum: No registered users and 12 guests