Added support for intesecting Drawable that are attached directly to the scene graph without an osg::Geode
This commit is contained in:
@@ -141,6 +141,7 @@ class OSGUTIL_EXPORT IntersectVisitor : public osg::NodeVisitor
|
||||
virtual float getDistanceToEyePoint(const osg::Vec3& pos, bool withLODScale) const;
|
||||
|
||||
virtual void apply(osg::Node&);
|
||||
virtual void apply(osg::Drawable&);
|
||||
virtual void apply(osg::Geode& node);
|
||||
virtual void apply(osg::Billboard& node);
|
||||
|
||||
|
||||
@@ -258,6 +258,7 @@ class OSGUTIL_EXPORT IntersectionVisitor : public osg::NodeVisitor
|
||||
public:
|
||||
|
||||
virtual void apply(osg::Node& node);
|
||||
virtual void apply(osg::Drawable& drawable);
|
||||
virtual void apply(osg::Geode& geode);
|
||||
virtual void apply(osg::Billboard& geode);
|
||||
virtual void apply(osg::Group& group);
|
||||
|
||||
@@ -399,7 +399,6 @@ void IntersectVisitor::apply(Node& node)
|
||||
leaveNode();
|
||||
}
|
||||
|
||||
|
||||
struct TriangleHit
|
||||
{
|
||||
TriangleHit(unsigned int index, const osg::Vec3& normal, float r1, const osg::Vec3* v1, float r2, const osg::Vec3* v2, float r3, const osg::Vec3* v3):
|
||||
@@ -661,6 +660,12 @@ bool IntersectVisitor::intersect(Drawable& drawable)
|
||||
|
||||
}
|
||||
|
||||
|
||||
void IntersectVisitor::apply(Drawable& drawable)
|
||||
{
|
||||
intersect(drawable);
|
||||
}
|
||||
|
||||
void IntersectVisitor::apply(Geode& geode)
|
||||
{
|
||||
if (!enterNode(geode)) return;
|
||||
|
||||
@@ -223,6 +223,11 @@ void IntersectionVisitor::apply(osg::Group& group)
|
||||
leave();
|
||||
}
|
||||
|
||||
void IntersectionVisitor::apply(osg::Drawable& drawable)
|
||||
{
|
||||
intersect( &drawable );
|
||||
}
|
||||
|
||||
void IntersectionVisitor::apply(osg::Geode& geode)
|
||||
{
|
||||
// OSG_NOTICE<<"apply(Geode&)"<<std::endl;
|
||||
|
||||
Reference in New Issue
Block a user