1
0
Fork 0

Added Vector3::TurnCW() and Vector3::TurnCCW()

This commit is contained in:
Mattes D 2014-12-24 06:43:28 +01:00
parent 3dd94bac5e
commit 075b19c7cb
1 changed files with 16 additions and 0 deletions

View File

@ -307,6 +307,22 @@ public:
return (a_X - x) / (a_OtherEnd.x - x);
}
/** Rotates the vector 90 degrees clockwise around the vertical axis.
Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down. */
inline void TurnCW(void)
{
std::swap(x, z);
x = -x;
}
/** Rotates the vector 90 degrees counterclockwise around the vertical axis.
Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down. */
inline void TurnCCW(void)
{
std::swap(x, z);
z = -z;
}
/** The max difference between two coords for which the coords are assumed equal. */
static const double EPS;