diff options
author | Mattes D <github@xoft.cz> | 2019-09-29 14:59:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-29 14:59:24 +0200 |
commit | 365cbc6e1cea96741e26c9ce912b003f8fd2c62c (patch) | |
tree | f23682c47928597791c53f3a300b03494ffde417 /src/Vector3.h | |
parent | Cactus can now grow and will be dropped if there is no place to grow. (diff) | |
download | cuberite-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.h | 24 |
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 |