src/math/aatriangle.hpp

Go to the documentation of this file.
00001 //  SuperTux
00002 //  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
00003 //
00004 //  This program is free software: you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation, either version 3 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 #ifndef HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
00018 #define HEADER_SUPERTUX_MATH_AATRIANGLE_HPP
00019 
00020 #include "math/rectf.hpp"
00021 
00026 class AATriangle
00027 {
00028 public:
00039   enum Direction {
00040     SOUTHWEST = 0,
00041     NORTHEAST,
00042     SOUTHEAST,
00043     NORTHWEST,
00044     DIRECTION_MASK = 0x0003,
00045     DEFORM_BOTTOM = 0x0010,
00046     DEFORM_TOP = 0x0020,
00047     DEFORM_LEFT = 0x0030,
00048     DEFORM_RIGHT = 0x0040,
00049     DEFORM_MASK = 0x0070
00050   };
00051 
00052   static int vertical_flip(int dir);
00053 
00054 public:
00055   AATriangle() :
00056     bbox(),
00057     dir(SOUTHWEST)
00058   {
00059   }
00060   AATriangle(const Rectf& newbbox, int newdir) :
00061     bbox(newbbox),
00062     dir(newdir)
00063   {
00064   }
00065 
00066 public:
00067   Rectf bbox;
00068   int dir;
00069 };
00070 
00071 #endif
00072 
00073 /* EOF */

Generated on Mon Jun 9 03:38:18 2014 for SuperTux by  doxygen 1.5.1