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

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

#include <maths.h>

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

T x
 
T y
 
T z
 

Friends

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

Detailed Description

template<class T>
struct vec3_T< T >

3 element Vector class for storing x, y and z.

Template Parameters
Typeof vector

Definition at line 161 of file maths.h.

Constructor & Destructor Documentation

◆ vec3_T() [1/7]

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

Definition at line 164 of file maths.h.

◆ vec3_T() [2/7]

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

Definition at line 165 of file maths.h.

◆ vec3_T() [3/7]

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

Definition at line 166 of file maths.h.

◆ vec3_T() [4/7]

template<class T >
vec3_T< T >::vec3_T ( const glm::vec3 &  in)
inline

Definition at line 167 of file maths.h.

◆ vec3_T() [5/7]

template<class T >
vec3_T< T >::vec3_T ( const vec2_T< T > &  in)
inline

Definition at line 168 of file maths.h.

◆ vec3_T() [6/7]

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

Definition at line 169 of file maths.h.

◆ vec3_T() [7/7]

template<class T >
template<class U >
vec3_T< T >::vec3_T ( vec3_T< U > &  in)
inline

Definition at line 172 of file maths.h.

Member Function Documentation

◆ cross()

template<class T >
static vec3_T< T > vec3_T< T >::cross ( const vec3_T< T > &  a,
const vec3_T< T > &  b 
)
inlinestatic

Definition at line 293 of file maths.h.

◆ dist()

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

Definition at line 289 of file maths.h.

◆ dot()

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

Definition at line 301 of file maths.h.

◆ getmag()

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

Definition at line 174 of file maths.h.

◆ normalize() [1/2]

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

Definition at line 278 of file maths.h.

◆ normalize() [2/2]

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

Definition at line 284 of file maths.h.

◆ operator glm::vec3()

template<class T >
vec3_T< T >::operator glm::vec3 ( )
inline

Definition at line 182 of file maths.h.

◆ operator glm::vec4()

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

Definition at line 178 of file maths.h.

◆ operator!=()

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

Definition at line 269 of file maths.h.

◆ operator*() [1/2]

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

Definition at line 207 of file maths.h.

◆ operator*() [2/2]

template<class T >
vec3_T< T > vec3_T< T >::operator* ( const vec3_T< T > &  b) const
inline

Definition at line 202 of file maths.h.

◆ operator*=()

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

Definition at line 246 of file maths.h.

◆ operator+() [1/2]

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

Definition at line 186 of file maths.h.

◆ operator+() [2/2]

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

Definition at line 190 of file maths.h.

◆ operator+=()

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

Definition at line 224 of file maths.h.

◆ operator-() [1/3]

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

Definition at line 220 of file maths.h.

◆ operator-() [2/3]

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

Definition at line 194 of file maths.h.

◆ operator-() [3/3]

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

Definition at line 198 of file maths.h.

◆ operator-=()

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

Definition at line 231 of file maths.h.

◆ operator/() [1/2]

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

Definition at line 216 of file maths.h.

◆ operator/() [2/2]

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

Definition at line 211 of file maths.h.

◆ operator/=()

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

Definition at line 259 of file maths.h.

◆ operator==()

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

Definition at line 265 of file maths.h.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 273 of file maths.h.

Member Data Documentation

◆ x

template<class T >
T vec3_T< T >::x

Definition at line 162 of file maths.h.

◆ y

template<class T >
T vec3_T< T >::y

Definition at line 162 of file maths.h.

◆ z

template<class T >
T vec3_T< T >::z

Definition at line 162 of file maths.h.