#include <aatriangle.hpp>
Public Types | |
enum | Direction { SOUTHWEST = 0, NORTHEAST, SOUTHEAST, NORTHWEST, DIRECTION_MASK = 0x0003, DEFORM_BOTTOM = 0x0010, DEFORM_TOP = 0x0020, DEFORM_LEFT = 0x0030, DEFORM_RIGHT = 0x0040, DEFORM_MASK = 0x0070 } |
Directions:. More... | |
Public Member Functions | |
AATriangle () | |
AATriangle (const Rectf &newbbox, int newdir) | |
Static Public Member Functions | |
static int | vertical_flip (int dir) |
Public Attributes | |
Rectf | bbox |
int | dir |
a triangle where 2 sides are parallel to the x- and y-axis.
Definition at line 26 of file aatriangle.hpp.
Directions:.
SOUTHEWEST NORTHEAST SOUTHEAST NORTHWEST * or *---* or * or *---* | \ \ | / | | / | \ \ | / | | / *---* * *---* *
Deform flags: (see docs/aatriangletypes.png for details)
SOUTHWEST | |
NORTHEAST | |
SOUTHEAST | |
NORTHWEST | |
DIRECTION_MASK | |
DEFORM_BOTTOM | |
DEFORM_TOP | |
DEFORM_LEFT | |
DEFORM_RIGHT | |
DEFORM_MASK |
Definition at line 39 of file aatriangle.hpp.
00039 { 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 };
AATriangle::AATriangle | ( | ) | [inline] |
Definition at line 55 of file aatriangle.hpp.
00055 : 00056 bbox(), 00057 dir(SOUTHWEST) 00058 { 00059 } AATriangle(const Rectf& newbbox, int newdir) :
AATriangle::AATriangle | ( | const Rectf & | newbbox, | |
int | newdir | |||
) | [inline] |
int AATriangle::vertical_flip | ( | int | dir | ) | [static] |
Definition at line 22 of file aatriangle.cpp.
References DEFORM_BOTTOM, DEFORM_MASK, DEFORM_TOP, and DIRECTION_MASK.
Referenced by Sector::collision_tilemap().
00022 { 00023 int direction = dir & AATriangle::DIRECTION_MASK; 00024 direction = 3 - direction; 00025 int deform = dir & AATriangle::DEFORM_MASK; 00026 switch (deform) { 00027 case AATriangle::DEFORM_BOTTOM: 00028 deform = AATriangle::DEFORM_TOP; 00029 break; 00030 case AATriangle::DEFORM_TOP: 00031 deform = AATriangle::DEFORM_BOTTOM; 00032 break; 00033 default: 00034 // unchanged 00035 break; 00036 } 00037 return (direction | deform); 00038 }
Definition at line 67 of file aatriangle.hpp.
int AATriangle::dir |
Definition at line 68 of file aatriangle.hpp.