Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Vector Class Reference

Vector Operations. More...

#include <vector.h>

List of all members.

Public Methods

 Vector ()
 Vector (GLfloat val)
 Vector (GLfloat x, GLfloat y, GLfloat z)
 Vector (Vector v)
 ~Vector ()
void operator= (Vector v)
void operator= (GLfloat val)
Vector operator+ (Vector v)
Vector operator+ (GLfloat val)
Vector operator- (Vector v)
Vector operator- (GLfloat val)
Vector operator * (Vector v)
Vector operator * (GLfloat val)

Public Attributes

GLfloat x
GLfloat y
GLfloat z


Detailed Description

Vector Operations.

Author(s):
StonedBones
Date:
????00

Definition at line 10 of file vector.h.

00010 {
00011     public:
00012     Vector ();        // zero vector
00013     Vector (GLfloat val); // x=y=z=val
00014     Vector (GLfloat x, GLfloat y, GLfloat z);
00015     Vector (Vector v);
00016     ~Vector ();
00017 
00018     GLfloat x;  // public variables to make life easier
00019     GLfloat y;
00020     GLfloat z;
00021 
00022     void    operator= (Vector v);
00023     void    operator= (GLfloat val);
00024     Vector  operator+ (Vector v);
00025     Vector  operator+ (GLfloat val);
00026     Vector  operator- (Vector v);
00027     Vector  operator- (GLfloat val);
00028     Vector  operator* (Vector v);       // vector product
00029     Vector  operator* (GLfloat val);    // scalar product
00030 }

Constructor & Destructor Documentation

Vector::Vector ()

Definition at line 3 of file vector.cpp.

00003 {
00004     x = y = z = 0;
00005 }

Vector::Vector ( GLfloat val)

Definition at line 7 of file vector.cpp.

00007 {
00008     x = y = z = val;
00009 }

Vector::Vector ( GLfloat X,
GLfloat Y,
GLfloat z)

Definition at line 11 of file vector.cpp.

00011 {
00012     x = X;
00013     y = Y;
00014     z = Z;
00015 }

Vector::Vector ( Vector v)

Definition at line 17 of file vector.cpp.

00017 {
00018     x = v.x;
00019     y = v.y;
00020     z = v.z;
00021 }

Vector::~Vector ()

Definition at line 23 of file vector.cpp.

00023 {
00024 }

Member Function Documentation

Vector Vector::operator * ( GLfloat val)

Definition at line 84 of file vector.cpp.

00084 {
00085     Vector tmp;
00086     
00087     tmp.x = x * val;
00088     tmp.y = y * val;
00089     tmp.z = z * val;
00090     
00091     return tmp;
00092 }

Vector Vector::operator * ( Vector v)

Definition at line 76 of file vector.cpp.

00076 {
00077     Vector tmp;
00078     
00079 // uhm... <blush> I can't remember how to do a vectorproduct... I'll fix this :-)
00080     
00081     return tmp;
00082 }

Vector Vector::operator+ ( GLfloat val)

Definition at line 46 of file vector.cpp.

00046 {
00047     Vector tmp;
00048     
00049     tmp.x = x + val;
00050     tmp.y = y + val;
00051     tmp.z = z + val;
00052     
00053     return tmp;
00054 }

Vector Vector::operator+ ( Vector v)

Definition at line 36 of file vector.cpp.

00036 {
00037     Vector tmp;
00038     
00039     tmp.x = x + v.x;
00040     tmp.y = y + v.y;
00041     tmp.z = z + v.z;
00042     
00043     return tmp;
00044 }

Vector Vector::operator- ( GLfloat val)

Definition at line 66 of file vector.cpp.

00066 {
00067     Vector tmp;
00068     
00069     tmp.x = x - val;
00070     tmp.y = y - val;
00071     tmp.z = z - val;
00072     
00073     return tmp;
00074 }

Vector Vector::operator- ( Vector v)

Definition at line 56 of file vector.cpp.

00056 {
00057     Vector tmp;
00058     
00059     tmp.x = x - v.x;
00060     tmp.y = y - v.y;
00061     tmp.z = z - v.z;
00062     
00063     return tmp;
00064 }

void Vector::operator= ( GLfloat val)

Definition at line 32 of file vector.cpp.

00032 {
00033     x = y = z = val;
00034 }

void Vector::operator= ( Vector v)

Definition at line 26 of file vector.cpp.

00026 {
00027     x = v.x;
00028     y = v.y;
00029     z = v.z;
00030 }

Member Data Documentation

GLfloat Vector::x

Definition at line 18 of file vector.h.

GLfloat Vector::y

Definition at line 19 of file vector.h.

GLfloat Vector::z

Definition at line 20 of file vector.h.


The documentation for this class was generated from the following files:
Generated at Sat May 13 13:50:27 2000 for 3Dsia by doxygen 1.1.2 written by Dimitri van Heesch, © 1997-2000