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