osgUtil::IntersectVisitor Class Reference

Inheritance diagram for osgUtil::IntersectVisitor:

osg::NodeVisitor osg::Referenced osgUtil::PickVisitor List of all members.

Public Types

typedef std::vector< HitHitList
typedef std::map< const osg::LineSegment *,
HitList
LineSegmentHitListMap
 USE_HIGHEST_LEVEL_OF_DETAIL
 USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION
enum  LODSelectionMode { USE_HIGHEST_LEVEL_OF_DETAIL, USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION }

Public Member Functions

 IntersectVisitor ()
virtual ~IntersectVisitor ()
void reset ()
void addLineSegment (osg::LineSegment *seg)
HitListgetHitList (const osg::LineSegment *seg)
int getNumHits (const osg::LineSegment *seg)
LineSegmentHitListMapgetSegHitList ()
bool hits ()
void setLODSelectionMode (LODSelectionMode mode)
LODSelectionMode getLODSelectionMode () const
void setEyePoint (const osg::Vec3 &eye)
virtual osg::Vec3 getEyePoint () const
virtual float getDistanceToEyePoint (const osg::Vec3 &pos, bool withLODScale) const
virtual void apply (osg::Node &)
virtual void apply (osg::Geode &node)
virtual void apply (osg::Billboard &node)
virtual void apply (osg::Group &node)
virtual void apply (osg::Transform &node)
virtual void apply (osg::Switch &node)
virtual void apply (osg::LOD &node)

Protected Types

typedef std::vector< osg::ref_ptr<
IntersectState > > 
IntersectStateStack

Protected Member Functions

bool intersect (osg::Drawable &gset)
void pushMatrix (osg::RefMatrix *matrix, osg::Transform::ReferenceFrame rf)
void popMatrix ()
bool enterNode (osg::Node &node)
void leaveNode ()

Protected Attributes

IntersectStateStack _intersectStateStack
LineSegmentHitListMap _segHitList
LODSelectionMode _lodSelectionMode
osg::Vec3 _pseudoEyePoint

Classes

class  IntersectState

Detailed Description

Basic visitor for ray based collisions of a scene.


Member Typedef Documentation

typedef std::vector<Hit> osgUtil::IntersectVisitor::HitList

typedef std::vector<osg::ref_ptr<IntersectState> > osgUtil::IntersectVisitor::IntersectStateStack [protected]

typedef std::map<const osg::LineSegment*,HitList > osgUtil::IntersectVisitor::LineSegmentHitListMap


Member Enumeration Documentation

enum osgUtil::IntersectVisitor::LODSelectionMode

Enumerator:
USE_HIGHEST_LEVEL_OF_DETAIL 
USE_SEGMENT_START_POINT_AS_EYE_POINT_FOR_LOD_LEVEL_SELECTION 


Constructor & Destructor Documentation

osgUtil::IntersectVisitor::IntersectVisitor (  ) 

virtual osgUtil::IntersectVisitor::~IntersectVisitor (  )  [virtual]


Member Function Documentation

void osgUtil::IntersectVisitor::addLineSegment ( osg::LineSegment seg  ) 

Add a line segment to use for intersection testing during scene traversal. Note, a maximum of 32 line segments can be added to a IntersectVistor, adding more than this will result in warning being emitted to the console and the excess segments being ignored.

virtual void osgUtil::IntersectVisitor::apply ( osg::LOD node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Switch node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Transform node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Group node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Billboard node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Geode node  )  [virtual]

Reimplemented from osg::NodeVisitor.

virtual void osgUtil::IntersectVisitor::apply ( osg::Node  )  [virtual]

Reimplemented from osg::NodeVisitor.

bool osgUtil::IntersectVisitor::enterNode ( osg::Node node  )  [protected]

virtual float osgUtil::IntersectVisitor::getDistanceToEyePoint ( const osg::Vec3 pos,
bool  withLODScale 
) const [virtual]

Get the distance from a point to the eye point, distance value in local coordinate system. This is calculated using the pseudo-EyePoint (above) when doing LOD calculcations.

Reimplemented from osg::NodeVisitor.

virtual osg::Vec3 osgUtil::IntersectVisitor::getEyePoint (  )  const [virtual]

Get the eye point in local coordinates. Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.

Reimplemented from osg::NodeVisitor.

HitList& osgUtil::IntersectVisitor::getHitList ( const osg::LineSegment seg  )  [inline]

LODSelectionMode osgUtil::IntersectVisitor::getLODSelectionMode (  )  const [inline]

int osgUtil::IntersectVisitor::getNumHits ( const osg::LineSegment seg  )  [inline]

LineSegmentHitListMap& osgUtil::IntersectVisitor::getSegHitList (  )  [inline]

bool osgUtil::IntersectVisitor::hits (  ) 

bool osgUtil::IntersectVisitor::intersect ( osg::Drawable gset  )  [protected]

void osgUtil::IntersectVisitor::leaveNode (  )  [protected]

void osgUtil::IntersectVisitor::popMatrix (  )  [protected]

void osgUtil::IntersectVisitor::pushMatrix ( osg::RefMatrix matrix,
osg::Transform::ReferenceFrame  rf 
) [protected]

void osgUtil::IntersectVisitor::reset (  )  [virtual]

Method to call to reset visitor. Useful if your visitor accumulates state during a traversal, and you plan to reuse the visitor. To flush that state for the next traversal: call reset() prior to each traversal.

Reimplemented from osg::NodeVisitor.

void osgUtil::IntersectVisitor::setEyePoint ( const osg::Vec3 eye  )  [inline]

Set the eye point in local coordinates. This is a pseudo-EyePoint for billboarding and LOD purposes. It is copied from the Start point of the most-recently-added segment of the intersection ray set (IntersectState::_segList).

void osgUtil::IntersectVisitor::setLODSelectionMode ( LODSelectionMode  mode  )  [inline]


Member Data Documentation

IntersectStateStack osgUtil::IntersectVisitor::_intersectStateStack [protected]

LODSelectionMode osgUtil::IntersectVisitor::_lodSelectionMode [protected]

osg::Vec3 osgUtil::IntersectVisitor::_pseudoEyePoint [protected]

LineSegmentHitListMap osgUtil::IntersectVisitor::_segHitList [protected]


The documentation for this class was generated from the following file:
Generated on Sun Oct 1 13:17:14 2006 for openscenegraph by  doxygen 1.4.7