20 using component_type = T;
43 std::swap(x, inVector.x);
44 std::swap(y, inVector.y);
45 std::swap(z, inVector.z);
69 virtual bool operator == (
const Vector3<T> &inVector)
const 71 return x == inVector.x && y == inVector.y && z == inVector.z;
74 virtual bool operator != (
const Vector3<T> &inVector)
const 76 return x != inVector.x || y != inVector.y || z != inVector.z;
82 return Vector3<T>(this->x + inVector.x, this->y + inVector.y, this->z + inVector.z);
87 return Vector3<T>(this->x - inVector.x, this->y - inVector.y, this->z - inVector.z);
92 return Vector3<T>(this->x * inScalar, this->y * inScalar, this->z * inScalar);
97 return Vector3<T>(inVector.x * this->x, inVector.y * this->y, inVector.y * this->z);
100 virtual const Vector3<T> & operator + ()
const 107 return Vector3<T>(-this->x, -this->y, -this->z);
112 return Vector3<T>(inScalar * inVector.x, inScalar * inVector.y, inScalar * inVector.z);
117 return Vector3<T>(inVector.x + inValue, inVector.y + inValue, inVector.z + inValue);
122 return Vector3<T>(inValue + inVector.x, inValue + inVector.y, inValue + inVector.z);
127 return Vector3<T>(inVector.x - inValue, inVector.y - inValue, inVector.z - inValue);
132 return Vector3<T>(inValue - inVector.x, inValue - inVector.y, inValue - inVector.z);
138 this->x += inVector.x;
139 this->y += inVector.y;
140 this->z += inVector.z;
147 this->x -= inVector.x;
148 this->y -= inVector.y;
149 this->z -= inVector.z;
154 virtual Vector3<T>& operator *= (
const T inScalar)
163 virtual Vector3<T>& operator += (
const T inScalar)
172 virtual Vector3<T>& operator -= (
const T inScalar)
183 this->x *= inVector.x;
184 this->y *= inVector.y;
185 this->z *= inVector.z;
192 this->x /= inVector.x;
193 this->y /= inVector.y;
194 this->z /= inVector.z;
199 virtual T dotProduct(
const Vector3 &inVec)
const;
201 friend std::ostream& operator << (std::ostream &inOStream,
const Vector3 &inVector)
203 inOStream << inVector.x <<
", " << inVector.y <<
", " << inVector.z;
210 #include "Vector.tpp" 212 #endif // API_VECTOR_H virtual Vector3< T > & operator=(const Vector3< T > &inVector)
Definition: Vector.h:51
virtual void swap(Vector3< T > &inVector)
Definition: Vector.h:41