summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-25 00:31:56 +0100
committerMattes D <github@xoft.cz>2014-12-25 00:31:56 +0100
commit1d593134da55317e3ec09c56463d4a0a92128b81 (patch)
tree220066e191e85bb3fafd4bccbcfbe62ed737f2f6 /src/Vector3.h
parentByteBuffer: SingleThreadAccessChecker is request-only. (diff)
parentAPIDump: Updated the player block placement documentation. (diff)
downloadcuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.gz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.bz2
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.lz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.xz
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.tar.zst
cuberite-1d593134da55317e3ec09c56463d4a0a92128b81.zip
Diffstat (limited to 'src/Vector3.h')
-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;