Show
Ignore:
Timestamp:
12/16/07 14:25:40 (6 years ago)
Author:
robert
Message:

Added StateSetManipulator? for testing purposes, and fixed typo

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgforest/osgforest.cpp

    r6941 r7698  
    4343 
    4444#include <osgViewer/Viewer> 
     45#include <osgGA/StateSetManipulator> 
    4546 
    4647#include <iostream> 
     
    102103        bool divide(unsigned int maxNumTreesPerCell=10); 
    103104         
    104         bool devide(bool xAxis, bool yAxis, bool zAxis); 
     105        bool divide(bool xAxis, bool yAxis, bool zAxis); 
    105106         
    106107        void bin(); 
     
    244245    float radius = _bb.radius(); 
    245246    float divide_distance = radius*0.7f; 
    246     if (devide((_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)) 
    247248    { 
    248249        // recusively divide the new cells till maxNumTreesPerCell is met. 
     
    261262} 
    262263 
    263 bool ForestTechniqueManager::Cell::devide(bool xAxis, bool yAxis, bool zAxis) 
     264bool ForestTechniqueManager::Cell::divide(bool xAxis, bool yAxis, bool zAxis) 
    264265{ 
    265266    if (!(xAxis || yAxis || zAxis)) return false; 
     
    11001101     
    11011102    viewer.addEventHandler(new TechniqueEventHandler(ttm.get())); 
     1103    viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet())); 
    11021104 
    11031105    // add model to viewer.