![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cDirectionDef.h>
Public Member Functions | |
UNITTEST_FRIEND (cDirectionDef) | |
Static Public Member Functions | |
static DIR_TYPE GRAYCALL | GetDirStr (const GChar_t *pszDir) |
static DIR_TYPE | GetTurn (DIR_TYPE eDir, int iOffset) |
static const GChar_t * | GetDirName (DIR_TYPE eDir) |
static DIR_TYPE | GetHeadingDir (RADIANf_t fHeading) noexcept |
static RADIANf_t | GetDirHeading (DIR_TYPE eDir) noexcept |
Public Attributes | |
const GChar_t * | m_pszAbbrev |
"E", "N" "NE" etc More... | |
const GChar_t * | m_pszName |
"East" "North" "North East" etc More... | |
short | m_dx |
-1,0,+1 = Cos(angle) More... | |
short | m_dy |
-1,0,+1 = Sin(angle) More... | |
Static Public Attributes | |
static const cDirectionDef | k_Directions [DIR_QTY+1] |
static RADIANf_t | k_fAngTurn = cTypeF<RADIANf_t>::k_PI2 / DIR_QTY |
+1 Turn angle in radians = cTypeF<float>::k_PI2 / DIR_QTY More... | |
A simplistic 2d Compass/Cartesian direction. N,W,S,E 0,0 = North West Corner, x=-N/+S, y=-W/+E. Origin is upper left. More like texture coords (left handed DirectX space). less like a traditional math graph. (y flipped)(right handed space)
opposite of GetHeadingDir.
Convert a string into a direction. e.g. "North" = DIR_N
Convert Euler fHeading in RADIANf_t to approximate nearest DIR_TYPE opposite of GetDirHeading 0=E, pi/2=S, pi=W, pi+pi/2=N e.g. cos(0) = 1 = +1x, sin(0) = 0 = +0y
Turn in a direction. Wrap Enumerate to DIR_QTY +1 = turn to the right. clockwise. -1 = turn to the left. counter clockwise
GrayLib::cDirectionDef::UNITTEST_FRIEND | ( | cDirectionDef | ) |
|
static |
+1 Turn angle in radians = cTypeF<float>::k_PI2 / DIR_QTY
short GrayLib::cDirectionDef::m_dx |
-1,0,+1 = Cos(angle)
short GrayLib::cDirectionDef::m_dy |
-1,0,+1 = Sin(angle)
const GChar_t* GrayLib::cDirectionDef::m_pszAbbrev |
"E", "N" "NE" etc
const GChar_t* GrayLib::cDirectionDef::m_pszName |
"East" "North" "North East" etc