I'm trying to detect whether 2 shapes intersect. I want to do this without calling cpSpaceStep.
I need this so that I can check whether an object is in the line of sight of a player. The LOS is a triangle. So basically is it possible to do something like this:
Code: Select all
cpShape shape1 = circle(70,70,5) // A circle at (70,70) with radius 5
cpShape shape2 = triangle(10,20, 150,60, 60,120) // A triangle with vertices: (10,20), (150,60), (70,40)
....
bool collides = CheckCollision(shape1, shape2)