]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/hitlist.cxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Scenery / hitlist.cxx
index 538a63b1272f392b831bba67d3c95019e95adb8f..856b175a2184cafee67cf1ad480b38a53cb6fb44 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <Main/globals.hxx>
 #include <Main/viewer.hxx>
+#include <Scenery/scenery.hxx>
 
 #include "hitlist.hxx"
 
@@ -291,7 +292,7 @@ int FGHitList::IntersectLeaf( ssgLeaf *leaf, sgdMat4 m,
         sgdVec4 plane;
         sgdMakePlane( plane, tri[0], tri[1], tri[2] );
 
-        sgdVec3 point, test;
+        sgdVec3 point;
 
         // find point of intersection of line from point org
         // in direction dir with triangle's plane
@@ -509,7 +510,8 @@ bool fgCurrentElev( sgdVec3 abs_view_pos, sgdVec3 scenery_center,
     sgdCopyVec3(orig, view_pos );
     sgdCopyVec3(dir, abs_view_pos );
 
-    hit_list->Intersect( globals->get_terrain_branch(), orig, dir );
+    hit_list->Intersect( globals->get_scenery()->get_terrain_branch(),
+                         orig, dir );
 
     int this_hit=0;
     Point3D geoc;
@@ -535,7 +537,6 @@ bool fgCurrentElev( sgdVec3 abs_view_pos, sgdVec3 scenery_center,
         *terrain_elev = result;
         *radius = geoc.radius();
         sgVec3 tmp;
-        sgMat4 TMP;
         sgSetVec3(tmp, hit_list->get_normal(this_hit));
         // cout << "cur_normal: " << tmp[0] << " " << tmp[1] << " "  << tmp[2] << endl;
         sgdSetVec3( normal, tmp );
@@ -600,7 +601,6 @@ bool fgCurrentElev( sgdVec3 abs_view_pos, sgdVec3 scenery_center,
         *terrain_elev = result;
         *radius = geoc.radius();
         sgVec3 tmp;
-        sgMat4 TMP;
         sgSetVec3(tmp, hit_list->get_normal(this_hit));
         // cout << "cur_normal: " << tmp[0] << " " << tmp[1] << " "  << tmp[2] << endl;
         sgdSetVec3( normal, tmp );