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

Vector.h

Go to the documentation of this file.
00001 
00002 #ifndef __VECTOR_H
00003 #define __VECTOR_H
00004 
00005 #include <ostream>
00006 
00007 class Matrix;
00008 
00020 class Vector {
00021 private:
00023     float m_data[4];
00024 
00025 private:
00027     void initialize(float x, float y, float z, float w);
00028 
00029 public:
00031     static const int X;
00033     static const int Y;
00035     static const int Z;
00037     static const int W;
00038 
00040     static const Vector ORIGIN;
00041 
00046     Vector();
00051     Vector(float x, float y, float z);
00053     Vector(float x, float y, float z, float w);
00054 
00056     float& operator[](int which);
00057 
00059     float operator[](int which) const;
00060 
00062     const float* toArray() const;
00063 
00068     const Vector normalize() const;
00069 
00076     float length() const;
00077 
00082     float dot(const Vector& vert) const;
00083 
00088     const Vector cross(const Vector& vert) const;
00089 
00099     float angle(const Vector& vert) const;
00100 
00105     const Vector add(const Vector& vert) const;
00106 
00111     const Vector subtract(const Vector& vert) const;
00112 
00114     const Vector scale(float scale) const;
00115 
00123     const Vector multiplyLeft(const Matrix& matrix) const;
00124 
00141     const Vector rangeCompress(float scale = 1.0f) const;
00142 
00147     friend std::ostream& operator<< (std::ostream& out, const Vector& vect);
00148 };
00149 
00150 #endif // __VECTOR_H

Generated on Mon Aug 25 23:40:57 2003 for Shadow by doxygen 1.3.2