Go to the documentation of this file.
41 return this->x == other.
x && this->y == other.
y && this->z == other.
z;
61 return Vector3<T>(this->x + vec.
x, this->y + vec.
y, this->z + vec.
z);
76 return Vector3<T>(this->x - vec.
x, this->y - vec.
y, this->z - vec.
z);
91 return Vector3<T>(this->x * d, this->y * d, this->z * d);
97 return Vector3<T>(this->x * b.
x, this->y * b.
y, this->z * b.
z);
100 template<
typename T2>
109 template<
typename T2>
112 return Vector3<T>(this->x / b.
x, this->y / b.
y, this->z / b.
z);
115 template<
typename T2>
124 template<
typename T2>
127 return Vector3<T>(this->x / b, this->y / b, this->z / b);
130 template<
typename T2>
133 return std::sqrt(std::pow(this->x - o.
x, 2) + std::pow(this->y - o.
y, 2) + std::pow(this->z - o.
z, 2));
138 return (std::sqrt(std::pow(this->x, 2) + std::pow(this->y, 2) + std::pow(this->z, 2)));
163 return Vector3<T>(this->x / mag, this->y / mag, this->z / mag);
168 return (point *
this) / std::pow(this->
magnitude(), 2) *
this;
173 return Vector3<T>(std::abs(this->x), std::abs(this->y), std::abs(this->z));
178 return Vector3<T>(std::trunc(this->x), std::trunc(this->y), std::trunc(this->z));
183 return Vector3<T>(std::ceil(this->x), std::ceil(this->y), std::ceil(this->z));
188 return Vector3<T>(std::floor(this->x), std::floor(this->y), std::floor(this->z));
193 return Vector3<T>(std::round(this->x), std::round(this->y), std::round(this->z));
198 return this->x == 0 && this->y == 0 && this->z == 0;
232 s <<
"Vector3<" <<
typeid(T).name() <<
">("<< v.
x <<
", " << v.
y <<
", " << v.
z <<
")";
T y
The y value of the vector.
Definition: Vector3.hpp:22
Vector3< unsigned > Vector3u
Definition: Vector3.hpp:224
A Three-dimensionnal Vector data type.
Definition: Vector3.hpp:15
Vector3< T > trunc() const requires(std
Definition: Vector3.hpp:176
Vector3< T > operator*(const T2 d) const
Definition: Vector3.hpp:89
Vector3< T > round() const requires(std
Definition: Vector3.hpp:191
Vector3()
Create a new nil vector3.
Definition: Vector3.hpp:27
static Vector3< T > max(Vector3< T > a, Vector3< T > b)
Definition: Vector3.hpp:214
Vector3< T > operator*(const Vector3< T2 > &b) const
Definition: Vector3.hpp:95
bool isNull() const
Definition: Vector3.hpp:196
Vector3< T > & operator+=(const Vector3< T2 > &vec)
Definition: Vector3.hpp:50
Vector3< T > abs() const
Definition: Vector3.hpp:171
Definition: AnimationsComponent.cpp:9
Vector3< T > operator+(const Vector3< T2 > &vec) const
Definition: Vector3.hpp:59
bool operator!=(const Vector3< T > &other) const
Definition: Vector3.hpp:44
T x
The x value of the vector.
Definition: Vector3.hpp:20
Vector3< T > floor() const requires(std
Definition: Vector3.hpp:186
Vector3< T > operator/(const Vector3< T2 > &b) const
Definition: Vector3.hpp:110
A Vector3 data type. (templated to allow any kind of vector3)
Definition: Vector3.hpp:16
static Vector3< T > min(Vector3< T > a, Vector3< T > b)
Definition: Vector3.hpp:206
double distance(const Vector3< T2 > &o) const
Definition: Vector3.hpp:131
Vector3< T > & operator*=(const T2 d)
Definition: Vector3.hpp:80
Vector3< float > Vector3f
Definition: Vector3.hpp:223
Vector3< T > operator/(T2 b) const
Definition: Vector3.hpp:125
Vector3< int > Vector3i
Definition: Vector3.hpp:225
~Vector3()=default
A default destructor.
Vector3(T _x, T _y, T _z)
Create a new vector3 representing a specific coordinate.
Definition: Vector3.hpp:32
Vector3< T > ceil() const requires(std
Definition: Vector3.hpp:181
Vector3< T > operator-(const Vector3< T2 > &vec) const
Definition: Vector3.hpp:74
Vector3< T > & operator-=(const Vector3< T2 > &vec)
Definition: Vector3.hpp:65
T z
The y value of the vector.
Definition: Vector3.hpp:24
Vector3< T > normalize()
Definition: Vector3.hpp:141
bool operator==(const Vector3< T > &other) const
Definition: Vector3.hpp:39
std::ostream & operator<<(std::ostream &s, const BBM::Vector3< T > &v)
Definition: Vector3.hpp:230
Vector3< T > operator/=(T2 b)
Definition: Vector3.hpp:116
Vector3< T > normalized() const
Definition: Vector3.hpp:157
Vector3< T > projection(const Vector3< T > &point) const
Definition: Vector3.hpp:166
double magnitude() const
Definition: Vector3.hpp:136
Vector3< T > operator/=(const Vector3< T2 > &b)
Definition: Vector3.hpp:101