diff --git a/examples/osgpick/osgpick.cpp b/examples/osgpick/osgpick.cpp index 0f21490a6..3e6cafcab 100644 --- a/examples/osgpick/osgpick.cpp +++ b/examples/osgpick/osgpick.cpp @@ -16,9 +16,7 @@ * THE SOFTWARE. */ -/* osgpick sample -* demonstrate use of osgUtil/PickVisitor for picking in a HUD or -* in a 3d scene, +/* osgpick sample - Mouse picking in a 3d scene, */ #include diff --git a/include/osgManipulator/Dragger b/include/osgManipulator/Dragger index 80aadaeee..8bbb407a7 100644 --- a/include/osgManipulator/Dragger +++ b/include/osgManipulator/Dragger @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/include/osgUtil/IntersectVisitor b/include/osgUtil/IntersectVisitor index 1b4bbd7d6..656b6153d 100644 --- a/include/osgUtil/IntersectVisitor +++ b/include/osgUtil/IntersectVisitor @@ -29,9 +29,9 @@ namespace osgUtil { +/** Deprecated */ class OSGUTIL_EXPORT Hit { - /** Deprecated */ public: Hit(); @@ -200,7 +200,7 @@ class OSGUTIL_EXPORT IntersectVisitor : public osg::NodeVisitor osg::Vec3 _pseudoEyePoint; }; -/** Picking intersection visitor specialises the IntersectVistor to allow more convenient handling of mouse picking.*/ +/** Deprecated Use LineSegmentIntersector/IntersectionVisitor or View::computeIntersections(..).*/ class OSGUTIL_EXPORT PickVisitor : public osgUtil::IntersectVisitor { public: diff --git a/src/osgManipulator/RotateCylinderDragger.cpp b/src/osgManipulator/RotateCylinderDragger.cpp index b4b06c0b8..3a088306d 100644 --- a/src/osgManipulator/RotateCylinderDragger.cpp +++ b/src/osgManipulator/RotateCylinderDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/src/osgManipulator/RotateSphereDragger.cpp b/src/osgManipulator/RotateSphereDragger.cpp index 998b3d224..05ad799c4 100644 --- a/src/osgManipulator/RotateSphereDragger.cpp +++ b/src/osgManipulator/RotateSphereDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/src/osgManipulator/Scale1DDragger.cpp b/src/osgManipulator/Scale1DDragger.cpp index 92af9432b..a501c97ca 100644 --- a/src/osgManipulator/Scale1DDragger.cpp +++ b/src/osgManipulator/Scale1DDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/osgManipulator/Scale2DDragger.cpp b/src/osgManipulator/Scale2DDragger.cpp index c0d1cae41..4798cc74b 100644 --- a/src/osgManipulator/Scale2DDragger.cpp +++ b/src/osgManipulator/Scale2DDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/osgManipulator/ScaleAxisDragger.cpp b/src/osgManipulator/ScaleAxisDragger.cpp index 6a44d587a..997e26bd9 100644 --- a/src/osgManipulator/ScaleAxisDragger.cpp +++ b/src/osgManipulator/ScaleAxisDragger.cpp @@ -14,9 +14,8 @@ #include -#include #include -#include +#include #include using namespace osgManipulator; diff --git a/src/osgManipulator/TabPlaneDragger.cpp b/src/osgManipulator/TabPlaneDragger.cpp index 8df8cbefa..82d36d399 100644 --- a/src/osgManipulator/TabPlaneDragger.cpp +++ b/src/osgManipulator/TabPlaneDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/osgManipulator/TrackballDragger.cpp b/src/osgManipulator/TrackballDragger.cpp index f60337851..250444035 100644 --- a/src/osgManipulator/TrackballDragger.cpp +++ b/src/osgManipulator/TrackballDragger.cpp @@ -15,9 +15,8 @@ #include #include -#include +#include #include -#include #include #include #include diff --git a/src/osgManipulator/Translate1DDragger.cpp b/src/osgManipulator/Translate1DDragger.cpp index ceaf9d3b8..b44cb68d3 100644 --- a/src/osgManipulator/Translate1DDragger.cpp +++ b/src/osgManipulator/Translate1DDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/osgManipulator/Translate2DDragger.cpp b/src/osgManipulator/Translate2DDragger.cpp index 4513f38e8..e7c82eccf 100644 --- a/src/osgManipulator/Translate2DDragger.cpp +++ b/src/osgManipulator/Translate2DDragger.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include #include diff --git a/src/osgManipulator/TranslateAxisDragger.cpp b/src/osgManipulator/TranslateAxisDragger.cpp index d32718c9f..a093bb005 100644 --- a/src/osgManipulator/TranslateAxisDragger.cpp +++ b/src/osgManipulator/TranslateAxisDragger.cpp @@ -14,10 +14,8 @@ #include -#include -#include -#include #include +#include using namespace osgManipulator; diff --git a/src/osgManipulator/TranslatePlaneDragger.cpp b/src/osgManipulator/TranslatePlaneDragger.cpp index 662b73080..af9d274cd 100644 --- a/src/osgManipulator/TranslatePlaneDragger.cpp +++ b/src/osgManipulator/TranslatePlaneDragger.cpp @@ -15,6 +15,7 @@ #include #include +#include #include #include #include diff --git a/src/osgSim/VisibilityGroup.cpp b/src/osgSim/VisibilityGroup.cpp index 621ca020e..fb18d1313 100644 --- a/src/osgSim/VisibilityGroup.cpp +++ b/src/osgSim/VisibilityGroup.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include using namespace osgSim; using namespace osg; @@ -55,26 +55,21 @@ void VisibilityGroup::traverse(osg::NodeVisitor& nv) osg::Vec3 seg = center - eye; // perform the intersection using the given mask - osgUtil::IntersectVisitor iv; - osg::ref_ptr lineseg = new osg::LineSegment; - lineseg->set(eye, center); - iv.addLineSegment(lineseg.get()); + osg::ref_ptr lineseg = new osgUtil::LineSegmentIntersector(eye, center); + osgUtil::IntersectionVisitor iv(lineseg.get()); iv.setTraversalMask(_volumeIntersectionMask); if(_visibilityVolume.valid()) _visibilityVolume->accept(iv); // now examine the hit record - if(iv.hits()) + if(lineseg->containsIntersections()) { - osgUtil::IntersectVisitor::HitList& hitList = iv.getHitList(lineseg.get()); - if(!hitList.empty()) // we actually hit something - { - // OSG_INFO << "Hit obstruction"<< std::endl; - osg::Vec3 normal = hitList.front().getWorldIntersectNormal(); - if((normal*seg) > 0.f ) // we are inside - Group::traverse(nv); - } + osgUtil::LineSegmentIntersector::Intersection intersection = lineseg->getFirstIntersection(); + osg::Vec3 normal = intersection.getWorldIntersectNormal(); + + if((normal*seg) > 0.f ) // we are inside + Group::traverse(nv); } } else