diff --git a/include/osg/Vec2d b/include/osg/Vec2d index 31b0b9cb0..5af0edc94 100644 --- a/include/osg/Vec2d +++ b/include/osg/Vec2d @@ -20,11 +20,11 @@ namespace osg { -/** General purpose float pair, uses include representation of +/** General purpose double pair, uses include representation of texture coordinates. - No support yet added for float * Vec2d - is it necessary? + No support yet added for double * Vec2d - is it necessary? Need to define a non-member non-friend operator* etc. - BTW: Vec2d * float is okay + BTW: Vec2d * double is okay */ class Vec2d @@ -72,7 +72,7 @@ class Vec2d inline bool isNaN() const { return osg::isNaN(_v[0]) || osg::isNaN(_v[1]); } /// dot product - inline float operator * (const Vec2d& rhs) const + inline value_type operator * (const Vec2d& rhs) const { return _v[0]*rhs._v[0]+_v[1]*rhs._v[1]; } @@ -141,13 +141,13 @@ class Vec2d } /// Length of the vector = sqrt( vec . vec ) - inline float length() const + inline value_type length() const { return sqrtf( _v[0]*_v[0] + _v[1]*_v[1] ); } /// Length squared of the vector = vec . vec - inline float length2( void ) const + inline value_type length2( void ) const { return _v[0]*_v[0] + _v[1]*_v[1]; } diff --git a/include/osg/Vec2f b/include/osg/Vec2f index 30e5a9b58..fb35d7689 100644 --- a/include/osg/Vec2f +++ b/include/osg/Vec2f @@ -35,7 +35,7 @@ class Vec2f value_type _v[2]; Vec2f() {_v[0]=0.0; _v[1]=0.0;} - Vec2f(float x,float y) { _v[0]=x; _v[1]=y; } + Vec2f(value_type x,value_type y) { _v[0]=x; _v[1]=y; } inline bool operator == (const Vec2f& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1]; } @@ -49,37 +49,37 @@ class Vec2f else return (_v[1]0.0) { - float inv = 1.0f/norm; + value_type inv = 1.0f/norm; _v[0] *= inv; _v[1] *= inv; } diff --git a/include/osg/Vec3d b/include/osg/Vec3d index ec63f5122..e3198a900 100644 --- a/include/osg/Vec3d +++ b/include/osg/Vec3d @@ -38,7 +38,7 @@ class Vec3d inline Vec3d(const Vec3f& vec) { _v[0]=vec._v[0]; _v[1]=vec._v[1]; _v[2]=vec._v[2];} - inline operator Vec3f() const { return Vec3f(_v[0],_v[1],_v[2]);} + inline operator Vec3f() const { return Vec3f((float)_v[0],(float)_v[1],(float)_v[2]);} Vec3d(value_type x,value_type y,value_type z) { _v[0]=x; _v[1]=y; _v[2]=z; } diff --git a/include/osg/Vec4d b/include/osg/Vec4d index 456d2fb0a..7dc973d6b 100644 --- a/include/osg/Vec4d +++ b/include/osg/Vec4d @@ -55,7 +55,7 @@ class Vec4d inline Vec4d(const Vec4f& vec) { _v[0]=vec._v[0]; _v[1]=vec._v[1]; _v[2]=vec._v[2]; _v[3]=vec._v[3];} - inline operator Vec4f() const { return Vec4f(_v[0],_v[1],_v[2],_v[3]);} + inline operator Vec4f() const { return Vec4f((float)_v[0],(float)_v[1],(float)_v[2],(float)_v[3]);} inline bool operator == (const Vec4d& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2] && _v[3]==v._v[3]; }