]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/scenery.cxx
PerformanceDB improvements.
[flightgear.git] / src / Scenery / scenery.cxx
index 9c6ef27960f38f48a93710bfc7851881dabdeb66..5ed687e83c3175e9f0acfd70a39931c4b11b6b80 100644 (file)
 #include <osgViewer/Viewer>
 
 #include <simgear/constants.h>
+#include <simgear/sg_inlines.h>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/scene/tgdb/userdata.hxx>
 #include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/material/mat.hxx>
 #include <simgear/scene/util/SGNodeMasks.hxx>
 #include <simgear/scene/util/OsgMath.hxx>
 #include <simgear/scene/util/SGSceneUserData.hxx>
@@ -248,7 +250,11 @@ void FGScenery::init() {
 }
 
 
-void FGScenery::update(double dt) {
+void FGScenery::update(double dt)
+{
+    SG_UNUSED(dt);
+    // nothing here, don't call again
+    suspend();
 }
 
 
@@ -261,7 +267,8 @@ void FGScenery::unbind() {
 
 bool
 FGScenery::get_cart_elevation_m(const SGVec3d& pos, double max_altoff,
-                                double& alt, const SGMaterial** material,
+                                double& alt,
+                                const simgear::BVHMaterial** material,
                                 const osg::Node* butNotFrom)
 {
   SGGeod geod = SGGeod::fromCart(pos);
@@ -271,7 +278,7 @@ FGScenery::get_cart_elevation_m(const SGVec3d& pos, double max_altoff,
 
 bool
 FGScenery::get_elevation_m(const SGGeod& geod, double& alt,
-                           const SGMaterial** material,
+                           const simgear::BVHMaterial** material,
                            const osg::Node* butNotFrom)
 {
   SGVec3d start = SGVec3d::fromGeod(geod);
@@ -290,7 +297,7 @@ FGScenery::get_elevation_m(const SGGeod& geod, double& alt,
   geodEnd = SGGeod::fromCart(intersectVisitor.getLineSegment().getEnd());
   alt = geodEnd.getElevationM();
   if (material)
-      *material = dynamic_cast<const SGMaterial*>(intersectVisitor.getMaterial());
+      *material = intersectVisitor.getMaterial();
 
   return true;
 }