summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
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