]> git.mxchange.org Git - simgear.git/commitdiff
Make the debug geometry stuff work with a time argument.
authorfrohlich <frohlich>
Sat, 14 Mar 2009 09:16:06 +0000 (09:16 +0000)
committerTim Moore <timoore@redhat.com>
Wed, 18 Mar 2009 06:53:50 +0000 (07:53 +0100)
Modified Files:
simgear/scene/bvh/BVHDebugCollectVisitor.hxx

simgear/scene/bvh/BVHDebugCollectVisitor.hxx

index 11bbd9f18d6b94c9ceb5abcfabf80c97b3b15d7e..07834e643df5b5010d23234c60769fc6715bf0d1 100644 (file)
@@ -55,8 +55,9 @@ class BVHStaticNode;
 
 class BVHDebugCollectVisitor : public BVHVisitor {
 public:
-    BVHDebugCollectVisitor(unsigned level = ~0u) :
+    BVHDebugCollectVisitor(const double& time, unsigned level = ~0u) :
         _group(new osg::Group),
+        _time(time),
         _level(level),
         _currentLevel(0)
     {
@@ -100,8 +101,7 @@ public:
         addNodeSphere(node);
         osg::ref_ptr<osg::Group> oldGroup = _group;
         osg::ref_ptr<osg::MatrixTransform> transform = new osg::MatrixTransform;
-        transform->setMatrix(osg::Matrix(node.getToWorldReferenceTransform().data()));
-        double tt = node.getReferenceTime() - node.getEndTime();
+        transform->setMatrix(osg::Matrix(node.getToWorldTransform(_time).data()));
         _group = transform;
         ++_currentLevel;
         node.traverse(*this);
@@ -200,6 +200,7 @@ private:
     }
     
     osg::ref_ptr<osg::Group> _group;
+    const double _time;
     const unsigned _level;
     unsigned _currentLevel;
 };