-
Book Overview & Buying
-
Table Of Contents
OpenSceneGraph 3.0: Beginner's Guide
OSG has its own intersection strategy that makes use of the node visitor mechanism to reduce time consumption. It is always more efficient than OpenGL's selection feature. The osgUtil::IntersectionVisitor class is the implementer. It is derived from the osg::NodeVisitor class and can test nodes' bounding volumes against the input intersector and quickly skip sub-scene graphs that are not intersectable during the traversal.
The osgUtil::IntersectionVisitor object takes an osgUtil::Intersector derived object as the argument of its constructor. It can be configured for intersection tests with several intersectors, including line segments, planes, and polytopes. An intersector can work in four kinds of coordinate system, each of which has different input parameters and can convert them to world space with different transformation matrices. In the following table, we will take the line segment intersector class osgUtil::LineSegmentIntersector, to use as an example:
|
Coordinate system... |
|---|
Change the font size
Change margin width
Change background colour