Edges Convex Polygon

Started by
2 comments, last by Meshboy 16 years, 1 month ago
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.
Advertisement
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?
Yes! exactly! If you have any solution i will be very happy to hear about it =)
Problem solved, once and for all!

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

This topic is closed to new replies.

Advertisement