Main Page   Namespace List   Alphabetical List   Data Structures   File List   Data Fields   Globals  

vec4 Class Reference


Public Methods

 vec4 (void)
 vec4 (const float x, const float y, const float z, const float w)
 vec4 (const float d)
 vec4 (const vec4 &v)
 copy constructor

 vec4 (const vec3 &v)
 cast vec3 to vec4

 vec4 (const vec3 &v, const float d)
 cast vec3 to vec4

vec4 & operator= (const vec4 &v)
 assignment of a vec4

vec4 & operator+= (const vec4 &v)
 incrementation by a vec4

vec4 & operator-= (const vec4 &v)
 decrementation by a vec4

vec4 & operator *= (const float d)
 multiplication by a constant

vec4 & operator/= (const float d)
 division by a constant

float & operator[] (int i)
 indexing

float length (void)
 length of a vec4

float length2 (void)
 squared length of a vec4

vec4 & normalize (void)
 normalize a vec4

vec4 & homogenize (void)
 puts fourth coord to 1

void print (FILE *file, char *name)
 prints vector to a file

void set (float x, float y, float z, float a)
vec4 operator- ()
 -v1

vec4 operator+ (const vec4 &b)
 v1 + v2

vec4 operator- (const vec4 &b)
 v1 - v2

vec4 operator * (const float d)
 v1 * 3.0

vec4 operator * (mat4 &a)
 v . M

float operator * (const vec4 &a)
 dot product

vec4 operator/ (const float d)
 v1 / 3.0

int operator== (const vec4 &a)
 v1 == v2 ?

int operator!= (const vec4 &a)
 v1 != v2 ?


Static Public Methods

void swap (vec4 &a, vec4 &b)
 swap v1 & v2

vec4 min (const vec4 &a, const vec4 &b)
 min(v1, v2)

vec4 max (const vec4 &a, const vec4 &b)
 max(v1, v2)

vec4 prod (const vec4 &a, const vec4 &b)
 term by term *


Protected Attributes

float n [4]

Friends

class vec3
class mat4

Detailed Description

4D Vector


Constructor & Destructor Documentation

vec4::vec4 void   
 

vec4::vec4 const float    x,
const float    y,
const float    z,
const float    w
 

vec4::vec4 const float    d
 

vec4::vec4 const vec4 &    v
 

copy constructor

vec4::vec4 const vec3   v
 

cast vec3 to vec4

vec4::vec4 const vec3   v,
const float    d
 

cast vec3 to vec4


Member Function Documentation

vec4 & vec4::homogenize void   
 

puts fourth coord to 1

float vec4::length void   
 

length of a vec4

float vec4::length2 void   
 

squared length of a vec4

vec4 vec4::max const vec4 &    a,
const vec4 &    b
[static]
 

max(v1, v2)

vec4 vec4::min const vec4 &    a,
const vec4 &    b
[static]
 

min(v1, v2)

vec4 & vec4::normalize void   
 

normalize a vec4

float vec4::operator * const vec4 &    a
 

dot product

vec4 vec4::operator * mat4   a
 

v . M

vec4 vec4::operator * const float    d
 

v1 * 3.0

vec4 & vec4::operator *= const float    d
 

multiplication by a constant

int vec4::operator!= const vec4 &    a
 

v1 != v2 ?

vec4 vec4::operator+ const vec4 &    b
 

v1 + v2

vec4 & vec4::operator+= const vec4 &    v
 

incrementation by a vec4

vec4 vec4::operator- const vec4 &    b
 

v1 - v2

vec4 vec4::operator-  
 

-v1

vec4 & vec4::operator-= const vec4 &    v
 

decrementation by a vec4

vec4 vec4::operator/ const float    d
 

v1 / 3.0

vec4 & vec4::operator/= const float    d
 

division by a constant

vec4 & vec4::operator= const vec4 &    v
 

assignment of a vec4

int vec4::operator== const vec4 &    a
 

v1 == v2 ?

float & vec4::operator[] int    i
 

indexing

void vec4::print FILE *    file,
char *    name
 

prints vector to a file

vec4 vec4::prod const vec4 &    a,
const vec4 &    b
[static]
 

term by term *

void vec4::set float    x,
float    y,
float    z,
float    a
 

void vec4::swap vec4 &    a,
vec4 &    b
[static]
 

swap v1 & v2


Friends And Related Function Documentation

friend class mat4 [friend]
 

friend class vec3 [friend]
 


Field Documentation

float vec4::n[4] [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 18 16:32:55 2004 for POVAMA by doxygen1.2.18