]> git.mxchange.org Git - flightgear.git/commitdiff
bvh: Adapt to upstream bvh changes in simgear.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Fri, 24 Aug 2012 19:20:44 +0000 (21:20 +0200)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Fri, 24 Aug 2012 19:24:12 +0000 (21:24 +0200)
19 files changed:
CMakeModules/FindSimGear.cmake
src/AIModel/AIBallistic.cxx
src/AIModel/AIBallistic.hxx
src/AIModel/AIBase.cxx
src/AIModel/AIBase.hxx
src/AIModel/AIEscort.cxx
src/AIModel/AIEscort.hxx
src/AIModel/AIGroundVehicle.cxx
src/AIModel/AIGroundVehicle.hxx
src/AIModel/AIShip.cxx
src/AIModel/AIShip.hxx
src/FDM/flight.cxx
src/FDM/flight.hxx
src/FDM/groundcache.cxx
src/FDM/groundcache.hxx
src/Instrumentation/agradar.cxx
src/Instrumentation/agradar.hxx
src/Scenery/scenery.cxx
utils/fgelev/fgelev.cxx

index 448ff70e90bd4af204ed8c90dcaf3691bed04c29..4fd1550215f463439aa529eb578f1c6aaba61d81 100644 (file)
@@ -151,6 +151,7 @@ else(SIMGEAR_SHARED)
         environment
         nasal
         tsync
+        bvh
         bucket
         io
         serial
@@ -172,7 +173,6 @@ else(SIMGEAR_SHARED)
         tgdb
         model
         screen
-        bvh
         util
         sound)
             
index f7a2fc7d6c954404334871d3856bd17c2071a790..6a0565652de84fd6f2b0d49fdb0b6c69a28b6c1b 100644 (file)
@@ -498,16 +498,16 @@ void FGAIBallistic::setForcePath(const string& p) {
 }
 
 bool FGAIBallistic::getHtAGL(double start){
-
+    const SGMaterial* material = 0;
     if (getGroundElevationM(SGGeod::fromGeodM(pos, start),
-        _elevation_m, &_material)) {
+        _elevation_m, &material)) {
             _ht_agl_ft = pos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
 
-            if (_material) {
-                const vector<string>& names = _material->get_names();
-                _solid = _material->get_solid();
-                _load_resistance = _material->get_load_resistance();
-                _frictionFactor =_material->get_friction_factor();
+            if (material) {
+                const vector<string>& names = material->get_names();
+                _solid = material->get_solid();
+                _load_resistance = material->get_load_resistance();
+                _frictionFactor = material->get_friction_factor();
 
                 if (!names.empty())
                     props->setStringValue("material/name", names[0].c_str());
index 63d55bd95f0912199f4875e1bc33d351aada57e5..9b28efdae9144de7c0940f4473bbe8306eb36ca1 100644 (file)
@@ -219,8 +219,6 @@ private:
     string _force_path;
     string _contents_path;
 
-    const SGMaterial* _material;
-
     void handle_collision();
     void handle_expiry();
     void handle_impact();
index 90bf34f4d3cfb17dfe604988dfe365ccc0fa2751..ed6d0a9d9d0c0e4efdfd1acca4b7a8a456fe52ea 100644 (file)
@@ -729,7 +729,7 @@ double FGAIBase::_getAltitude() const {
 
 double FGAIBase::_getAltitudeAGL(SGGeod inpos, double start){
     getGroundElevationM(SGGeod::fromGeodM(inpos, start),
-        _elevation_m, &_material);
+        _elevation_m, NULL);
     return inpos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
 }
 
index 8c3601b6d918e39acc144fddbcca6d8fa9e6082e..a492b9b2ccaa54b3e70618de5510252b214cd8f6 100644 (file)
@@ -117,7 +117,6 @@ public:
         const SGMaterial** material) const;
 
     double _elevation_m;
-    const SGMaterial* _material;
 
     double _getCartPosX() const;
     double _getCartPosY() const;
index afe0ee8c92bb7f8fd6e8eff81728ee288d649d8a..765cac8dbd9e5d9cffded5605df6fbd7d4b69e11 100644 (file)
@@ -190,13 +190,14 @@ bool FGAIEscort::getGroundElev(SGGeod inpos) {
 
     double height_m ;
 
-    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &_material,0)){
+    const SGMaterial* material = 0;
+    if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(inpos, 3000), height_m, &material,0)){
         _ht_agl_ft = inpos.getElevationFt() - height_m * SG_METER_TO_FEET;
 
-        if (_material) {
-            const vector<string>& names = _material->get_names();
+        if (material) {
+            const vector<string>& names = material->get_names();
 
-            _solid = _material->get_solid();
+            _solid = material->get_solid();
 
             if (!names.empty())
                 props->setStringValue("material/name", names[0].c_str());
index 380a92f28f5d6fd40b4737bd069fd9a5447bffb0..38531eb55a4cc0b2583022a853e8ab19840b7ce9 100644 (file)
@@ -89,8 +89,6 @@ private:
 
     double _max_speed;
 
-    const SGMaterial* _material;
-
     bool _MPControl, _patrol, _stn_deg_true;
 
 //    std::string _parent;
index f5f2b8832dcee3994902195deef2ebfd0ac4d15c..b813b3c8211f3e3b2cf1d3f0f72366db4a70ec90 100644 (file)
@@ -237,13 +237,13 @@ bool FGAIGroundVehicle::getPitch() {
         //double max_alt = 10000;
 
         if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodFront, 3000),
-            elev_front, &_material, 0)){
+            elev_front, NULL, 0)){
                 front_elev_m = elev_front + _z_offset_m;
         } else
             return false;
 
         if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(geodRear, 3000),
-            elev_rear, &_material, 0)){
+            elev_rear, NULL, 0)){
                 rear_elev_m = elev_rear;
         } else
             return false;
index 2e4a2349fc37db24ebbed6cef7b34970c8d56544..fcb822a3cca0396336e4a8d9f80a88955cd95e55 100644 (file)
@@ -93,8 +93,6 @@ private:
     double _hitch_x_offset_m, _hitch_y_offset_m, _hitch_z_offset_m;
     double _dt_count, _next_run, _break_count;
 
-    const SGMaterial* _material;
-
 };
 
 #endif  // FG_AIGROUNDVEHICLE_HXX
index 9ecc89175488c88a3eca578f26515d92ed98ec74..3d2263629c9d43372edec0a65f34e53e9a66d8f5 100644 (file)
@@ -1050,7 +1050,7 @@ void FGAIShip::setWPPos() {
     if (curr->getOn_ground()){
 
         if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(wppos, 3000),
-            elevation_m, &_material, 0)){
+            elevation_m, NULL, 0)){
                 wppos.setElevationM(elevation_m);
         }
 
index 74a5ca2e710b4861be2b7b2ec9d888abb4e90cc7..34038db90200615172e7dc20d3f0ba739096e6d1 100644 (file)
@@ -107,8 +107,6 @@ private:
 
     SGGeod wppos;
 
-    const SGMaterial* _material;
-
     double getRange(double lat, double lon, double lat2, double lon2) const;
     double getCourse(double lat, double lon, double lat2, double lon2) const;
     double getDaySeconds();
index 5fd06bad9176f6ff56ac972e81b84eb46a641f37..8e1ca2439efbb28d4a632744c4dcec39da9ef39c 100644 (file)
@@ -29,6 +29,7 @@
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/timing/timestamp.hxx>
+#include <simgear/scene/material/mat.hxx>
 
 #include <Scenery/scenery.hxx>
 #include <Main/globals.hxx>
@@ -696,9 +697,9 @@ FGInterface::get_agl_m(double t, const double pt[3], double max_altoff,
 {
   SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
   SGVec3d _contact, _normal, _linearVel, _angularVel;
-  material = 0;
+  const simgear::BVHMaterial* m = 0;
   bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
-                                  _angularVel, id, material);
+                                  _angularVel, id, m);
   // correct the linear velocity, since the line intersector delivers
   // values for the start point and the get_agl function should
   // traditionally deliver for the contact point
@@ -708,6 +709,7 @@ FGInterface::get_agl_m(double t, const double pt[3], double max_altoff,
   assign(normal, _normal);
   assign(linearVel, _linearVel);
   assign(angularVel, _angularVel);
+  material = dynamic_cast<const SGMaterial*>(m);
   return ret;
 }
 
@@ -721,9 +723,9 @@ FGInterface::get_agl_ft(double t, const double pt[3], double max_altoff,
   SGVec3d pt_m = SGVec3d(pt) - max_altoff*ground_cache.get_down();
   pt_m *= SG_FEET_TO_METER;
   SGVec3d _contact, _normal, _linearVel, _angularVel;
-  material = 0;
+  const simgear::BVHMaterial* m = 0;
   bool ret = ground_cache.get_agl(t, pt_m, _contact, _normal, _linearVel,
-                                  _angularVel, id, material);
+                                  _angularVel, id, m);
   // correct the linear velocity, since the line intersector delivers
   // values for the start point and the get_agl function should
   // traditionally deliver for the contact point
@@ -734,6 +736,7 @@ FGInterface::get_agl_ft(double t, const double pt[3], double max_altoff,
   assign( normal, _normal );
   assign( linearVel, SG_METER_TO_FEET*_linearVel );
   assign( angularVel, _angularVel );
+  material = dynamic_cast<const SGMaterial*>(m);
   return ret;
 }
 
@@ -745,13 +748,15 @@ FGInterface::get_nearest_m(double t, const double pt[3], double maxDist,
                            simgear::BVHNode::Id& id)
 {
   SGVec3d _contact, _linearVel, _angularVel;
+  const simgear::BVHMaterial* m = 0;
   if (!ground_cache.get_nearest(t, SGVec3d(pt), maxDist, _contact, _linearVel,
-                                _angularVel, id, material))
+                                _angularVel, id, m))
       return false;
 
   assign(contact, _contact);
   assign(linearVel, _linearVel);
   assign(angularVel, _angularVel);
+  material = dynamic_cast<const SGMaterial*>(m);
   return true;
 }
 
@@ -763,14 +768,16 @@ FGInterface::get_nearest_ft(double t, const double pt[3], double maxDist,
                             simgear::BVHNode::Id& id)
 {
   SGVec3d _contact, _linearVel, _angularVel;
+  const simgear::BVHMaterial* m = 0;
   if (!ground_cache.get_nearest(t, SG_FEET_TO_METER*SGVec3d(pt),
                                 SG_FEET_TO_METER*maxDist, _contact, _linearVel,
-                                _angularVel, id, material))
+                                _angularVel, id, m))
       return false;
 
   assign(contact, SG_METER_TO_FEET*_contact);
   assign(linearVel, SG_METER_TO_FEET*_linearVel);
   assign(angularVel, _angularVel);
+  material = dynamic_cast<const SGMaterial*>(m);
   return true;
 }
 
index 9c312f33dcd280b21cfd0ead54e16737c72b1314..a2047aef90fe0a49eea5346b1b9fbafdddf64cca 100644 (file)
@@ -89,6 +89,8 @@ using std::list;
 using std::vector;
 using std::string;
 
+class SGMaterial;
+
 /**
  * A little helper class to update the track if
  * the position has changed. In the constructor, 
index 21d2816d6fef4baa8579441f76805efec933b565..0e2d43b5b96c0b01a62cfd531104b36be1a73fc1 100644 (file)
 #include <simgear/scene/util/SGSceneUserData.hxx>
 #include <simgear/scene/util/OsgMath.hxx>
 
-#include <simgear/scene/bvh/BVHNode.hxx>
-#include <simgear/scene/bvh/BVHGroup.hxx>
-#include <simgear/scene/bvh/BVHTransform.hxx>
-#include <simgear/scene/bvh/BVHMotionTransform.hxx>
-#include <simgear/scene/bvh/BVHLineGeometry.hxx>
-#include <simgear/scene/bvh/BVHStaticGeometry.hxx>
-#include <simgear/scene/bvh/BVHStaticData.hxx>
-#include <simgear/scene/bvh/BVHStaticNode.hxx>
-#include <simgear/scene/bvh/BVHStaticTriangle.hxx>
-#include <simgear/scene/bvh/BVHStaticBinary.hxx>
-#include <simgear/scene/bvh/BVHSubTreeCollector.hxx>
-#include <simgear/scene/bvh/BVHLineSegmentVisitor.hxx>
-#include <simgear/scene/bvh/BVHNearestPointVisitor.hxx>
+#include <simgear/bvh/BVHNode.hxx>
+#include <simgear/bvh/BVHGroup.hxx>
+#include <simgear/bvh/BVHTransform.hxx>
+#include <simgear/bvh/BVHMotionTransform.hxx>
+#include <simgear/bvh/BVHLineGeometry.hxx>
+#include <simgear/bvh/BVHStaticGeometry.hxx>
+#include <simgear/bvh/BVHStaticData.hxx>
+#include <simgear/bvh/BVHStaticNode.hxx>
+#include <simgear/bvh/BVHStaticTriangle.hxx>
+#include <simgear/bvh/BVHStaticBinary.hxx>
+#include <simgear/bvh/BVHSubTreeCollector.hxx>
+#include <simgear/bvh/BVHLineSegmentVisitor.hxx>
+#include <simgear/bvh/BVHNearestPointVisitor.hxx>
 
 #ifdef GROUNDCACHE_DEBUG
-#include <simgear/scene/bvh/BVHDebugCollectVisitor.hxx>
+#include <simgear/scene/model/BVHDebugCollectVisitor.hxx>
 #include <Main/fg_props.hxx>
 #endif
 
@@ -149,7 +149,7 @@ public:
         SGVec3d down = _down;
         double radius = _radius;
         bool haveHit = _haveHit;
-        const SGMaterial* material = _material;
+        const simgear::BVHMaterial* material = _material;
 
         _haveHit = false;
         _center = toSG(inverseMatrix.preMult(toOsg(_center)));
@@ -275,7 +275,7 @@ public:
     { return _haveHit; }
     double getElevationBelowCache() const
     { return SGGeod::fromCart(_sceneryHit).getElevationM(); }
-    const SGMaterial* getMaterialBelowCache() const
+    const simgear::BVHMaterial* getMaterialBelowCache() const
     { return _material; }
     
 private:
@@ -288,7 +288,7 @@ private:
     simgear::BVHSubTreeCollector mSubTreeCollector;
     SGVec3d _sceneryHit;
     double _maxDown;
-    const SGMaterial* _material;
+    const simgear::BVHMaterial* _material;
     bool _haveHit;
 };
 
@@ -381,8 +381,10 @@ FGGroundCache::prepare_ground_cache(double startSimTime, double endSimTime,
     if (!found_ground) {
         // Ok, still nothing here?? Last resort ...
         double alt = 0;
+        const SGMaterial* m = NULL;
         found_ground = globals->get_scenery()->
-            get_elevation_m(SGGeod::fromGeodM(geodPt, 10000), alt, &_material);
+            get_elevation_m(SGGeod::fromGeodM(geodPt, 10000), alt, &m);
+        _material = m;
         if (found_ground)
             _altitude = alt;
     }
@@ -456,6 +458,12 @@ public:
             return;
         leaf.traverse(*this);
     }
+    virtual void apply(BVHPageNode& leaf)
+    {
+        if (_foundId)
+            return;
+        leaf.traverse(*this);
+    }
     virtual void apply(BVHTransform& transform)
     {
         if (_foundId)
@@ -553,6 +561,12 @@ public:
             return;
         leaf.traverse(*this);
     }
+    virtual void apply(BVHPageNode& leaf)
+    {
+        if (!intersects(_sphere, leaf.getBoundingSphere()))
+            return;
+        leaf.traverse(*this);
+    }
     virtual void apply(BVHTransform& transform)
     {
         if (!intersects(_sphere, transform.getBoundingSphere()))
@@ -678,7 +692,7 @@ FGGroundCache::get_cat(double t, const SGVec3d& pt,
 bool
 FGGroundCache::get_agl(double t, const SGVec3d& pt, SGVec3d& contact,
                        SGVec3d& normal, SGVec3d& linearVel, SGVec3d& angularVel,
-                       simgear::BVHNode::Id& id, const SGMaterial*& material)
+                       simgear::BVHNode::Id& id, const simgear::BVHMaterial*& material)
 {
 #ifdef GROUNDCACHE_DEBUG
     SGTimeStamp t0 = SGTimeStamp::now();
@@ -731,7 +745,7 @@ bool
 FGGroundCache::get_nearest(double t, const SGVec3d& pt, double maxDist,
                            SGVec3d& contact, SGVec3d& linearVel,
                            SGVec3d& angularVel, simgear::BVHNode::Id& id,
-                           const SGMaterial*& material)
+                           const simgear::BVHMaterial*& material)
 {
     if (!_localBvhTree)
         return false;
@@ -787,6 +801,13 @@ public:
 
         leaf.traverse(*this);
     }
+    virtual void apply(BVHPageNode& leaf)
+    {
+        if (!_intersects(leaf.getBoundingSphere()))
+            return;
+
+        leaf.traverse(*this);
+    }
     virtual void apply(BVHTransform& transform)
     {
         if (!_intersects(transform.getBoundingSphere()))
@@ -920,6 +941,12 @@ public:
             return;
         leaf.traverse(*this);
     }
+    virtual void apply(BVHPageNode& leaf)
+    {
+        if (_haveLineSegment)
+            return;
+        leaf.traverse(*this);
+    }
     virtual void apply(BVHTransform& transform)
     {
         if (_haveLineSegment)
index 145561a9c571589b47f1075e8d7be5735de6de2b..9319666a6ba83508f9f1c364ab8d9e624ba740ed 100644 (file)
@@ -27,7 +27,7 @@
 #include <simgear/constants.h>
 #include <simgear/math/SGMath.hxx>
 #include <simgear/math/SGGeometry.hxx>
-#include <simgear/scene/bvh/BVHNode.hxx>
+#include <simgear/bvh/BVHNode.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
 
 // #define GROUNDCACHE_DEBUG
@@ -37,9 +37,9 @@
 #include <simgear/timing/timestamp.hxx>
 #endif
 
-class SGMaterial;
 namespace simgear {
 class BVHLineGeometry;
+class BVHMaterial;
 }
 
 class FGGroundCache {
@@ -89,11 +89,13 @@ public:
     // 0 and 1 which can be used to model lower friction with wet runways.
     bool get_agl(double t, const SGVec3d& pt, SGVec3d& contact,
                  SGVec3d& normal, SGVec3d& linearVel, SGVec3d& angularVel,
-                 simgear::BVHNode::Id& id, const SGMaterial*& material);
+                 simgear::BVHNode::Id& id,
+                 const simgear::BVHMaterial*& material);
 
     bool get_nearest(double t, const SGVec3d& pt, double maxDist,
                      SGVec3d& contact, SGVec3d& linearVel, SGVec3d& angularVel,
-                     simgear::BVHNode::Id& id, const SGMaterial*& material);
+                     simgear::BVHNode::Id& id,
+                     const simgear::BVHMaterial*& material);
 
     // Return 1 if the hook intersects with a wire.
     // That test is done by checking if the quad spanned by the points pt*
@@ -120,7 +122,7 @@ private:
     // In case the aircraft is too high above ground.
     double _altitude;
     // the simgear material reference, contains friction coeficients ...
-    const SGMaterial* _material;
+    const simgear::BVHMaterial* _material;
     // The time reference for later call to intersection test routines.
     // Is required since we will have moving triangles in carriers.
     double cache_ref_time;
index e5be21b86332a2066333b7ead655e29d6c31088b..23cf6f3ebe750d74c7dc3ed3809025be5800e106 100644 (file)
@@ -210,18 +210,19 @@ agRadar::setUserVec(double az, double el)
 bool
 agRadar::getMaterial(){
 
-    if (globals->get_scenery()->get_elevation_m(hitpos, _elevation_m, &_material)){
+    const SGMaterial* material = 0;
+    if (globals->get_scenery()->get_elevation_m(hitpos, _elevation_m, &material)){
         //_ht_agl_ft = pos.getElevationFt() - _elevation_m * SG_METER_TO_FEET;
-        if (_material) {
-            const std::vector<std::string>& names = _material->get_names();
+        if (material) {
+            const std::vector<std::string>& names = material->get_names();
 
-            _solid = _material->get_solid();
-            _load_resistance = _material->get_load_resistance();
-            _frictionFactor =_material->get_friction_factor();
-            _bumpinessFactor = _material->get_bumpiness();
+            _solid = material->get_solid();
+            _load_resistance = material->get_load_resistance();
+            _frictionFactor = material->get_friction_factor();
+            _bumpinessFactor = material->get_bumpiness();
 
             if (!names.empty()) 
-                _mat_name = names[0].c_str();
+                _mat_name = names[0];
             else
                 _mat_name = "";
 
index 609f54f41805507a4dbf0f800c583cda46d641e5..dda152e0b23c351f171e60ca0ec3b48d6993f026 100644 (file)
@@ -53,8 +53,6 @@ public:
     double _elevation_m;        // ground elevation in meters
     bool   _solid;              // if true ground is solid for FDMs
 
-    const SGMaterial* _material;
-
     std::string _mat_name; // ground material
 
     SGVec3d getCartUserPos() const;
index ba67e1f8ff6cdf30ff496ede115339a515f3663c..9c6ef27960f38f48a93710bfc7851881dabdeb66 100644 (file)
@@ -43,8 +43,8 @@
 #include <simgear/scene/util/OsgMath.hxx>
 #include <simgear/scene/util/SGSceneUserData.hxx>
 #include <simgear/scene/model/CheckSceneryVisitor.hxx>
-#include <simgear/scene/bvh/BVHNode.hxx>
-#include <simgear/scene/bvh/BVHLineSegmentVisitor.hxx>
+#include <simgear/bvh/BVHNode.hxx>
+#include <simgear/bvh/BVHLineSegmentVisitor.hxx>
 
 #include <Viewer/renderer.hxx>
 #include <Main/fg_props.hxx>
@@ -92,7 +92,7 @@ public:
     { return _haveHit; }
     const SGLineSegmentd& getLineSegment() const
     { return _lineSegment; }
-    const SGMaterial* getMaterial() const
+    const simgear::BVHMaterial* getMaterial() const
     { return _material; }
 
     virtual void apply(osg::Node& node)
@@ -152,7 +152,7 @@ private:
 
         SGLineSegmentd lineSegment = _lineSegment;
         bool haveHit = _haveHit;
-        const SGMaterial* material = _material;
+        const simgear::BVHMaterial* material = _material;
 
         _haveHit = false;
         _lineSegment = lineSegment.transform(SGMatrixd(inverseMatrix.ptr()));
@@ -205,7 +205,7 @@ private:
     SGLineSegmentd _lineSegment;
     const osg::Node* _skipNode;
 
-    const SGMaterial* _material;
+    const simgear::BVHMaterial* _material;
     bool _haveHit;
 };
 
@@ -290,7 +290,7 @@ FGScenery::get_elevation_m(const SGGeod& geod, double& alt,
   geodEnd = SGGeod::fromCart(intersectVisitor.getLineSegment().getEnd());
   alt = geodEnd.getElevationM();
   if (material)
-      *material = intersectVisitor.getMaterial();
+      *material = dynamic_cast<const SGMaterial*>(intersectVisitor.getMaterial());
 
   return true;
 }
index e2f4f9f4ff3e8688369e4b81cfebe85ab66e48b0..20a093e3555d7574f997e6adf3c597504822e1f9 100644 (file)
@@ -34,6 +34,7 @@
 #include <simgear/props/props.hxx>
 #include <simgear/props/props_io.hxx>
 #include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/util/OsgMath.hxx>
 #include <simgear/scene/util/SGNodeMasks.hxx>
 #include <simgear/scene/util/SGReaderWriterOptions.hxx>
 #include <simgear/scene/util/SGSceneFeatures.hxx>
@@ -41,9 +42,8 @@
 #include <simgear/scene/tgdb/userdata.hxx>
 #include <simgear/scene/model/ModelRegistry.hxx>
 #include <simgear/misc/ResourceManager.hxx>
-#include <simgear/scene/bvh/BVHNode.hxx>
-#include <simgear/scene/bvh/BVHLineSegmentVisitor.hxx>
-#include <simgear/scene/util/OsgMath.hxx>
+#include <simgear/bvh/BVHNode.hxx>
+#include <simgear/bvh/BVHLineSegmentVisitor.hxx>
 
 class FGSceneryIntersect : public osg::NodeVisitor {
 public: