diff --git a/include/osg/Vec2d b/include/osg/Vec2d index 77eb694df..9f9177590 100644 --- a/include/osg/Vec2d +++ b/include/osg/Vec2d @@ -94,6 +94,14 @@ class Vec2d return *this; } + /** Unary multiply by vector. */ + inline Vec2d& operator *= (const Vec2d& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + return *this; + } + /** Divide by scalar. */ inline const Vec2d operator / (value_type rhs) const { @@ -108,6 +116,14 @@ class Vec2d return *this; } + /** Unary divide by vector. */ + inline Vec2d& operator /= (const Vec2d& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + return *this; + } + /** Binary vector add. */ inline const Vec2d operator + (const Vec2d& rhs) const { diff --git a/include/osg/Vec2f b/include/osg/Vec2f index 3e56e4321..5ca8446c2 100644 --- a/include/osg/Vec2f +++ b/include/osg/Vec2f @@ -91,6 +91,14 @@ class Vec2f return *this; } + /** Unary multiply by vector. */ + inline Vec2f& operator *= (const Vec2f& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + return *this; + } + /** Divide by scalar. */ inline const Vec2f operator / (value_type rhs) const { @@ -105,6 +113,14 @@ class Vec2f return *this; } + /** Unary divide by vector. */ + inline Vec2f& operator /= (const Vec2f& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + return *this; + } + /** Binary vector add. */ inline const Vec2f operator + (const Vec2f& rhs) const { diff --git a/include/osg/Vec3d b/include/osg/Vec3d index ca60f928d..e50d9437a 100644 --- a/include/osg/Vec3d +++ b/include/osg/Vec3d @@ -121,6 +121,15 @@ class Vec3d return *this; } + /** Unary multiply by vector. */ + inline Vec3d& operator *= (const Vec3d& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + _v[2]*=rhs[2]; + return *this; + } + /** Divide by scalar. */ inline const Vec3d operator / (value_type rhs) const { @@ -136,6 +145,15 @@ class Vec3d return *this; } + /** Unary divide by vector. */ + inline Vec3d& operator /= (const Vec3d& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + _v[2]/=rhs[2]; + return *this; + } + /** Binary vector add. */ inline const Vec3d operator + (const Vec3d& rhs) const { diff --git a/include/osg/Vec3f b/include/osg/Vec3f index 58de01350..f5d9a46f0 100644 --- a/include/osg/Vec3f +++ b/include/osg/Vec3f @@ -116,6 +116,15 @@ class Vec3f return *this; } + /** Unary multiply by vector. */ + inline Vec3f& operator *= (const Vec3f& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + _v[2]*=rhs[2]; + return *this; + } + /** Divide by scalar. */ inline const Vec3f operator / (value_type rhs) const { @@ -131,6 +140,15 @@ class Vec3f return *this; } + /** Unary divide by vector. */ + inline Vec3f& operator /= (const Vec3f& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + _v[2]/=rhs[2]; + return *this; + } + /** Binary vector add. */ inline const Vec3f operator + (const Vec3f& rhs) const { diff --git a/include/osg/Vec4d b/include/osg/Vec4d index 9d18bfdfa..f03e19c9a 100644 --- a/include/osg/Vec4d +++ b/include/osg/Vec4d @@ -151,6 +151,16 @@ class Vec4d return *this; } + /** Unary multiply by vector. */ + inline Vec4d& operator *= (const Vec4d& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + _v[2]*=rhs[2]; + _v[3]*=rhs[3]; + return *this; + } + /** Divide by scalar. */ inline Vec4d operator / (value_type rhs) const { @@ -167,6 +177,16 @@ class Vec4d return *this; } + /** Unary divide by vector. */ + inline Vec4d& operator /= (const Vec4d& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + _v[2]/=rhs[2]; + _v[3]/=rhs[3]; + return *this; + } + /** Binary vector add. */ inline Vec4d operator + (const Vec4d& rhs) const { diff --git a/include/osg/Vec4f b/include/osg/Vec4f index 6100a254c..54f17c89d 100644 --- a/include/osg/Vec4f +++ b/include/osg/Vec4f @@ -147,6 +147,16 @@ class Vec4f return *this; } + /** Unary multiply by vector. */ + inline Vec4f& operator *= (const Vec4f& rhs) + { + _v[0]*=rhs[0]; + _v[1]*=rhs[1]; + _v[2]*=rhs[2]; + _v[3]*=rhs[3]; + return *this; + } + /** Divide by scalar. */ inline Vec4f operator / (value_type rhs) const { @@ -163,6 +173,16 @@ class Vec4f return *this; } + /** Unary divide by vector. */ + inline Vec4f& operator /= (const Vec4f& rhs) + { + _v[0]/=rhs[0]; + _v[1]/=rhs[1]; + _v[2]/=rhs[2]; + _v[3]/=rhs[3]; + return *this; + } + /** Binary vector add. */ inline Vec4f operator + (const Vec4f& rhs) const {