Vector Class Reference
[System]

Four-component vector with dot and cross product capabilities. More...

#include <Vector.hpp>

Inheritance diagram for Vector:
Scale

List of all members.

Public Member Functions

 Vector ()
 Vector (float value)
 Vector (float x, float y)
 Vector (float x, float y, float z)
 Vector (float x, float y, float z, float w)
Vectoroperator= (const Vector &B)
Vectoroperator+= (const Vector &B)
Vectoroperator-= (const Vector &B)
Vectoroperator*= (const Vector &B)
Vectoroperator/= (const Vector &B)
Vectoroperator+= (float b)
Vectoroperator-= (float b)
Vectoroperator*= (float b)
Vectoroperator/= (float b)
float & operator[] (int i)
float operator[] (int i) const
float length () const
float get (int i) const
void set (float x, float y)
void set (float x, float y, float z)
void set (float x, float y, float z, float w)
void toArray (float array[4])

Public Attributes

int size
float x
float y
float z
float w

Friends

bool operator== (const Vector &A, const Vector &B)
Vector operator+ (const Vector &A, const Vector &B)
Vector operator- (const Vector &A, const Vector &B)
Vector operator* (const Vector &A, const Vector &B)
Vector operator/ (const Vector &A, const Vector &B)
Vector operator+ (const Vector &A, float b)
Vector operator- (const Vector &A, float b)
Vector operator* (const Vector &A, float b)
Vector operator/ (const Vector &A, float b)
ostream & operator<< (ostream &out, const Vector &A)
Vector cross (const Vector &A, const Vector &B)
float dot (const Vector &A, const Vector &B)
Vector min (const Vector &A, const Vector &B)
Vector max (const Vector &A, const Vector &B)
Vector normalize (Vector vector)

Detailed Description

Four-component vector with dot and cross product capabilities.


Constructor & Destructor Documentation

Vector (  ) 

Four-component vector initialized to all zeroes (except w=1.0).

Vector ( float  value  ) 

Four-component vector initialized to one value.

Vector ( float  x,
float  y 
)

Two-component vector.

Vector ( float  x,
float  y,
float  z 
)

Three-component vector.

Vector ( float  x,
float  y,
float  z,
float  w 
)

Four-component vector.


Member Function Documentation

float get ( int  i  )  const
Exceptions:
Exception if index out of bounds.
float length (  )  const
Returns:
length of the vector.
float operator[] ( int  i  )  const
Exceptions:
Exception if the index is out of bounds.
float & operator[] ( int  i  ) 
Exceptions:
Exception if the index is out of bounds.

Friends And Related Function Documentation

Vector cross ( const Vector A,
const Vector B 
) [friend]
Returns:
vector perpendicular to the plane formed by two vectors.
float dot ( const Vector A,
const Vector B 
) [friend]
Returns:
projection of one vector onto another.
Vector max ( const Vector A,
const Vector B 
) [friend]
Returns:
component-wise maximum of the two vectors
Vector min ( const Vector A,
const Vector B 
) [friend]
Returns:
component-wise minimum of the two vectors
Vector normalize ( Vector  vector  )  [friend]
Returns:
Unit length version of the vector.

The documentation for this class was generated from the following files:
Generated on Wed Jun 9 01:36:37 2010 for Gander by  doxygen 1.6.3