3D City v-1.0
Computer Graphics Project
vec4_T< T > Struct Template Reference

4 element Vector class for storing x, y, z and w. More...

#include <maths.h>

Public Member Functions

 vec4_T ()
 
 vec4_T (T a)
 
 vec4_T (T a, T b, T c, T d)
 
 vec4_T (const glm::vec4 &in)
 
 vec4_T (glm::vec4 &in)
 
 vec4_T (const vec3_T< T > &in, const T &iw=1)
 
float getmag () const
 
 operator glm::vec4 ()
 
vec4_T< T > operator+ (const vec4_T< T > &b) const
 
vec4_T< T > operator+ (const T &a) const
 
vec4_T< T > operator- (const vec4_T< T > &b) const
 
vec4_T< T > operator- (T a) const
 
template<class U >
vec4_T< T > operator* (const U &a) const
 
vec4_T< T > operator/ (const vec4_T< T > &b) const
 
template<class U >
vec4_T< T > operator/ (const U &a) const
 
vec4_T< T > operator- () const
 
void operator+= (const vec4_T< T > &in)
 
void operator-= (const vec4_T< T > &in)
 
template<class U >
void operator*= (const U &in)
 
template<class U >
void operator/= (const U &in)
 
bool operator== (const vec4_T< T > &in) const
 
bool operator!= (const vec4_T< T > &in) const
 
vec4_T< T > normalize ()
 

Static Public Member Functions

static vec4_T< T > normalize (const vec4_T< T > &in)
 
static double dist (const vec4_T< T > &a, const vec4_T< T > &b)
 
static T dot (const vec4_T< T > &a, const vec4_T< T > &b)
 

Public Attributes

T x
 
T y
 
T z
 
T w
 

Friends

std::ostream & operator<< (std::ostream &out, const vec4_T< T > &vec)
 

Detailed Description

template<class T>
struct vec4_T< T >

4 element Vector class for storing x, y, z and w.

Template Parameters
Typeof vector

Definition at line 313 of file maths.h.

Constructor & Destructor Documentation

◆ vec4_T() [1/6]

template<class T >
vec4_T< T >::vec4_T ( )
inline

Definition at line 316 of file maths.h.

◆ vec4_T() [2/6]

template<class T >
vec4_T< T >::vec4_T ( T  a)
inlineexplicit

Definition at line 317 of file maths.h.

◆ vec4_T() [3/6]

template<class T >
vec4_T< T >::vec4_T ( T  a,
T  b,
T  c,
T  d 
)
inline

Definition at line 318 of file maths.h.

◆ vec4_T() [4/6]

template<class T >
vec4_T< T >::vec4_T ( const glm::vec4 &  in)
inline

Definition at line 319 of file maths.h.

◆ vec4_T() [5/6]

template<class T >
vec4_T< T >::vec4_T ( glm::vec4 &  in)
inline

Definition at line 320 of file maths.h.

◆ vec4_T() [6/6]

template<class T >
vec4_T< T >::vec4_T ( const vec3_T< T > &  in,
const T &  iw = 1 
)
inline

Definition at line 321 of file maths.h.

Member Function Documentation

◆ dist()

template<class T >
static double vec4_T< T >::dist ( const vec4_T< T > &  a,
const vec4_T< T > &  b 
)
inlinestatic

Definition at line 431 of file maths.h.

◆ dot()

template<class T >
static T vec4_T< T >::dot ( const vec4_T< T > &  a,
const vec4_T< T > &  b 
)
inlinestatic

Definition at line 435 of file maths.h.

◆ getmag()

template<class T >
float vec4_T< T >::getmag ( ) const
inline

Definition at line 323 of file maths.h.

◆ normalize() [1/2]

template<class T >
vec4_T< T > vec4_T< T >::normalize ( )
inline

Definition at line 420 of file maths.h.

◆ normalize() [2/2]

template<class T >
static vec4_T< T > vec4_T< T >::normalize ( const vec4_T< T > &  in)
inlinestatic

Definition at line 426 of file maths.h.

◆ operator glm::vec4()

template<class T >
vec4_T< T >::operator glm::vec4 ( )
inline

Definition at line 327 of file maths.h.

◆ operator!=()

template<class T >
bool vec4_T< T >::operator!= ( const vec4_T< T > &  in) const
inline

Definition at line 411 of file maths.h.

◆ operator*()

template<class T >
template<class U >
vec4_T< T > vec4_T< T >::operator* ( const U &  a) const
inline

Definition at line 347 of file maths.h.

◆ operator*=()

template<class T >
template<class U >
void vec4_T< T >::operator*= ( const U &  in)
inline

Definition at line 385 of file maths.h.

◆ operator+() [1/2]

template<class T >
vec4_T< T > vec4_T< T >::operator+ ( const T &  a) const
inline

Definition at line 334 of file maths.h.

◆ operator+() [2/2]

template<class T >
vec4_T< T > vec4_T< T >::operator+ ( const vec4_T< T > &  b) const
inline

Definition at line 330 of file maths.h.

◆ operator+=()

template<class T >
void vec4_T< T >::operator+= ( const vec4_T< T > &  in)
inline

Definition at line 363 of file maths.h.

◆ operator-() [1/3]

template<class T >
vec4_T< T > vec4_T< T >::operator- ( ) const
inline

Definition at line 359 of file maths.h.

◆ operator-() [2/3]

template<class T >
vec4_T< T > vec4_T< T >::operator- ( const vec4_T< T > &  b) const
inline

Definition at line 338 of file maths.h.

◆ operator-() [3/3]

template<class T >
vec4_T< T > vec4_T< T >::operator- ( T  a) const
inline

Definition at line 342 of file maths.h.

◆ operator-=()

template<class T >
void vec4_T< T >::operator-= ( const vec4_T< T > &  in)
inline

Definition at line 370 of file maths.h.

◆ operator/() [1/2]

template<class T >
template<class U >
vec4_T< T > vec4_T< T >::operator/ ( const U &  a) const
inline

Definition at line 355 of file maths.h.

◆ operator/() [2/2]

template<class T >
vec4_T< T > vec4_T< T >::operator/ ( const vec4_T< T > &  b) const
inline

Definition at line 350 of file maths.h.

◆ operator/=()

template<class T >
template<class U >
void vec4_T< T >::operator/= ( const U &  in)
inline

Definition at line 393 of file maths.h.

◆ operator==()

template<class T >
bool vec4_T< T >::operator== ( const vec4_T< T > &  in) const
inline

Definition at line 407 of file maths.h.

Friends And Related Function Documentation

◆ operator<<

template<class T >
std::ostream & operator<< ( std::ostream &  out,
const vec4_T< T > &  vec 
)
friend

Definition at line 415 of file maths.h.

Member Data Documentation

◆ w

template<class T >
T vec4_T< T >::w

Definition at line 314 of file maths.h.

◆ x

template<class T >
T vec4_T< T >::x

Definition at line 314 of file maths.h.

◆ y

template<class T >
T vec4_T< T >::y

Definition at line 314 of file maths.h.

◆ z

template<class T >
T vec4_T< T >::z

Definition at line 314 of file maths.h.