28 inline Vector3<T>::Vector3() :
52 x(static_cast<T>(vector.x)),
53 y(static_cast<T>(vector.y)),
54 z(static_cast<T>(vector.z))
61 inline Vector3<T> operator -(
const Vector3<T>& left)
63 return Vector3<T>(-left.x, -left.y, -left.z);
69 inline Vector3<T>& operator +=(Vector3<T>& left,
const Vector3<T>& right)
81 inline Vector3<T>& operator -=(Vector3<T>& left,
const Vector3<T>& right)
93 inline Vector3<T> operator +(
const Vector3<T>& left,
const Vector3<T>& right)
95 return Vector3<T>(left.x + right.x, left.y + right.y, left.z + right.z);
100 template <
typename T>
101 inline Vector3<T> operator -(
const Vector3<T>& left,
const Vector3<T>& right)
103 return Vector3<T>(left.x - right.x, left.y - right.y, left.z - right.z);
108 template <
typename T>
109 inline Vector3<T> operator *(
const Vector3<T>& left, T right)
111 return Vector3<T>(left.x * right, left.y * right, left.z * right);
116 template <
typename T>
117 inline Vector3<T> operator *(T left,
const Vector3<T>& right)
119 return Vector3<T>(right.x * left, right.y * left, right.z * left);
124 template <
typename T>
125 inline Vector3<T>& operator *=(Vector3<T>& left, T right)
136 template <
typename T>
137 inline Vector3<T> operator /(
const Vector3<T>& left, T right)
139 return Vector3<T>(left.x / right, left.y / right, left.z / right);
144 template <
typename T>
145 inline Vector3<T>& operator /=(Vector3<T>& left, T right)
156 template <
typename T>
157 inline bool operator ==(
const Vector3<T>& left,
const Vector3<T>& right)
159 return (left.x == right.x) && (left.y == right.y) && (left.z == right.z);
164 template <
typename T>
165 inline bool operator !=(
const Vector3<T>& left,
const Vector3<T>& right)
167 return (left.x != right.x) || (left.y != right.y) || (left.z != right.z);