forgot to add some files
[supertux.git] / lib / math / aatriangle.h
1 #ifndef __AATRIANGLE_H__
2 #define __AATRIANGLE_H__
3
4 #include "rectangle.h"
5
6 namespace SuperTux
7 {
8
9 /**
10  * An axis aligned triangle (ie. a triangle where 2 sides are parallel to the x-
11  * and y-axis.
12  */
13 class AATriangle : public Rectangle
14 {
15 public:
16   /** Directions:
17    *
18    *    SOUTHEWEST    NORTHEAST   SOUTHEAST    NORTHWEST
19    *    *      or      *---*   or      *    or *---* 
20    *    | \             \  |         / |       |  /
21    *    |  \             \ |        /  |       | /
22    *    *---*              *       *---*       *
23    */
24   enum Direction {
25     SOUTHWEST, NORTHEAST, SOUTHEAST, NORTHWEST
26   };
27
28   AATriangle()
29     : dir(SOUTHWEST)
30   {
31   }
32   AATriangle(const Vector& v1, const Vector& v2, Direction newdir)
33     : Rectangle(v1, v2), dir(newdir)
34   {
35   }
36
37   Direction dir;
38 };
39
40 }
41
42 #endif
43