◆ VectorToCardinalDirection()
CARDINAL_DIRECTION CInputTranslator::VectorToCardinalDirection |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
static |
Get the closest cardinal direction to the given vector.
This function assumes a right-handed cartesian coordinate system; positive X is right, positive Y is up.
Ties are resolved in the clockwise direction: (0.5, 0.5) will resolve to RIGHT.
- Parameters
-
x | The x component of the vector |
y | The y component of the vector |
- Returns
- The closest cardinal direction (up, down, right or left), or CARDINAL_DIRECTION::NONE if x and y are both 0
◆ VectorToIntercardinalDirection()
INTERCARDINAL_DIRECTION CInputTranslator::VectorToIntercardinalDirection |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
static |
Get the closest cardinal or intercardinal direction to the given vector.
This function assumes a right-handed cartesian coordinate system; positive X is right, positive Y is up.
Ties are resolved in the clockwise direction.
- Parameters
-
x | The x component of the vector |
y | The y component of the vector |
- Returns
- The closest intercardinal direction, or INTERCARDINAL_DIRECTION::NONE if x and y are both 0
The documentation for this class was generated from the following files: