From 365cbc6e1cea96741e26c9ce912b003f8fd2c62c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 29 Sep 2019 14:59:24 +0200 Subject: Refactored more of Entities and BlockEntities to use Vector3. (#4403) --- src/Vector3.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/Vector3.h') 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 addedX(T a_AddX) const + { + return Vector3(x + a_AddX, y, z); + } + + /** Returns a copy of this vector moved by the specified amount on the y axis. */ + inline Vector3 addedY(T a_AddY) const + { + return Vector3(x, y + a_AddY, z); + } + + /** Returns a copy of this vector moved by the specified amount on the Z axis. */ + inline Vector3 addedZ(T a_AddZ) const + { + return Vector3(x, y, z + a_AddZ); + } + + /** Returns a copy of this vector moved by the specified amount on the X and Z axes. */ + inline Vector3 addedXZ(T a_AddX, T a_AddZ) const + { + return Vector3(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 -- cgit v1.2.3