Changeset 7698 for OpenSceneGraph/trunk/examples/osgforest/osgforest.cpp
- Timestamp:
- 12/16/07 14:25:40 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgforest/osgforest.cpp
r6941 r7698 43 43 44 44 #include <osgViewer/Viewer> 45 #include <osgGA/StateSetManipulator> 45 46 46 47 #include <iostream> … … 102 103 bool divide(unsigned int maxNumTreesPerCell=10); 103 104 104 bool d evide(bool xAxis, bool yAxis, bool zAxis);105 bool divide(bool xAxis, bool yAxis, bool zAxis); 105 106 106 107 void bin(); … … 244 245 float radius = _bb.radius(); 245 246 float divide_distance = radius*0.7f; 246 if (d evide((_bb.xMax()-_bb.xMin())>divide_distance,(_bb.yMax()-_bb.yMin())>divide_distance,(_bb.zMax()-_bb.zMin())>divide_distance))247 if (divide((_bb.xMax()-_bb.xMin())>divide_distance,(_bb.yMax()-_bb.yMin())>divide_distance,(_bb.zMax()-_bb.zMin())>divide_distance)) 247 248 { 248 249 // recusively divide the new cells till maxNumTreesPerCell is met. … … 261 262 } 262 263 263 bool ForestTechniqueManager::Cell::d evide(bool xAxis, bool yAxis, bool zAxis)264 bool ForestTechniqueManager::Cell::divide(bool xAxis, bool yAxis, bool zAxis) 264 265 { 265 266 if (!(xAxis || yAxis || zAxis)) return false; … … 1100 1101 1101 1102 viewer.addEventHandler(new TechniqueEventHandler(ttm.get())); 1103 viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet())); 1102 1104 1103 1105 // add model to viewer.
