[osg-users] Bug? Unable to pick osgSim::SphereSegment

2008-09-10 Thread Morné Pistorius
Hi all,

I seem to be unable to pick a osgSim::SphereSegment using a
LineSegmentIntersector.  I have many other models in my scene as well that
all work fine with the picker, including loaded models and manually
assembled geometries.  It is just the SphereSegment that doesn't respond.
 When I click on it, picker-containsIntersections() always returns false:

  osgUtil::LineSegmentIntersector* picker;
  picker = new osgUtil::LineSegmentIntersector(
osgUtil::Intersector::PROJECTION, ea.getXnormalized(),ea.getYnormalized() );

  osgUtil::IntersectionVisitor iv( picker );
  viewer-getCamera()-accept( iv );

  if ( picker-containsIntersections() )   -- ALWAYS FALSE
  {
osgUtil::LineSegmentIntersector::Intersection intersection =
picker-getFirstIntersection();

osg::NodePath nodePath = intersection.nodePath;
node = ( nodePath.size() = 1 )? nodePath[ nodePath.size() - 1 ] : NULL;
  }


I will investigate this further, but I was hoping someone might have some
insights as to where to look for what goes wrong.  Is this a bug or is it
something specific to SphereSegments?  (I am using OSG v2.2)

Thanks!
Morne
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bug? Unable to pick osgSim::SphereSegment

2008-09-10 Thread Robert Osfield
Hi Morné,

I've never done intersection testing against SphereSegment's before,
so don't have first hand experience to throw at the problem.  My best
guess at the lack of results is that the internal Drawable
implementation used in SphereSegmenet isn't implement the
Drawable::accept(PrimitiveFunctor) method which is the method that
the intersection code used to inquire about geometry data.  If this is
the case then one will need to implement this method as per the other
Drawable subclasses.

Robert.

On Wed, Sep 10, 2008 at 10:20 AM, Morné Pistorius
[EMAIL PROTECTED] wrote:
 Hi all,

 I seem to be unable to pick a osgSim::SphereSegment using a
 LineSegmentIntersector.  I have many other models in my scene as well that
 all work fine with the picker, including loaded models and manually
 assembled geometries.  It is just the SphereSegment that doesn't respond.
  When I click on it, picker-containsIntersections() always returns false:

   osgUtil::LineSegmentIntersector* picker;
   picker = new osgUtil::LineSegmentIntersector(
 osgUtil::Intersector::PROJECTION, ea.getXnormalized(),ea.getYnormalized() );

   osgUtil::IntersectionVisitor iv( picker );
   viewer-getCamera()-accept( iv );
   if ( picker-containsIntersections() )   -- ALWAYS FALSE
   {
 osgUtil::LineSegmentIntersector::Intersection intersection =
 picker-getFirstIntersection();
 osg::NodePath nodePath = intersection.nodePath;
 node = ( nodePath.size() = 1 )? nodePath[ nodePath.size() - 1 ] : NULL;
   }

 I will investigate this further, but I was hoping someone might have some
 insights as to where to look for what goes wrong.  Is this a bug or is it
 something specific to SphereSegments?  (I am using OSG v2.2)

 Thanks!
 Morne
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org