|
static const Dir | NORTH = 0 |
|
static const Dir | NORTHEAST = 1 |
|
static const Dir | EAST = 2 |
|
static const Dir | SOUTHEAST = 3 |
|
static const Dir | SOUTH = 4 |
|
static const Dir | SOUTHWEST = 5 |
|
static const Dir | WEST = 6 |
|
static const Dir | NORTHWEST = 7 |
|
static const Dir | DIR_COUNT = 8 |
|
static u32 MFM::Dirs::AddDirToMask |
( |
u32 |
mask, |
|
|
Dir |
dir |
|
) |
| |
|
inlinestatic |
Adds a Dir to a Dir mask.
- Parameters
-
mask | The mask to add a Dir to. |
dir | The Dir to add to mask. |
- Returns
- mask with dir added to it.
static Dir MFM::Dirs::CCWDir |
( |
Dir |
dir | ) |
|
|
inlinestatic |
The next dir counter-clockwise from dir. Note that for all dir, IsCorner(dir)==IsFace(CCWDir(dir)), and dir==CCWDir(CWDir(dir))
static Dir MFM::Dirs::CWDir |
( |
Dir |
dir | ) |
|
|
inlinestatic |
The next dir clockwise from dir. Note that for all dir, IsCorner(dir)==IsFace(CWDir(dir)), and dir==CWDir(CCWDir(dir))
void MFM::Dirs::FillDir |
( |
SPoint & |
pt, |
|
|
Dir |
dir |
|
) |
| |
|
static |
Given a Dir , will fill a SPoint with unit offsets representing the direction of this Dir . For instance:
- Parameters
-
pt | The SPoint to fill with the offsets of a direction. |
dir | The Dir specifying the units to fill pt with. |
SPoint MFM::Dirs::FlipSEPointToCorner |
( |
const SPoint & |
pt, |
|
|
const Dir |
corner |
|
) |
| |
|
static |
Flips the axes of a given SPoint about the origin. This behaves as if the given SPoint is a SOUTHEAST SPoint, which will represent the specified corner Dir once the flip has taken place. For instance,
This performs only axis flipping, keeping the distance from the origin the same.
- Parameters
-
pt | The SPoint to flip the axes of. |
corner | The corner representing the axes of pt to flip. This must be a corner (e.g. NORTHEAST, SOUTHEAST), else this method FAILs with ILLEGAL_ARGUMENT. |
- Returns
- A new point containing the new coordinates of
pt
, which is also changed.
Flips the X coordinate of a given SPoint about the origin.
- Parameters
-
pt | The SPoint to flip the X coordinate of . |
- Returns
- A reference to
pt
.
Flips the Y coordinate of a given SPoint about the origin.
- Parameters
-
pt | The SPoint to flip the Y coordinate of . |
- Returns
- A reference to
pt
.
u32 MFM::Dirs::FromOffset |
( |
SPoint & |
pt | ) |
|
|
static |
Translates the coordinates in a SPoint to a Dir . The coordinates in SPoint must be a unit offset (like the ones returned from FillDir
), otherwise this will FAIL with ILLEGAL_ARGUMENT .
- Parameters
-
pt | The SPoint containing a unit offset to translate to a Dir . |
- Returns
- The Dir representing the offset held by
pt
.
static const char* MFM::Dirs::GetName |
( |
Dir |
dir | ) |
|
|
inlinestatic |
map a dir to a readable string
static bool MFM::Dirs::IsCorner |
( |
Dir |
dir | ) |
|
|
inlinestatic |
true iff dir is a corner direction.
static bool MFM::Dirs::IsFace |
( |
Dir |
dir | ) |
|
|
inlinestatic |
true iff dir is a face direction.
static Dir MFM::Dirs::OppositeDir |
( |
Dir |
dir | ) |
|
|
inlinestatic |
Gets the direction opposite the one specified.
- Returns
- The direction opposite the one specified.
static u32 MFM::Dirs::RemoveDirInMask |
( |
u32 |
mask, |
|
|
Dir |
dir |
|
) |
| |
|
inlinestatic |
Removes a Dir from a Dir mask.
- Parameters
-
mask | The Dir mask to remove a Dir from. |
dir | The Dir to remove from mask. |
- Returns
- mask with dir removed from it.
static bool MFM::Dirs::TestDirInMask |
( |
u32 |
mask, |
|
|
Dir |
dir |
|
) |
| |
|
inlinestatic |
Checks a Dir mask to see if a Dir is inside it.
- Parameters
-
mask | The mask to check Dir membership of. |
dir | The Dir to check mask for membership of. |
- Returns
- true if dir is inside mask, else false.
The documentation for this class was generated from the following files:
- src/core/include/Dirs.h
- src/core/src/Dirs.cpp