Changeset 3205
- Timestamp:
- 07/30/04 17:44:59 (9 years ago)
- Location:
- OpenSceneGraph/trunk
- Files:
-
- 2 added
- 6 modified
-
VisualStudio/osgGA/osgGA.dsp (modified) (2 diffs)
-
examples/osglightpoint/osglightpoint.cpp (modified) (2 diffs)
-
examples/osgsimulation/osgsimulation.cpp (modified) (6 diffs)
-
include/osg/NodeVisitor (modified) (2 diffs)
-
include/osgGA/TrackerManipulator (added)
-
include/osgProducer/Viewer (modified) (1 diff)
-
src/osgGA/GNUmakefile (modified) (1 diff)
-
src/osgGA/TrackerManipulator.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/VisualStudio/osgGA/osgGA.dsp
r3181 r3205 140 140 # Begin Source File 141 141 142 SOURCE=..\..\src\osgGA\TrackerManipulator.cpp 143 # End Source File 144 # Begin Source File 145 142 146 SOURCE=..\..\src\osgGA\Version.cpp 143 147 # End Source File … … 201 205 202 206 SOURCE=..\..\Include\osgGA\TrackballManipulator 207 # End Source File 208 # Begin Source File 209 210 SOURCE=..\..\Include\osgGA\TrackerManipulator 203 211 # End Source File 204 212 # Begin Source File -
OpenSceneGraph/trunk/examples/osglightpoint/osglightpoint.cpp
r2727 r3205 2 2 #include <osgProducer/Viewer> 3 3 4 #include <osg/ Transform>4 #include <osg/MatrixTransform> 5 5 #include <osg/Billboard> 6 6 #include <osg/Geode> … … 60 60 end._color.set(1.0f,1.0f,1.0f,1.0f); 61 61 62 osg::Transform* transform = new osg::Transform; 62 osg::MatrixTransform* transform = new osg::MatrixTransform; 63 64 transform->setDataVariance(osg::Object::STATIC); 65 transform->setMatrix(osg::Matrix::scale(0.1,0.1,0.1)); 63 66 64 67 osg::Vec3 start_delta(0.0f,10.0f,0.0f); -
OpenSceneGraph/trunk/examples/osgsimulation/osgsimulation.cpp
r3098 r3205 19 19 #include <osgParticle/ParticleSystemUpdater> 20 20 21 #include <osgGA/TrackerManipulator> 22 21 23 // for the grid data.. 22 24 #include "../osghangglide/terrain_coords.h" … … 60 62 if (glider) 61 63 { 64 glider->setName("glider"); 65 62 66 const osg::BoundingSphere& bs = glider->getBound(); 63 67 … … 82 86 if (cessna) 83 87 { 88 cessna->setName("cessna"); 89 84 90 const osg::BoundingSphere& bs = cessna->getBound(); 85 91 … … 246 252 } 247 253 254 class FindNamedNodeVisitor : public osg::NodeVisitor 255 { 256 public: 257 FindNamedNodeVisitor(const std::string& name): 258 osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), 259 _name(name) {} 260 261 virtual void apply(osg::Node& node) 262 { 263 if (node.getName()==_name) 264 { 265 _foundNodes.push_back(&node); 266 } 267 traverse(node); 268 } 269 270 typedef std::vector< osg::ref_ptr<osg::Node> > NodeList; 271 272 std::string _name; 273 NodeList _foundNodes; 274 }; 275 276 248 277 249 278 ////////////////////////////////////////////////////////////////////////////// … … 268 297 // set up the value with sensible default event handlers. 269 298 viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); 299 300 270 301 271 302 // get details on keyboard and mouse bindings used by the viewer. … … 295 326 viewer.setSceneData(root); 296 327 328 329 FindNamedNodeVisitor fnnv("cessna"); 330 root->accept(fnnv); 331 332 if (!fnnv._foundNodes.empty()) 333 { 334 osgGA::TrackerManipulator* tm = new osgGA::TrackerManipulator; 335 tm->setTrackNode(fnnv._foundNodes[0].get()); 336 337 std::cout<<"Found "<<std::endl; 338 339 unsigned int num = viewer.addCameraManipulator(tm); 340 viewer.selectCameraManipulator(num); 341 } 342 343 344 297 345 // create the windows and run the threads. 298 346 viewer.realize(); -
OpenSceneGraph/trunk/include/osg/NodeVisitor
r3062 r3205 185 185 * Note, the user does not typically call pushNodeOnPath() as it 186 186 * will be called automatically by the Node::accept() method.*/ 187 inline void pushOntoNodePath(Node* node) { _nodePath.push_back(node); }187 inline void pushOntoNodePath(Node* node) { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.push_back(node); else _nodePath.insert(_nodePath.begin(),node); } 188 188 189 189 /** Method callby osg::Node::accept() method after … … 191 191 * Note, the user does not typically call pushNodeOnPath() as it 192 192 * will be called automatically by the Node::accept() method.*/ 193 inline void popFromNodePath() { _nodePath.pop_back(); }193 inline void popFromNodePath() { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.pop_back(); else _nodePath.erase(_nodePath.begin()); } 194 194 195 195 /** Get the non const NodePath from the top most node applied down -
OpenSceneGraph/trunk/include/osgProducer/Viewer
r3127 r3205 55 55 FLIGHT_MANIPULATOR = 4, 56 56 TERRAIN_MANIPULATOR = 8, 57 STATE_MANIPULATOR = 16,58 HEAD_LIGHT_SOURCE = 32,59 SKY_LIGHT_SOURCE = 64,60 STATS_MANIPULATOR = 128,61 VIEWER_MANIPULATOR = 256,62 ESCAPE_SETS_DONE = 512,57 STATE_MANIPULATOR = 32, 58 HEAD_LIGHT_SOURCE = 64, 59 SKY_LIGHT_SOURCE = 128, 60 STATS_MANIPULATOR = 256, 61 VIEWER_MANIPULATOR = 512, 62 ESCAPE_SETS_DONE = 1024, 63 63 STANDARD_SETTINGS = TRACKBALL_MANIPULATOR| 64 64 DRIVE_MANIPULATOR | -
OpenSceneGraph/trunk/src/osgGA/GNUmakefile
r2953 r3205 14 14 StateSetManipulator.cpp\ 15 15 TerrainManipulator.cpp\ 16 TrackerManipulator.cpp\ 16 17 TrackballManipulator.cpp\ 17 18 Version.cpp\
