From Bob Kuehne, addition of Vec3f(Vec2f,float) and Vec3d(Vec2d,double)

constructors.
This commit is contained in:
Robert Osfield
2004-10-18 18:36:40 +00:00
parent f86be80c20
commit b79337d7f8
2 changed files with 14 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
#ifndef OSG_VEC3D
#define OSG_VEC3D 1
#include <osg/Vec2d>
#include <osg/Vec3f>
namespace osg {
@@ -39,6 +40,12 @@ class Vec3d
inline operator Vec3f() const { return Vec3f(static_cast<float>(_v[0]),static_cast<float>(_v[1]),static_cast<float>(_v[2]));}
Vec3d(value_type x,value_type y,value_type z) { _v[0]=x; _v[1]=y; _v[2]=z; }
Vec3d(const Vec2d& v2,value_type zz)
{
_v[0] = v2[0];
_v[1] = v2[1];
_v[2] = zz;
}
inline bool operator == (const Vec3d& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2]; }

View File

@@ -16,6 +16,7 @@
#include <ostream>
#include <osg/Vec2f>
#include <osg/Math>
namespace osg {
@@ -35,6 +36,12 @@ class Vec3f
Vec3f() { _v[0]=0.0; _v[1]=0.0; _v[2]=0.0;}
Vec3f(value_type x,value_type y,value_type z) { _v[0]=x; _v[1]=y; _v[2]=z; }
Vec3f(const Vec2f& v2,value_type zz)
{
_v[0] = v2[0];
_v[1] = v2[1];
_v[2] = zz;
}
inline bool operator == (const Vec3f& v) const { return _v[0]==v._v[0] && _v[1]==v._v[1] && _v[2]==v._v[2]; }