]> 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 6475ce2b1472743926f7d804a8b79251ee5be374..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>
@@ -97,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;
@@ -143,6 +146,7 @@ BVHLineSegmentVisitor::apply(const BVHStaticTriangle& triangle,
     _linearVelocity = SGVec3d::zeros();
     _angularVelocity = SGVec3d::zeros();
     _material = data.getMaterial(triangle.getMaterialIndex());
+    _id = 0;
     _haveHit = true;
 }