]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/bvh/BVHSubTreeCollector.cxx
Fixes for headless mode.
[simgear.git] / simgear / scene / bvh / BVHSubTreeCollector.cxx
index cc7596be384bf0e08b6fb97ef273282eaf80c9e7..5c8a915ce431c989366976cac03cd39da6c904de 100644 (file)
@@ -18,6 +18,7 @@
 #include "BVHSubTreeCollector.hxx"
 
 #include <simgear/math/SGGeometry.hxx>
+#include <cassert>
 
 #include "BVHNode.hxx"
 #include "BVHGroup.hxx"
@@ -26,7 +27,6 @@
 #include "BVHStaticData.hxx"
 
 #include "BVHStaticNode.hxx"
-#include "BVHStaticLeaf.hxx"
 #include "BVHStaticTriangle.hxx"
 #include "BVHStaticBinary.hxx"
 #include "BVHStaticGeometry.hxx"
@@ -91,7 +91,7 @@ BVHSubTreeCollector::apply(BVHMotionTransform& transform)
         return;
 
     SGSphered sphere = _sphere;
-    _sphere = transform.sphereToLocal(sphere, transform.getReferenceTime());
+    _sphere = transform.sphereToLocal(sphere, transform.getStartTime());
     _sphere.expandBy(transform.sphereToLocal(sphere, transform.getEndTime()));
     
     NodeList parentNodeList;
@@ -180,20 +180,11 @@ BVHSubTreeCollector::apply(const BVHStaticBinary& node,
     }
 }
 
-void
-BVHSubTreeCollector::apply(const BVHStaticLeaf& node,
-                           const BVHStaticData& data)
-{
-    if (!intersects(_sphere, node.computeBoundingBox(data)))
-        return;
-    _staticNode = &node;
-}
-
 void
 BVHSubTreeCollector::apply(const BVHStaticTriangle& node,
                            const BVHStaticData& data)
 {
-    if (!intersects(_sphere, node.computeBoundingBox(data)))
+    if (!intersects(_sphere, node.getTriangle(data)))
         return;
     _staticNode = &node;
 }