Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

VECTOR Class Reference

#include <vector.h>

List of all members.

Public Methods

 VECTOR (float sx=0, float sy=0, float sz=0)
 ~VECTOR ()
void Set ()
void Set (float sx, float sy, float sz)
float MagnitudeVector ()
VECTOR NormaliseVector ()
VECTOR CrossProduct (VECTOR vect)
float DotProduct (VECTOR vect)

Public Attributes

float x
float y
float z


Constructor & Destructor Documentation

VECTOR::VECTOR float    sx = 0,
float    sy = 0,
float    sz = 0
 

Definition at line 6 of file vector.cpp.

00007 :
00008     x(sx),
00009     y(sy),
00010     z(sz)
00011 {
00012 }

VECTOR::~VECTOR  
 

Definition at line 14 of file vector.cpp.

00015 {
00016 }


Member Function Documentation

VECTOR VECTOR::CrossProduct VECTOR    vect
 

Definition at line 47 of file vector.cpp.

References x, y, and z.

Referenced by QUAT::MultQuat().

00048 {
00049       VECTOR temp = *this;
00050       x = vect.y * temp.z - vect.z * temp.y;
00051       y = vect.z * temp.x - vect.x * temp.z;
00052       z = vect.x * temp.y - vect.y * temp.x;
00053         return temp;
00054 }

float VECTOR::DotProduct VECTOR    vect
 

Definition at line 40 of file vector.cpp.

References dot, x, y, and z.

Referenced by QUAT::MultQuat().

00041 {
00042       float dot;
00043       dot = vect.x * x + vect.y * y + vect.z * z;
00044       return dot;
00045 }

float VECTOR::MagnitudeVector  
 

Definition at line 25 of file vector.cpp.

References x, y, and z.

Referenced by NormaliseVector().

00026 {
00027   return(sqrt(x*x+y*y+z*z));
00028 }

VECTOR VECTOR::NormaliseVector  
 

Definition at line 30 of file vector.cpp.

References MagnitudeVector(), x, y, and z.

00031 {
00032   VECTOR vec;
00033   float temp = MagnitudeVector();
00034   vec.x = x / temp;
00035   vec.y = y / temp;
00036   vec.z = z / temp;
00037   return vec;
00038 }

void VECTOR::Set float    sx,
float    sy,
float    sz
[inline]
 

Definition at line 13 of file vector.h.

References x, y, and z.

00013 {x = sx, y = sy, z = sz;}

void VECTOR::Set  
 

Definition at line 18 of file vector.cpp.

References x, y, and z.

Referenced by OBJECT::Set(), and CAMERA::Set().

00019 {
00020     x = 0;
00021     y = 0;
00022     z = 0;
00023 }


Member Data Documentation

float VECTOR::x
 

Definition at line 19 of file vector.h.

Referenced by CAMERA::ApplyCamera(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), POLYGON::CheckForCollision(), CrossProduct(), CrossVector(), DotProduct(), DotProduct(), GetEdgeVector(), POLYGON::GetMidPoint(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), MagnitudeVector(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), NormaliseVector(), and Set().

float VECTOR::y
 

Definition at line 20 of file vector.h.

Referenced by CAMERA::ApplyCamera(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), POLYGON::CheckForCollision(), CrossProduct(), CrossVector(), DotProduct(), DotProduct(), GetEdgeVector(), POLYGON::GetMidPoint(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), MagnitudeVector(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), NormaliseVector(), and Set().

float VECTOR::z
 

Definition at line 21 of file vector.h.

Referenced by CAMERA::ApplyCamera(), AxisAngleToMatrix(), QUAT::AxisAngleToQuat(), POLYGON::CheckForCollision(), CrossProduct(), CrossVector(), DotProduct(), DotProduct(), GetEdgeVector(), POLYGON::GetMidPoint(), POLYGON::GetNormal(), GetUnitVector(), OBJECT::GetXUnit(), OBJECT::GetYUnit(), OBJECT::GetZUnit(), MagnitudeVector(), MagnitudeVector(), MATRIX::MatrixFromAxisAngle(), OBJECT::MoveX(), OBJECT::MoveY(), OBJECT::MoveZ(), QUAT::MultQuat(), MultQuat(), NormaliseVector(), and Set().


The documentation for this class was generated from the following files:
Generated on Fri Dec 23 05:19:35 2005 for OpenGL MDI 2 by doxygen1.2.15