Leonetienne/Eule
Homemade math library, mainly targetted towards computer graphics
|
Representation of a 4d vector. More...
#include <Vector2.h>
Public Member Functions | |
Vector4 () | |
Vector4 (T _x, T _y, T _z, T _w) | |
Vector4 (const Vector4< T > &other)=default | |
Vector4 (Vector4< T > &&other) noexcept=default | |
double | SqrMagnitude () const |
Will compute the square magnitude. More... | |
double | Magnitude () const |
Will compute the magnitude. More... | |
Vector4< double > | Normalize () const |
Will return the normalization of this vector. More... | |
void | NormalizeSelf () |
Will normalize this vector. More... | |
Vector4< T > | VectorScale (const Vector4< T > &scalar) const |
Will scale self.n by scalar.n. More... | |
void | LerpSelf (const Vector4< T > &other, double t) |
Will lerp itself towards other by t. More... | |
Vector4< double > | Lerp (const Vector4< T > &other, double t) const |
Will return a lerp result between this and another vector. More... | |
bool | Similar (const Vector4< T > &other, double epsilon=0.00001) const |
Will compare if two vectors are similar to a certain epsilon value. More... | |
Vector4< int > | ToInt () const |
Will convert this vector to a Vector4i. More... | |
Vector4< double > | ToDouble () const |
Will convert this vector to a Vector4d. More... | |
T & | operator[] (std::size_t idx) |
const T & | operator[] (std::size_t idx) const |
Vector4< T > | operator+ (const Vector4< T > &other) const |
void | operator+= (const Vector4< T > &other) |
Vector4< T > | operator- (const Vector4< T > &other) const |
void | operator-= (const Vector4< T > &other) |
Vector4< T > | operator* (const T scale) const |
void | operator*= (const T scale) |
Vector4< T > | operator/ (const T scale) const |
void | operator/= (const T scale) |
Vector4< T > | operator* (const Matrix4x4 &mat) const |
void | operator*= (const Matrix4x4 &mat) |
Vector4< T > | operator- () const |
operator Vector2< T > () const | |
operator Vector3< T > () const | |
Conversion method. More... | |
void | operator= (const Vector4< T > &other) |
Conversion method. More... | |
void | operator= (Vector4< T > &&other) noexcept |
bool | operator== (const Vector4< T > &other) const |
bool | operator!= (const Vector4< T > &other) const |
Public Attributes | |
T | x |
T | y |
T | z |
T | w |
Static Public Attributes | |
static const Vector4< double > | up |
static const Vector4< double > | down |
static const Vector4< double > | right |
static const Vector4< double > | left |
static const Vector4< double > | forward |
static const Vector4< double > | backward |
static const Vector4< double > | future |
static const Vector4< double > | past |
static const Vector4< double > | one |
static const Vector4< double > | zero |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Vector4< T > &v) |
std::wostream & | operator<< (std::wostream &os, const Vector4< T > &v) |
Representation of a 4d vector.
Contains a lot of utility methods.
|
inline |
|
inline |
|
default |
|
defaultnoexcept |
Vector4< double > Vector4::Lerp | ( | const Vector4< T > & | other, |
double | t | ||
) | const |
Will return a lerp result between this and another vector.
Definition at line 287 of file Vector4.cpp.
void Vector4::LerpSelf | ( | const Vector4< T > & | other, |
double | t | ||
) |
Will lerp itself towards other by t.
Definition at line 267 of file Vector4.cpp.
double Vector4::Magnitude |
Will compute the magnitude.
Definition at line 38 of file Vector4.cpp.
Vector4< double > Vector4::Normalize |
Will return the normalization of this vector.
Definition at line 92 of file Vector4.cpp.
void Vector4::NormalizeSelf | ( | ) |
Vector4::operator Vector2< T > |
Definition at line 775 of file Vector4.cpp.
Vector4::operator Vector3< T > |
Conversion method.
Definition at line 781 of file Vector4.cpp.
bool Vector4::operator!= | ( | const Vector4< T > & | other | ) | const |
Definition at line 767 of file Vector4.cpp.
Definition at line 684 of file Vector4.cpp.
Vector4< T > Vector4::operator* | ( | const T | scale | ) | const |
Definition at line 512 of file Vector4.cpp.
void Vector4::operator*= | ( | const Matrix4x4 & | mat | ) |
Definition at line 752 of file Vector4.cpp.
void Vector4::operator*= | ( | const T | scale | ) |
void Vector4::operator+= | ( | const Vector4< T > & | other | ) |
Vector4< T > Vector4::operator- |
Definition at line 719 of file Vector4.cpp.
void Vector4::operator-= | ( | const Vector4< T > & | other | ) |
Vector4< T > Vector4::operator/ | ( | const T | scale | ) | const |
Definition at line 603 of file Vector4.cpp.
void Vector4::operator/= | ( | const T | scale | ) |
void Vector4::operator= | ( | const Vector4< T > & | other | ) |
|
noexcept |
bool Vector4::operator== | ( | const Vector4< T > & | other | ) | const |
T & Vector4::operator[] | ( | std::size_t | idx | ) |
const T & Vector4::operator[] | ( | std::size_t | idx | ) | const |
bool Vector4::Similar | ( | const Vector4< T > & | other, |
double | epsilon = 0.00001 |
||
) | const |
Will compare if two vectors are similar to a certain epsilon value.
Definition at line 162 of file Vector4.cpp.
double Vector4::SqrMagnitude | ( | ) | const |
Vector4< double > Vector4::ToDouble |
Will convert this vector to a Vector4d.
Definition at line 179 of file Vector4.cpp.
Vector4< int > Vector4::ToInt |
Will convert this vector to a Vector4i.
Definition at line 173 of file Vector4.cpp.
|
friend |
|
friend |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
T Eule::Vector4< T >::w |
T Eule::Vector4< T >::x |
T Eule::Vector4< T >::y |
T Eule::Vector4< T >::z |
|
static |