26 #ifndef _TGUI_VECTORS_INCLUDED_
27 #define _TGUI_VECTORS_INCLUDED_
67 x1(static_cast<T>(vector.x1)),
68 x2(static_cast<T>(vector.x2)),
69 x3(static_cast<T>(vector.x3)),
70 x4(static_cast<T>(vector.x4))
102 template <
typename T>
103 inline Vector4<T>& operator +=(Vector4<T>& left,
const Vector4<T>& right)
117 template <
typename T>
118 inline Vector4<T>& operator -=(Vector4<T>& left,
const Vector4<T>& right)
132 template <
typename T>
133 inline Vector4<T> operator +(
const Vector4<T>& left,
const Vector4<T>& right)
135 return Vector4<T>(left.x1 + right.x1, left.x2 + right.x2, left.x3 + right.x3, left.x4 + right.x4);
142 template <
typename T>
143 inline Vector4<T> operator -(
const Vector4<T>& left,
const Vector4<T>& right)
145 return Vector4<T>(left.x1 - right.x1, left.x2 - right.x2, left.x3 - right.x3, left.x4 - right.x4);
152 template <
typename T>
153 inline Vector4<T> operator *(
const Vector4<T>& left, T right)
155 return Vector4<T>(left.x1 * right, left.x2 * right, left.x3 * right, left.x4 * right);
162 template <
typename T>
163 inline Vector4<T> operator *(T left,
const Vector4<T>& right)
165 return Vector4<T>(right.x1 * left, right.x1 * left, right.x3 * left, right.x4 * left);
172 template <
typename T>
173 inline Vector4<T>& operator *=(Vector4<T>& left, T right)
187 template <
typename T>
188 inline Vector4<T> operator /(
const Vector4<T>& left, T right)
190 return Vector4<T>(left.x1 / right, left.x2 / right, left.x3 / right, left.x4 / right);
197 template <
typename T>
198 inline Vector4<T>& operator /=(Vector4<T>& left, T right)
212 template <
typename T>
213 inline bool operator ==(
const Vector4<T>& left,
const Vector4<T>& right)
215 return (left.x1 == right.x1) && (left.x2 == right.x2) && (left.x3 == right.x3) && (left.x4 == right.x4);
222 template <
typename T>
223 inline bool operator !=(
const Vector4<T>& left,
const Vector4<T>& right)
225 return (left.x1 != right.x1) || (left.x2 != right.x2) || (left.x3 != right.x3) || (left.x4 != right.x4);
231 typedef sf::Vector2<float> Vector2f;
232 typedef sf::Vector2<int> Vector2i;
233 typedef sf::Vector2<unsigned int> Vector2u;
235 typedef sf::Vector3<float> Vector3f;
236 typedef sf::Vector3<int> Vector3i;
237 typedef sf::Vector3<unsigned int> Vector3u;
239 typedef Vector4<float> Vector4f;
240 typedef Vector4<int> Vector4i;
241 typedef Vector4<unsigned int> Vector4u;
248 #endif //_TGUI_VECTORS_INCLUDED_
Vector4()
Default constructor.
Definition: Vectors.hpp:41
T x2
Member data.
Definition: Vectors.hpp:79
T x4
Member data.
Definition: Vectors.hpp:85
T x1
Member data.
Definition: Vectors.hpp:76
T x3
Member data.
Definition: Vectors.hpp:82
Definition: Vectors.hpp:36
Vector4(T X1, T X2, T X3, T X4)
Construct the vector from its coordinates.
Definition: Vectors.hpp:53
Vector4(const Vector4< U > &vector)
Construct the vector from another type of vector.
Definition: Vectors.hpp:66