X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmath%2Faatriangle.hpp;h=228c1e24955aef1639f6dc38b9b906c4bf77c5ae;hb=590d47c3c3cf4641d97ee1579af69edbc355e5a8;hp=6eea71f14e072a110d4ff5530144a9b2391d26f9;hpb=0b32a11504344ab2038027a4de9cd775d7f80def;p=supertux.git diff --git a/src/math/aatriangle.hpp b/src/math/aatriangle.hpp index 6eea71f14..228c1e249 100644 --- a/src/math/aatriangle.hpp +++ b/src/math/aatriangle.hpp @@ -17,7 +17,7 @@ #ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP #define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP -#include "math/vector.hpp" +#include "math/rectf.hpp" /** * An axis-aligned triangle (ie. a triangle where 2 sides are parallel to the x- @@ -42,10 +42,10 @@ public: SOUTHEAST, NORTHWEST, DIRECTION_MASK = 0x0003, - DEFORM1 = 0x0010, - DEFORM2 = 0x0020, - DEFORM3 = 0x0030, - DEFORM4 = 0x0040, + DEFORM_BOTTOM = 0x0010, + DEFORM_TOP = 0x0020, + DEFORM_LEFT = 0x0030, + DEFORM_RIGHT = 0x0040, DEFORM_MASK = 0x0070 }; @@ -53,31 +53,18 @@ public: public: AATriangle() : - p1(), - p2(), + bbox(), dir(SOUTHWEST) { } - AATriangle(const Vector& v1, const Vector& v2, int newdir) : - p1(v1), - p2(v2), + AATriangle(const Rectf& newbbox, int newdir) : + bbox(newbbox), dir(newdir) { } - float get_width() const - { - return p2.x - p1.x; - } - - float get_height() const - { - return p2.y - p1.y; - } - public: - Vector p1; - Vector p2; + Rectf bbox; int dir; };