Sign in to follow this  
Deliverance

Managed to find contact point(s) with SAT(2D), is there a better way than mine?

Recommended Posts

I've been struggling to make this work and it seems it does now. So i'm calculating a mt vector using sat. Based on this i'm finding a separating plane like this: 1 -> Find the point(s) on object 1 that cause MAXIMUM projection values onto the minimum translation vector. 2 -> Select one of these points and calculate plane information (normal, distance), and test to see if the objects are separated by this plane 3 -> If they are NOT separated go to 4, if they are go to 5 4 -> Find the point(s) on object 1 that cause MINIMUM projection values onto the minimum translation vector, go to 5 5 -> Find the point(s) of object2 that lie onto the plane 6 -> If either the support features determined has 1 point return that as the contact point else go to 7 7 -> NewMTVector = Vector3(MTDVector.y, -MTDVector.x) (this will yield an edge direction). Calculate a plane with this normal and located in the origin. For all the 4 points (one edge from the first object and one from the second object), calculate the distance to the plane and sort them based on this distance, choose the second and third point as the line of collision. So what do you think? Is there a faster way to find the contact information? The complexity of the algorithm is O(N+M), where N = number of vertices of first polygon and M = number of vertices of second polygon. [Edited by - Deliverance on December 26, 2009 6:41:39 PM]

Share this post


Link to post
Share on other sites
I'm a bit confused about what you're asking here (possibly others are too given the lack of response): do you already have the minimum-translation-vector and you're trying to determine contact points, or you're trying to find MT and contacts using the process you're describing?

Share this post


Link to post
Share on other sites
Quote:
Original post by raigan
I'm a bit confused about what you're asking here (possibly others are too given the lack of response): do you already have the minimum-translation-vector and you're trying to determine contact points, or you're trying to find MT and contacts using the process you're describing?


I found the contact points and all that i need using the steps described above. My question is: can i find the contact points differently possibly using a another approach that could be better than the one i already use?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this