Changeset 10817

Show
Ignore:
Timestamp:
11/23/09 11:01:44 (3 years ago)
Author:
robert
Message:

From Chris Hanson, " Adds support for Vec /= Vec and Vec *= Vec operators to Vec2/Vec3/Vec4 double and float
classes."

Location:
OpenSceneGraph/trunk/include/osg
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osg/Vec2d

    r7648 r10817  
    9595        } 
    9696 
     97        /** Unary multiply by vector. */ 
     98        inline Vec2d& operator *= (const Vec2d& rhs) 
     99        { 
     100            _v[0]*=rhs[0]; 
     101            _v[1]*=rhs[1]; 
     102            return *this; 
     103        } 
     104 
    97105        /** Divide by scalar. */ 
    98106        inline const Vec2d operator / (value_type rhs) const 
     
    106114            _v[0]/=rhs; 
    107115            _v[1]/=rhs; 
     116            return *this; 
     117        } 
     118 
     119        /** Unary divide by vector. */ 
     120        inline Vec2d& operator /= (const Vec2d& rhs) 
     121        { 
     122            _v[0]/=rhs[0]; 
     123            _v[1]/=rhs[1]; 
    108124            return *this; 
    109125        } 
  • OpenSceneGraph/trunk/include/osg/Vec2f

    r5328 r10817  
    9292        } 
    9393 
     94        /** Unary multiply by vector. */ 
     95        inline Vec2f& operator *= (const Vec2f& rhs) 
     96        { 
     97            _v[0]*=rhs[0]; 
     98            _v[1]*=rhs[1]; 
     99            return *this; 
     100        } 
     101 
    94102        /** Divide by scalar. */ 
    95103        inline const Vec2f operator / (value_type rhs) const 
     
    103111            _v[0]/=rhs; 
    104112            _v[1]/=rhs; 
     113            return *this; 
     114        } 
     115 
     116        /** Unary divide by vector. */ 
     117        inline Vec2f& operator /= (const Vec2f& rhs) 
     118        { 
     119            _v[0]/=rhs[0]; 
     120            _v[1]/=rhs[1]; 
    105121            return *this; 
    106122        } 
  • OpenSceneGraph/trunk/include/osg/Vec3d

    r7648 r10817  
    122122        } 
    123123 
     124        /** Unary multiply by vector. */ 
     125        inline Vec3d& operator *= (const Vec3d& rhs) 
     126        { 
     127            _v[0]*=rhs[0]; 
     128            _v[1]*=rhs[1]; 
     129            _v[2]*=rhs[2]; 
     130            return *this; 
     131        } 
     132 
    124133        /** Divide by scalar. */ 
    125134        inline const Vec3d operator / (value_type rhs) const 
     
    134143            _v[1]/=rhs; 
    135144            _v[2]/=rhs; 
     145            return *this; 
     146        } 
     147 
     148        /** Unary divide by vector. */ 
     149        inline Vec3d& operator /= (const Vec3d& rhs) 
     150        { 
     151            _v[0]/=rhs[0]; 
     152            _v[1]/=rhs[1]; 
     153            _v[2]/=rhs[2]; 
    136154            return *this; 
    137155        } 
  • OpenSceneGraph/trunk/include/osg/Vec3f

    r7648 r10817  
    117117        } 
    118118 
     119        /** Unary multiply by vector. */ 
     120        inline Vec3f& operator *= (const Vec3f& rhs) 
     121        { 
     122            _v[0]*=rhs[0]; 
     123            _v[1]*=rhs[1]; 
     124            _v[2]*=rhs[2]; 
     125            return *this; 
     126        } 
     127 
    119128        /** Divide by scalar. */ 
    120129        inline const Vec3f operator / (value_type rhs) const 
     
    129138            _v[1]/=rhs; 
    130139            _v[2]/=rhs; 
     140            return *this; 
     141        } 
     142 
     143        /** Unary divide by vector. */ 
     144        inline Vec3f& operator /= (const Vec3f& rhs) 
     145        { 
     146            _v[0]/=rhs[0]; 
     147            _v[1]/=rhs[1]; 
     148            _v[2]/=rhs[2]; 
    131149            return *this; 
    132150        } 
  • OpenSceneGraph/trunk/include/osg/Vec4d

    r8038 r10817  
    152152        } 
    153153 
     154        /** Unary multiply by vector. */ 
     155        inline Vec4d& operator *= (const Vec4d& rhs) 
     156        { 
     157            _v[0]*=rhs[0]; 
     158            _v[1]*=rhs[1]; 
     159            _v[2]*=rhs[2]; 
     160            _v[3]*=rhs[3]; 
     161            return *this; 
     162        } 
     163 
    154164        /** Divide by scalar. */ 
    155165        inline Vec4d operator / (value_type rhs) const 
     
    165175            _v[2]/=rhs; 
    166176            _v[3]/=rhs; 
     177            return *this; 
     178        } 
     179 
     180        /** Unary divide by vector. */ 
     181        inline Vec4d& operator /= (const Vec4d& rhs) 
     182        { 
     183            _v[0]/=rhs[0]; 
     184            _v[1]/=rhs[1]; 
     185            _v[2]/=rhs[2]; 
     186            _v[3]/=rhs[3]; 
    167187            return *this; 
    168188        } 
  • OpenSceneGraph/trunk/include/osg/Vec4f

    r7648 r10817  
    148148        } 
    149149 
     150        /** Unary multiply by vector. */ 
     151        inline Vec4f& operator *= (const Vec4f& rhs) 
     152        { 
     153            _v[0]*=rhs[0]; 
     154            _v[1]*=rhs[1]; 
     155            _v[2]*=rhs[2]; 
     156            _v[3]*=rhs[3]; 
     157            return *this; 
     158        } 
     159 
    150160        /** Divide by scalar. */ 
    151161        inline Vec4f operator / (value_type rhs) const 
     
    161171            _v[2]/=rhs; 
    162172            _v[3]/=rhs; 
     173            return *this; 
     174        } 
     175 
     176        /** Unary divide by vector. */ 
     177        inline Vec4f& operator /= (const Vec4f& rhs) 
     178        { 
     179            _v[0]/=rhs[0]; 
     180            _v[1]/=rhs[1]; 
     181            _v[2]/=rhs[2]; 
     182            _v[3]/=rhs[3]; 
    163183            return *this; 
    164184        }