Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
vec4 Struct Reference

4-dimensional float vector all methods stay basicly the same but with an extra dimension More...

#include <geom.hpp>

Inheritance diagram for vec4:
quat

Public Member Functions

 vec4 ()
 constructors More...
 
 vec4 (const vec &p, float w=0)
 
 vec4 (float x, float y, float z, float w)
 
 vec4 (const float *v)
 
float & operator[] (int i)
 operators for XYZ coordinate access More...
 
float operator[] (int i) const
 
template<class T >
float dot3 (const T &o) const
 dot products More...
 
float dot (const vec4 &o) const
 
float dot (const vec &o) const
 
float squaredlen () const
 
float magnitude () const
 
float magnitude3 () const
 
vec4normalize ()
 
vec4lerp (const vec4 &b, float t)
 
vec4lerp (const vec4 &a, const vec4 &b, float t)
 
vec4mul3 (float f)
 basic algebraic methods More...
 
vec4mul (float f)
 
vec4mul (const vec4 &o)
 
vec4div3 (float f)
 
vec4div (float f)
 
vec4div (const vec4 &o)
 
vec4add (const vec4 &o)
 
vec4addw (float f)
 
vec4sub (const vec4 &o)
 
vec4subw (float f)
 
vec4neg3 ()
 
vec4neg ()
 
template<class B >
vec4madd (const vec4 &a, const B &b)
 
template<class B >
vec4msub (const vec4 &a, const B &b)
 
void setxyz (const vec &v)
 
vec4rotate_around_z (float c, float s)
 rotation members More...
 
vec4rotate_around_x (float c, float s)
 
vec4rotate_around_y (float c, float s)
 
vec4rotate_around_z (float angle)
 
vec4rotate_around_x (float angle)
 
vec4rotate_around_y (float angle)
 

Public Attributes

union {
   struct {
float x
 
float y
 
float z
 
float w
 
   } 
 
   struct {
float r
 
float g
 
float b
 
float a
 
   } 
 
float v [4]
 
}; 
 

Friends

std::ostream & operator<< (std::ostream &os, const vec4 &v)
 Output operator, used for simple << vec4 << functionality: output of form "(x, y, z, w)" You may want to set the precision beforehand with std::setprecision() More...
 

Detailed Description

4-dimensional float vector all methods stay basicly the same but with an extra dimension

Constructor & Destructor Documentation

vec4::vec4 ( )
inline

constructors

Referenced by madd(), and msub().

vec4::vec4 ( const vec p,
float  w = 0 
)
inlineexplicit
vec4::vec4 ( float  x,
float  y,
float  z,
float  w 
)
inline
vec4::vec4 ( const float *  v)
inlineexplicit

Member Function Documentation

vec4& vec4::add ( const vec4 o)
inline
vec4& vec4::addw ( float  f)
inline

References f().

vec4& vec4::div ( float  f)
inline

References div3(), and f().

vec4& vec4::div ( const vec4 o)
inline
vec4& vec4::div3 ( float  f)
inline

References f().

Referenced by div().

float vec4::dot ( const vec4 o) const
inline
float vec4::dot ( const vec o) const
inline
template<class T >
float vec4::dot3 ( const T &  o) const
inline
vec4& vec4::lerp ( const vec4 b,
float  t 
)
inline

Referenced by squat::lerp().

vec4& vec4::lerp ( const vec4 a,
const vec4 b,
float  t 
)
inline
template<class B >
vec4& vec4::madd ( const vec4 a,
const B &  b 
)
inline
float vec4::magnitude ( ) const
inline

References squaredlen().

Referenced by normalize(), and dualquat::normalize().

float vec4::magnitude3 ( ) const
inline

References dot3().

template<class B >
vec4& vec4::msub ( const vec4 a,
const B &  b 
)
inline
vec4& vec4::mul ( float  f)
inline
vec4& vec4::mul ( const vec4 o)
inline
vec4& vec4::mul3 ( float  f)
inline

basic algebraic methods

References f().

Referenced by animmodel::mesh::fixqtangent(), and mul().

vec4& vec4::neg ( )
inline
vec4& vec4::neg3 ( )
inline

Referenced by quat::invert(), and neg().

vec4& vec4::normalize ( )
inline
float& vec4::operator[] ( int  i)
inline

operators for XYZ coordinate access

float vec4::operator[] ( int  i) const
inline
vec4& vec4::rotate_around_x ( float  c,
float  s 
)
inline
vec4& vec4::rotate_around_x ( float  angle)
inline

References rotate_around_x().

Referenced by rotate_around_x().

vec4& vec4::rotate_around_y ( float  c,
float  s 
)
inline
vec4& vec4::rotate_around_y ( float  angle)
inline

References rotate_around_y().

Referenced by rotate_around_y().

vec4& vec4::rotate_around_z ( float  c,
float  s 
)
inline

rotation members

vec4& vec4::rotate_around_z ( float  angle)
inline

References rotate_around_z().

Referenced by rotate_around_z().

void vec4::setxyz ( const vec v)
inline

Referenced by matrix4::settranslation().

float vec4::squaredlen ( ) const
inline

References dot().

Referenced by magnitude(), and matrix4x3::matrix4x3().

vec4& vec4::sub ( const vec4 o)
inline

Referenced by msub(), setvfcP(), and quat::sub().

vec4& vec4::subw ( float  f)
inline

References f().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const vec4 v 
)
friend

Output operator, used for simple << vec4 << functionality: output of form "(x, y, z, w)" You may want to set the precision beforehand with std::setprecision()

Member Data Documentation

union { ... }

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