updating Nolok contrib templates
[supertux.git] / lib / special / collision.h
1 #ifndef __COLLISION_H__
2 #define __COLLISION_H__
3
4 namespace SuperTux
5 {
6
7 class Vector;
8 class Rectangle;
9 class CollisionHit;
10 class AATriangle;
11
12 class Collision
13 {
14 public:
15   /** does collision detection between 2 rectangles. Returns true in case of
16    * collision and fills in the hit structure then.
17    */
18   static bool rectangle_rectangle(CollisionHit& hit, const Rectangle& r1,
19       const Vector& movement, const Rectangle& r2);
20
21   /** does collision detection between a rectangle and an axis aligned triangle
22    * Returns true in case of a collision and fills in the hit structure then.
23    */                                                                         
24   static bool rectangle_aatriangle(CollisionHit& hit, const Rectangle& rect,
25       const Vector& movement, const AATriangle& triangle);                                            
26 };
27
28 }
29
30 #endif
31