//C++ header - Open Scene Graph - Copyright (C) 1998-2001 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() {} // no operations done to maintain speed Vec4(float x, float y, float z, float w) { _v[0]=x; _v[1]=y; _v[2]=z; _v[3]=w; } float _v[4]; inline const 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 const 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 const 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]