From Serge Lages, "Here you can find some modifications to osgManipulator to work with double values instead of floats. Indeed I faced problems with the osgManipulator library when working with Earth based scenes, it was impossible to drag objects in a precise way if they were too far from the center of the scene."

This commit is contained in:
Robert Osfield
2008-11-21 11:23:21 +00:00
parent 672a5d14fe
commit 341abcb315
21 changed files with 261 additions and 261 deletions

View File

@@ -18,9 +18,9 @@
using namespace osgManipulator;
PointerInfo::PointerInfo():
_nearPoint(osg::Vec3()),
_farPoint(osg::Vec3()),
_eyeDir(osg::Vec3(0,0,1))
_nearPoint(osg::Vec3d()),
_farPoint(osg::Vec3d()),
_eyeDir(osg::Vec3d(0,0,1))
{
_hitIter = _hitList.begin();
}
@@ -31,10 +31,10 @@ bool PointerInfo::contains(const osg::Node* node) const
else return false;
}
bool PointerInfo::projectWindowXYIntoObject(const osg::Vec2& windowCoord, osg::Vec3& nearPoint, osg::Vec3& farPoint) const
bool PointerInfo::projectWindowXYIntoObject(const osg::Vec2d& windowCoord, osg::Vec3d& nearPoint, osg::Vec3d& farPoint) const
{
nearPoint = osg::Vec3(windowCoord.x(),windowCoord.y(),0.0f)*_inverseMVPW;
farPoint = osg::Vec3(windowCoord.x(),windowCoord.y(),1.0f)*_inverseMVPW;
nearPoint = osg::Vec3d(windowCoord.x(),windowCoord.y(),0.0)*_inverseMVPW;
farPoint = osg::Vec3d(windowCoord.x(),windowCoord.y(),1.0)*_inverseMVPW;
return true;
}