diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index 6c50584f7..229a34d64 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -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 ("<_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 '"<getName()<< std::endl; osg::notify(osg::NOTICE) << " Eye Itersection Point ("<0.0f) uv = np; @@ -111,8 +111,8 @@ void DriveManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us) if (!hitList.empty()) { // notify(INFO) << "Hit terrain ok"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; - osg::Vec3 np = hitList.front()._intersectNormal; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); + osg::Vec3 np = hitList.front().getWorldIntersectNormal(); osg::Vec3 uv; if (np.z()>0.0f) uv = np; @@ -187,8 +187,8 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) if (!hitList.empty()) { // notify(INFO) << "Hit terrain ok"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; - osg::Vec3 np = hitList.front()._intersectNormal; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); + osg::Vec3 np = hitList.front().getWorldIntersectNormal(); osg::Vec3 uv; if (np.z()>0.0f) uv = np; @@ -226,8 +226,8 @@ void DriveManipulator::init(const GUIEventAdapter& ea,GUIActionAdapter& us) if (!hitList.empty()) { // notify(INFO) << "Hit terrain ok"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; - osg::Vec3 np = hitList.front()._intersectNormal; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); + osg::Vec3 np = hitList.front().getWorldIntersectNormal(); osg::Vec3 uv; if (np.z()>0.0f) uv = np; @@ -464,7 +464,7 @@ bool DriveManipulator::calcMovement() if (!hitList.empty()) { // notify(INFO) << "Hit obstruction"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); distanceToMove = (ip-ep).length()-_buffer; _velocity = 0.0f; } @@ -489,8 +489,8 @@ bool DriveManipulator::calcMovement() if (!hitList.empty()) { // notify(INFO) << "Hit terrain ok"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; - osg::Vec3 np = hitList.front()._intersectNormal; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); + osg::Vec3 np = hitList.front().getWorldIntersectNormal(); if (uv*np>0.0f) uv = np; else uv = -np; @@ -528,8 +528,8 @@ bool DriveManipulator::calcMovement() { notify(INFO) << "Hit terrain on decent ok"<< std::endl; - osg::Vec3 ip = hitList.front()._intersectPoint; - osg::Vec3 np = hitList.front()._intersectNormal; + osg::Vec3 ip = hitList.front().getWorldIntersectPoint(); + osg::Vec3 np = hitList.front().getWorldIntersectNormal(); if (uv*np>0.0f) uv = np; else uv = -np; diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index 9f656b44c..b888d00cd 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -61,9 +61,15 @@ void SceneView::setDefaults() _renderStage = new RenderStage; +#ifndef __sgi + // sgi's IR graphics has a problem with lighting and display lists, as it seems to store + // lighting state with the display list, and the display list visitor doesn't currently apply + // state before creating display lists. So will disable the init visitor default, this won't + // affect functionality since the display lists will be created as and when needed. DisplayListVisitor* dlv = new DisplayListVisitor(); dlv->setState(_state.get()); _initVisitor = dlv; +#endif _appVisitor = new AppVisitor;