Fixed a bug in the drive manipulator which was due to it using the local
coords of the intersection point with the scene rather than the world coord value for that point. The code now uses osgUtil::Hit::getWorldIntersectionPoint() method for getting the world coords. Added support for getWorldIntersectionPoint to Viewer.cpp. Put and #ifdef around the setting of the default display list visitor so it nolonger sets in under IRIX. This is a world around to the IR graphics imbending lighting info into display lists, if the display lists are created before state is set up it produces lighting artifacts such as flickering. Remove the the default display list init visitor removes these problems, display lists are then built on the fly and drawables a drawn for the first time.
This commit is contained in:
@@ -1053,14 +1053,14 @@ void Viewer::keyboard(unsigned char key, int x, int y)
|
||||
hitr!=hitList.end();
|
||||
++hitr)
|
||||
{
|
||||
osg::Vec3 ip = hitr->_intersectPoint;
|
||||
osg::Vec3 in = hitr->_intersectNormal;
|
||||
osg::Vec3 ip = hitr->getLocalIntersectPoint();
|
||||
osg::Vec3 in = hitr->getLocalIntersectNormal();
|
||||
osg::Geode* geode = hitr->_geode.get();
|
||||
osg::notify(osg::NOTICE) << " Itersection Point ("<<ip<<") Normal ("<<in<<")"<< std::endl;
|
||||
if (hitr->_matrix.valid())
|
||||
{
|
||||
osg::Vec3 ipEye = ip*(*(hitr->_matrix));
|
||||
osg::Vec3 inEye = (in+ip)*(*(hitr->_matrix))-ipEye;
|
||||
osg::Vec3 ipEye = hitr->getWorldIntersectPoint();
|
||||
osg::Vec3 inEye = hitr->getWorldIntersectNormal();
|
||||
inEye.normalize();
|
||||
if (geode) osg::notify(osg::NOTICE) << "Geode '"<<geode->getName()<< std::endl;
|
||||
osg::notify(osg::NOTICE) << " Eye Itersection Point ("<<ipEye<<") Normal ("<<inEye<<")"<< std::endl;
|
||||
|
||||
Reference in New Issue
Block a user