src/rcrt/math/Vec4D.h

Go to the documentation of this file.
00001 #ifndef VEC4D_H_
00002 #define VEC4D_H_
00003 
00004 #include "Vec3D.h"
00005 
00006 namespace rcrt
00007 {
00008 
00009 class Vec4D
00010 {
00011 private:
00012         float values[4];
00013         void assign(const Vec4D& vec);
00014         
00015 public:
00016         Vec4D();
00017         Vec4D(float xc, float yc, float zc, float wc);
00018         Vec4D(const Vec4D& vec);
00019         virtual ~Vec4D();
00020         
00021         const Vec4D& operator= (const Vec4D& vec);
00022         Vec4D operator+ (const Vec4D& vec) const;
00023         Vec4D operator- (const Vec4D& vec) const;
00024         float operator* (const Vec4D& vec) const;
00025         
00026         Vec4D operator* (const float f) const;
00027         Vec4D operator/ (const float f) const;
00028         
00029         Vec4D abs() const;
00030         const Vec4D& normalize();
00031         Vec4D normalized() const;
00032         float norm() const;
00033         
00034         Vec3D getVec3D() const;
00035         
00036         const float& x() const;
00037         const float& y() const;
00038         const float& z() const;
00039         const float& w() const;
00040 };
00041 
00042 inline std::ostream& operator<<(std::ostream& o, const Vec4D& v)
00043 {
00044         o << "V4D(" << v.x() << "," << v.y() << "," << v.z() << "," << v.w() << ")";
00045         return o;
00046 }
00047 
00048 }
00049 
00050 #endif /*VEC4D_H_*/

Generated on Thu Jan 31 19:26:19 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3