]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/bvh/BVHLineSegmentVisitor.cxx
Remove using std:: from the metar header, remove HTTP support, add very basic unit...
[simgear.git] / simgear / scene / bvh / BVHLineSegmentVisitor.cxx
index d4dbd194f6b5652223cca01496b8bb409451574e..a7a4b89308555b0634090bb87d8ffd4434f05e71 100644 (file)
@@ -15,6 +15,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 
+#include <simgear/math/SGMath.hxx>
 #include "BVHLineSegmentVisitor.hxx"
 
 #include <simgear/math/SGGeometry.hxx>
@@ -31,7 +32,6 @@
 #include "BVHStaticData.hxx"
 
 #include "BVHStaticNode.hxx"
-#include "BVHStaticLeaf.hxx"
 #include "BVHStaticTriangle.hxx"
 #include "BVHStaticBinary.hxx"
 
@@ -98,6 +98,8 @@ BVHLineSegmentVisitor::apply(BVHMotionTransform& transform)
         SGVec3d localEnd = _lineSegment.getEnd();
         _lineSegment.set(lineSegment.getStart(), toWorld.xformPt(localEnd));
         _normal = toWorld.xformVec(_normal);
+        if (!_id)
+            _id = transform.getId();
     } else {
         _lineSegment = lineSegment;
         _haveHit = haveHit;
@@ -131,12 +133,6 @@ BVHLineSegmentVisitor::apply(const BVHStaticBinary& node,
     node.traverse(*this, data, _lineSegment.getStart());
 }
 
-void
-BVHLineSegmentVisitor::apply(const BVHStaticLeaf& node,
-                             const BVHStaticData& data)
-{
-}
-
 void
 BVHLineSegmentVisitor::apply(const BVHStaticTriangle& triangle,
                              const BVHStaticData& data)
@@ -150,6 +146,7 @@ BVHLineSegmentVisitor::apply(const BVHStaticTriangle& triangle,
     _linearVelocity = SGVec3d::zeros();
     _angularVelocity = SGVec3d::zeros();
     _material = data.getMaterial(triangle.getMaterialIndex());
+    _id = 0;
     _haveHit = true;
 }