Sign in to follow this  

Edges Convex Polygon

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, i have read lots of tutorials on the internet, but i can´t find a good one that i fully understand. I am doing a FPS game and i am having a real hard time with the Collision Detection. I am only using 2D, just lines or polygons as bounderies. don´t even use planes, so the game is like Doom just 2D. I user a Sphere against any polygon wall or just linesegments and can easily determine how for away the sphere is by projecting. i can also use raycast and see where the view vector intersects. Corners are no problems, just count nr of hits, when 2 you are in a corner. (check angle and so on) The MAIN problem is edges, convex edges, i need to check that the sphere is free from BOTH walls of the edge before sending the spehere sliding at any direction. I have also tried the closest point on the polygon but the problem with edges also appears there. its hard when using normal length to setup a max_distance from wall, on the edges there becomes "hole" in the middle of the convex edges. I don´t need links to tutorials, ihave seen them all (i think =)) i Need a Plan, how do you solve sliding a sphere around an edge in 2d? need help.

Share this post


Link to post
Share on other sites
Ok, is this your problem:

Let's say you have a wall corner. And you are trying to 'slide' a circle around the corner.

Let's say that you do a good job of keeping the Circle vertexes out of the wall, but the corner of the wall slides into the circle between two of the Circle Vertexes.

Is that your problem?

Share this post


Link to post
Share on other sites
Problem solved, once and for all!

User closest point on polygon. follow the point if user if facing walls. thats it! peace of cake! =)

Share this post


Link to post
Share on other sites
Sign in to follow this