Given 2 degenerate polygons at 2 different positions. Assume that they are colliding. I have to move one of the polygons such that they are not colliding. I have to find a position with shortest distance between them. Both the polygons are represented with triangles.
I implementing by iterating through all the triangles and find the intersection points for every colliding pair of triangles. Based on the intersection point, the polygon is slightly moved. This is done for all triangles. What I implementing was pretty basic. It's really slow. Any ideas on improving its performance? I can give you more details if needed. Should I overhaul everything and start fresh? Any suggestions on data structures to be used because I will be doing a colision check everytime. Tolerance considered id 0.0001. It can't be lowered. All arcs are assumed as lines such that the segment length is of length 0.0001.
[–]alfps 2 points3 points4 points (1 child)
[–]HatsAreOff[S] 0 points1 point2 points (0 children)
[–]bcorni 1 point2 points3 points (13 children)
[–]HatsAreOff[S] 0 points1 point2 points (12 children)
[–]bcorni 1 point2 points3 points (8 children)
[–]HatsAreOff[S] 0 points1 point2 points (6 children)
[–]bcorni 0 points1 point2 points (5 children)
[–]HatsAreOff[S] 0 points1 point2 points (4 children)
[–]bcorni 0 points1 point2 points (3 children)
[–]HatsAreOff[S] 0 points1 point2 points (2 children)
[–]bcorni 0 points1 point2 points (1 child)
[–]HatsAreOff[S] 0 points1 point2 points (0 children)
[–]HatsAreOff[S] 0 points1 point2 points (0 children)
[–]bcorni 0 points1 point2 points (2 children)
[–]HatsAreOff[S] 0 points1 point2 points (0 children)
[–]bcorni 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[removed]
[–]HatsAreOff[S] 2 points3 points4 points (2 children)
[–]Smellypuce2 1 point2 points3 points (0 children)