nCine  2025.04.r498-9d36345
A cross-platform 2D game engine
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
ncine::Vector4< T > Class Template Reference

A four component vector based on templates. More...

#include <Vector4.h>

Collaboration diagram for ncine::Vector4< T >:
Collaboration graph
[legend]

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)
 
Vector4operator= (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
 
Vector4operator+= (const Vector4 &v)
 
Vector4operator-= (const Vector4 &v)
 
Vector4operator*= (const Vector4 &v)
 
Vector4operator/= (const Vector4 &v)
 
Vector4operator+= (T s)
 
Vector4operator-= (T s)
 
Vector4operator*= (T s)
 
Vector4operator/= (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
 
length () const
 
sqrLength () const
 
Vector4 normalized () const
 
Vector4normalize ()
 
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

x
 
y
 
z
 
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 >
dot (const Vector4< S > &v1, const Vector4< S > &v2)
 

Detailed Description

template<class T>
class ncine::Vector4< T >

A four component vector based on templates.


The documentation for this class was generated from the following file: