# help on concave!

This topic is 3680 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I learned how to do collision detection for 2D concave shapes by checking if the points of one concave shape is inside the other one, or turning the concave shapes into triangle and then check if they are colliding,but i got stuck when i try to figure out the penetration the collision. I have been asking this question everywhere and searching for solution,but havent got anything. hopefully this place can help, thanks~

##### Share on other sites
If you use the separating axis theorem method on the triangles to check for collisions then it should return the projection. If your checking point inside polygon you'll have to loop through the edges of the containing polygon and find which one is closest to the penetrating point and then the vector from the point to that edge is the projection necessary.

##### Share on other sites
oh i just thought of a question too,what happen if 2 concave are colliding but none of their points are in the other shape? how you check it if you are using the point in polygon method?

##### Share on other sites
Quote:
 Original post by AlrecenkIf you use the separating axis theorem method on the triangles to check for collisions then it should return the projection.

i thought of it too,but SAT return the smallest projection,but what happen if the the smallest projection is not the edge of the polygon,and its between 2 triangle that created from the triangulation? and it will just keep moving back and forth between those 2 triangle

##### Share on other sites
You can decompose concave polygons into a collection of convex ones, then test as usual for them. There are also algorithms for detecting point-in-poly for concave if you dont want to do that.

Quote:
 oh i just thought of a question too,what happen if 2 concave are colliding but none of their points are in the other shape? how you check it if you are using the point in polygon method?

This will only happen if your time step is large and a point goes all the way through a body and out the other side. If you keep your timestep low and your objects and fat this wont happen much. It will only happen with really thin objects. If you must, you can do line-poly intersection tests to see if it intersected over the course of the time step for each point, but this is slow.

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

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

• Total Topics
633656
• Total Posts
3013186
×