![]() |
nCine
2025.04.r498-9d36345
A cross-platform 2D game engine
|
A four component vector based on templates. More...
#include <Vector4.h>
Public Member Functions | |
Vector4 (T s) | |
Vector4 (T xx, T yy, T zz, T ww) | |
Vector4 (const Vector4 &other) | |
Vector4 (const Vector3< T > &other, T ww) | |
Vector4 (const Vector2< T > &other, T zz, T ww) | |
Vector4 & | operator= (const Vector4 &other) |
void | set (T xx, T yy, T zz, T ww) |
T * | data () |
const T * | data () const |
T & | operator[] (unsigned int index) |
const T & | operator[] (unsigned int index) const |
bool | operator== (const Vector4 &v) const |
Vector4 | operator- () const |
Vector4 & | operator+= (const Vector4 &v) |
Vector4 & | operator-= (const Vector4 &v) |
Vector4 & | operator*= (const Vector4 &v) |
Vector4 & | operator/= (const Vector4 &v) |
Vector4 & | operator+= (T s) |
Vector4 & | operator-= (T s) |
Vector4 & | operator*= (T s) |
Vector4 & | operator/= (T s) |
Vector4 | operator+ (const Vector4 &v) const |
Vector4 | operator- (const Vector4 &v) const |
Vector4 | operator* (const Vector4 &v) const |
Vector4 | operator/ (const Vector4 &v) const |
Vector4 | operator+ (T s) const |
Vector4 | operator- (T s) const |
Vector4 | operator* (T s) const |
Vector4 | operator/ (T s) const |
T | length () const |
T | sqrLength () const |
Vector4 | normalized () const |
Vector4 & | normalize () |
Vector2< T > | toVector2 () const |
Vector3< T > | toVector3 () const |
template<class S > | |
Vector4< T > | convertType (const Vector4< S > &other) |
Static Public Member Functions | |
template<class S > | |
static Vector4 | convertType (const Vector4< S > &other) |
Public Attributes | |
T | x |
T | y |
T | z |
T | w |
Static Public Attributes | |
static const Vector4 | Zero |
A vector with all zero elements. | |
static const Vector4 | XAxis |
A unit vector on the X axis. | |
static const Vector4 | YAxis |
A unit vector on the Y axis. | |
static const Vector4 | ZAxis |
A unit vector on the Z axis. | |
static const Vector4 | WAxis |
A unit vector on the W axis. | |
Friends | |
template<class S > | |
Vector4< S > | operator* (S s, const Vector4< S > &v) |
template<class S > | |
S | dot (const Vector4< S > &v1, const Vector4< S > &v2) |
A four component vector based on templates.