Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/vector2f.h')
-rw-r--r--src/math/vector2f.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/math/vector2f.h b/src/math/vector2f.h
index 1a5f4de..7641cbc 100644
--- a/src/math/vector2f.h
+++ b/src/math/vector2f.h
@@ -43,6 +43,18 @@ public:
/// vector sum
Vector2f & operator+=(const Vector2f &other);
+
+ /**
+ * @brief scalar multiplication assignment
+ * @param scalar multiplication factor
+ * */
+ Vector2f& operator*=(const float scalar);
+
+ /**
+ * @brief scalar division assignment
+ * @param scalar divider
+ * */
+ Vector2f& operator/=(const float scalar);
/// vector subtraction
inline Vector2f operator+(const Vector2f &other) const {
@@ -97,6 +109,10 @@ public:
inline float y() const {
return coord[1];
}
+
+ /// cartesian length
+ float length() const;
+
/// mutable reference to the x coordinate
inline float & get_x() {
@@ -131,6 +147,9 @@ float distance(const Vector2f& first, const Vector2f& second);
/// distance between two vectors squared
float distancesquared(const Vector2f& first, const Vector2f& second);
+/// scalar * Vector2f operators
+Vector2f operator*(float scalar, const Vector2f & vector);
+
}
#endif // __INCLUDED_MATH_VECTOR2F_H__