Vector Class Reference

Implements a data-structure for vectors and also contains help-methods. More...

#include <Vector.h>

Inheritance diagram for Vector:

data_t List of all members.

Public Member Functions

 Vector ()
 Constructor - sets the value of all Elements to 0.
 Vector (float _x, float _y, float _z)
 Constructor - sets the value of the elements to the value of the assigned parameter.
 Vector (Vector *v)
 Constructor - sets the value of the elements to the value of the assigned vector.
 ~Vector ()
 Destructor.
VectorcrossProduct (Vector *v2)
 Calculates the Cross-Product with the assigned Vector and return the result as a new Vector-Object.
float dotProduct (Vector *v2)
 Returns the Dot-Product with the assigned Vector.
Vectoradd (Vector *v2)
 Add the values of the assigned Vector and returns the result as a new Vector-Object.
Vectorsub (Vector *v2)
 Substract the values of the assigned Vector and returns the result as a new Vector-Object.
void normalize ()
 Normalizes the Vector.
float GetLength ()
 Return the length of the Vector.
Vector operator- (Vector &v2)
 Implements the '-' Operator for the Vector-Class.
Vector operator+ (Vector &v2)
 Implements the '+' Operator for the Vector-Class.
VectormultScalar (float scalar)
 Multiplies the assigned parameter to the elements of the Vector.
Vector rotateX (float angle)
 Calculates the new Vector, after a Rotation about the x-direction with the assigned paramter and returns the result as a new Vector-Object.
Vector rotateY (float angle)
 Calculates the new Vector, after a Rotation about the Y-direction with the assigned paramter and returns the result as a new Vector-Object.
Vector rotateZ (float angle)
 Calculates the new Vector, after a Rotation about the Z-direction with the assigned paramter and returns the result as a new Vector-Object.
Vector scale (float sx, float sy, float sz)
 Scales the Vector in the X-, Y-, Z-Direction with the assigned parameter sx (for x-direction), sy (for y-direction) and sz (for z-direction) The Result will be returned as a new Vector-Object.
Vectoroperator+= (Vector &v2)
Vectoroperator-= (Vector &v2)
Vectoroperator *= (float scalar)
Vectoroperator/= (float scalar)
float magnitude (void)
 Returns the mangitude of the Vector.
void set (float p_x, float p_y, float p_z)
 Sets the values of the elements of the vector to the values of the assigned parameters.
void set (Vector *v)
 Sets the values of the elements of the vector to the assigned Vector-parameter.
float getAngle ()

Public Attributes

float x
float y
float z

Private Member Functions

Vector matrixMult (float m[3][3])
 Implements the multiplication between a 3x3-Matrix and the Vector.

Detailed Description

Implements a data-structure for vectors and also contains help-methods.


Constructor & Destructor Documentation

Vector::Vector (  ) 

Constructor - sets the value of all Elements to 0.

Vector::Vector ( float  _x,
float  _y,
float  _z 
)

Constructor - sets the value of the elements to the value of the assigned parameter.

Vector::Vector ( Vector v  ) 

Constructor - sets the value of the elements to the value of the assigned vector.

Vector::~Vector (  ) 

Destructor.


Member Function Documentation

Vector Vector::matrixMult ( float  m[3][3]  )  [private]

Implements the multiplication between a 3x3-Matrix and the Vector.

Vector * Vector::crossProduct ( Vector v2  ) 

Calculates the Cross-Product with the assigned Vector and return the result as a new Vector-Object.

float Vector::dotProduct ( Vector v2  ) 

Returns the Dot-Product with the assigned Vector.

Vector * Vector::add ( Vector v2  ) 

Add the values of the assigned Vector and returns the result as a new Vector-Object.

Vector * Vector::sub ( Vector v2  ) 

Substract the values of the assigned Vector and returns the result as a new Vector-Object.

void Vector::normalize (  ) 

Normalizes the Vector.

float Vector::GetLength (  ) 

Return the length of the Vector.

Vector Vector::operator- ( Vector v2  ) 

Implements the '-' Operator for the Vector-Class.

Vector Vector::operator+ ( Vector v2  ) 

Implements the '+' Operator for the Vector-Class.

Vector * Vector::multScalar ( float  scalar  ) 

Multiplies the assigned parameter to the elements of the Vector.

Vector Vector::rotateX ( float  angle  ) 

Calculates the new Vector, after a Rotation about the x-direction with the assigned paramter and returns the result as a new Vector-Object.

Vector Vector::rotateY ( float  angle  ) 

Calculates the new Vector, after a Rotation about the Y-direction with the assigned paramter and returns the result as a new Vector-Object.

Vector Vector::rotateZ ( float  angle  ) 

Calculates the new Vector, after a Rotation about the Z-direction with the assigned paramter and returns the result as a new Vector-Object.

Vector Vector::scale ( float  sx,
float  sy,
float  sz 
)

Scales the Vector in the X-, Y-, Z-Direction with the assigned parameter sx (for x-direction), sy (for y-direction) and sz (for z-direction) The Result will be returned as a new Vector-Object.

Vector& Vector::operator+= ( Vector v2  )  [inline]

Vector& Vector::operator-= ( Vector v2  )  [inline]

Vector& Vector::operator *= ( float  scalar  )  [inline]

Vector& Vector::operator/= ( float  scalar  )  [inline]

float Vector::magnitude ( void   ) 

Returns the mangitude of the Vector.

void Vector::set ( float  p_x,
float  p_y,
float  p_z 
) [inline]

Sets the values of the elements of the vector to the values of the assigned parameters.

void Vector::set ( Vector v  ) 

Sets the values of the elements of the vector to the assigned Vector-parameter.

float Vector::getAngle (  )  [inline]


Member Data Documentation

float Vector::x

float Vector::y

float Vector::z


The documentation for this class was generated from the following files:
Generated on Wed Jan 17 11:58:36 2007 for VisLuBsp1 by  doxygen 1.5.1-p1