diff options
author | Howaner <franzi.moos@googlemail.com> | 2015-01-25 00:34:19 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2015-01-25 00:34:19 +0100 |
commit | 1eedccc56a1a80b42adbea8dbbe968d42c7fe712 (patch) | |
tree | a5fe3fb72a3c3918b2c4ba413c686f718f5d403c /src/Vector3.h | |
parent | C++11 and function rename. (diff) | |
parent | Gamosocm support (diff) | |
download | cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.gz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.bz2 cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.lz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.xz cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.zst cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.zip |
Diffstat (limited to 'src/Vector3.h')
-rw-r--r-- | src/Vector3.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Vector3.h b/src/Vector3.h index 1e4a1f5d9..1f3f6b955 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -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; |