-// calculate the projection of u along the direction of d.
-template<typename T>
-inline SGVec3<T> SGProjection(const SGVec3<T>& u, const SGVec3<T>& d)
-{
- T denom = dot(d, d);
- if (denom == 0.) return u;
- else return d * (dot(u,d) / denom);
-}
-
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
-inline
-SGVec3d
-toSG(const osg::Vec3d& v)
-{ return SGVec3d(v[0], v[1], v[2]); }
-
-inline
-SGVec3f
-toSG(const osg::Vec3f& v)
-{ return SGVec3f(v[0], v[1], v[2]); }
-
-inline
-osg::Vec3d
-toOsg(const SGVec3d& v)
-{ return osg::Vec3d(v[0], v[1], v[2]); }
-
-inline
-osg::Vec3f
-toOsg(const SGVec3f& v)
-{ return osg::Vec3f(v[0], v[1], v[2]); }
-#endif
-