AnimatLab  2
Test
WorldCoordinateNodeVisitor.h
1 
2 #pragma once
3 
4 namespace VortexAnimatSim
5 {
6  namespace Visualization
7  {
8 
9 // Visitor to return the world coordinates of a node.
10 // It traverses from the starting node to the parent.
11 // The first time it reaches a root node, it stores the world coordinates of
12 // the node it started from. The world coordinates are found by concatenating all
13 // the matrix transforms found on the path from the start node to the root node.
14 
15 class VORTEX_PORT WorldCoordinateNodeVisitor : public osg::NodeVisitor
16 {
17 public:
19  osg::NodeVisitor(NodeVisitor::TRAVERSE_PARENTS), done(false)
20  {
21  }
22  virtual void apply(osg::Node &node);
23 
24  osg::Matrixd MatrixTransform()
25  {
26  return wcMatrix;
27  }
28 private:
29  bool done;
30  osg::Matrixd wcMatrix;
31 };
32 
33  }// end Visualization
34 }//end VortexAnimatSim
35 
36 
Classes for implementing the cm-labs vortex physics engine for AnimatLab.