summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-24 06:43:28 +0100
committerMattes D <github@xoft.cz>2014-12-24 06:43:28 +0100
commit075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f (patch)
tree6e1a37b5fc4a403172e41a96ecc35da60bc5bd84
parentFixed too many slashes. (diff)
downloadcuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar.gz
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar.bz2
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar.lz
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar.xz
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.tar.zst
cuberite-075b19c7cbf5d6e45dbd14e8fab5740d7000bf0f.zip
-rw-r--r--src/Vector3.h16
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;