Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CVector3D Class Reference

A class representing a Vector in 3D. More...

#include <Vector3D.h>

List of all members.

Public Methods

 CVector3D ()
 CVector3D (float xComp, float yComp, float zComp)
 Initialises vector with 3 float values.

virtual ~CVector3D ()
void Mult (float *matrix4D)
 Multiplicate vector with 4-dimensional homogenious matrix.

bool IsNullVector ()
 Tests if vector is 0-vector.

void SetComp (float xComp, float yComp, float zComp)
 Sets x,y and z-component of this vector.

void Normals (CVector3D *normals, int num)
 Returns array with 'num' normal vectors. More...

void Normal (CVector3D &normal)
 Returns one of the normals of this vector. More...

void Rotate (int angle, CVector3D &axis)
 Rotates vector around axis(must be unit vector!), angle is grad.

void Normalize ()
 Normalizes vector.

float Magnitude ()
 Returns magnitude of this vector.

void CrossProduct (CVector3D &source, CVector3D &dest)
 Returns cross-product of this vector and source.

float DotProduct (CVector3D &vector3D)
 Returns cross-product of this vector and parameter vector3D.


Static Public Methods

void Normals (CVector3D &unitVec, CVector3D *normals, int num)
 Returns array with 'num' normal vectors, using unitVec as axis. More...


Public Attributes

float m_XComp
 Components of vector.

float m_YComp
 Components of vector.

float m_ZComp
 Components of vector.


Detailed Description

A class representing a Vector in 3D.


Member Function Documentation

void CVector3D::Normal CVector3D &    normal
 

Returns one of the normals of this vector.

Computes normal by setting one component 0(usually the z-component), exchange the two others and negating one of the two other components(usually the y-component)

if either the x or the y-component is not 0, then the normal vector is in the x-y plane, else it is in the x-z plane. for example: normal([1,4,5]) = [-4,1,0]

void CVector3D::Normals CVector3D *    normals,
int    num
 

Returns array with 'num' normal vectors.

returns an array of normals with length 1 by computing the normal in the x-y plane (if there is one, else x-z plane), then rotating this normal around the axis specified by this vector 'num-1' times with angle 360/'num'(resulting in 'num' other normals

void CVector3D::Normals CVector3D &    unitVec,
CVector3D *    normals,
int    num
[static]
 

Returns array with 'num' normal vectors, using unitVec as axis.

returns an array of normals with length 1 by computing the normal in the x-y plane (if there is one, else x-z plane), then rotating this normal around the axis specified by unitVec 'num-1' times with angle 360/'num'(resulting in 'num' other normals


The documentation for this class was generated from the following files:
Generated on Fri Aug 9 10:12:40 2002 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002