summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-29 14:59:24 +0200
committerGitHub <noreply@github.com>2019-09-29 14:59:24 +0200
commit365cbc6e1cea96741e26c9ce912b003f8fd2c62c (patch)
treef23682c47928597791c53f3a300b03494ffde417 /src/Vector3.h
parentCactus can now grow and will be dropped if there is no place to grow. (diff)
downloadcuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.gz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.bz2
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.lz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.xz
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.tar.zst
cuberite-365cbc6e1cea96741e26c9ce912b003f8fd2c62c.zip
Diffstat (limited to '')
-rw-r--r--src/Vector3.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Vector3.h b/src/Vector3.h
index 0456b9e2f..1847baf5b 100644
--- a/src/Vector3.h
+++ b/src/Vector3.h
@@ -289,6 +289,30 @@ public:
);
}
+ /** Returns a copy of this vector moved by the specified amount on the X axis. */
+ inline Vector3<T> addedX(T a_AddX) const
+ {
+ return Vector3<T>(x + a_AddX, y, z);
+ }
+
+ /** Returns a copy of this vector moved by the specified amount on the y axis. */
+ inline Vector3<T> addedY(T a_AddY) const
+ {
+ return Vector3<T>(x, y + a_AddY, z);
+ }
+
+ /** Returns a copy of this vector moved by the specified amount on the Z axis. */
+ inline Vector3<T> addedZ(T a_AddZ) const
+ {
+ return Vector3<T>(x, y, z + a_AddZ);
+ }
+
+ /** Returns a copy of this vector moved by the specified amount on the X and Z axes. */
+ inline Vector3<T> addedXZ(T a_AddX, T a_AddZ) const
+ {
+ return Vector3<T>(x + a_AddX, y, z + a_AddZ);
+ }
+
/** Returns the coefficient for the (a_OtherEnd - this) line to reach the specified Z coord.
The result satisfies the following equation:
(*this + Result * (a_OtherEnd - *this)).z = a_Z