//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. #ifndef OSG_VEC4 #define OSG_VEC4 1 #include #include namespace osg { /** General purpose float quad, uses include representation of colour coordinates. No support yet added for float * Vec4 - is it necessary? Need to define a non-member non-friend operator* etc. Vec4 * float is okay */ class Vec4 { public: // Methods are defined here so that they are implicitly inlined Vec4() { _v[0]=0.0f; _v[1]=0.0f; _v[2]=0.0f; _v[3]=0.0f;} Vec4(float x, float y, float z, float w) { _v[0]=x; _v[1]=y; _v[2]=z; _v[3]=w; } Vec4(const Vec3& v3,float w) { _v[0]=v3[0]; _v[1]=v3[1]; _v[2]=v3[2]; _v[3]=w; } float _v[4]; inline bool operator == (const Vec4& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; } inline bool operator != (const Vec4& v) const { return _v[0]!=v._v[0] || _v[1]!=v._v[1] || _v[2]!=v._v[2] || _v[3]!=v._v[3]; } inline bool operator < (const Vec4& v) const { if (_v[0]v._v[0]) return false; else if (_v[1]v._v[1]) return false; else if (_v[2]v._v[2]) return false; else return (_v[3]