17 #ifndef HEADER_SUPERTUX_MATH_VECTOR_HPP 18 #define HEADER_SUPERTUX_MATH_VECTOR_HPP 31 : x(other.x), y(other.y)
37 bool operator ==(
const Vector& other)
const 39 return x == other.x && y == other.y;
42 bool operator !=(
const Vector& other)
const 44 return !(x == other.x && y == other.y);
56 return Vector(x + other.x, y + other.y);
61 return Vector(x - other.x, y - other.y);
64 Vector operator*(
float s)
const 66 return Vector(x * s, y * s);
69 Vector operator/(
float s)
const 71 return Vector(x / s, y / s);
93 const Vector& operator *=(
float val)
100 const Vector& operator /=(
float val)
110 return x*other.x + y*other.y;
118 return Vector(floorf(x), floorf(y));
127 std::ostream& operator<<(std::ostream& out,
const Vector& vector);
Simple two dimensional vector.
Definition: vector.hpp:24
float operator*(const Vector &other) const
Scalar product of 2 vectors.
Definition: vector.hpp:108