]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/placement.cxx
Mathias:
[simgear.git] / simgear / scene / model / placement.cxx
index cbee20f560d7ff7bc45f8c6be5c84af5a6d8b910..38a622adfa5902ac32546c98ee446b4b024261ea 100644 (file)
 
 #include <string.h>             // for strcmp()
 
-#include <vector>
-
 #include <plib/sg.h>
 #include <plib/ssg.h>
 #include <plib/ul.h>
 
 #include "location.hxx"
+#include "placementtrans.hxx"
 
 #include "placement.hxx"
 
-SG_USING_STD(vector);
-
 
 \f
 ////////////////////////////////////////////////////////////////////////
@@ -37,7 +34,7 @@ SGModelPlacement::SGModelPlacement ()
     _pitch_deg(0),
     _heading_deg(0),
     _selector(new ssgSelector),
-    _position(new ssgTransform),
+    _position(new ssgPlacementTransform),
     _location(new SGLocation)
 {
 }
@@ -73,7 +70,12 @@ SGModelPlacement::update( const Point3D scenery_center )
       POS[i][j] += (tmp * trans[j]);
     }
   }
-  _position->setTransform(POS);
+//   _position->setTransform(POS);
+  _position->setTransform(_location->get_absolute_view_pos(scenery_center), POS);
+  sgdVec3 center;
+  sgdSetVec3(center,
+             scenery_center.x(), scenery_center.y(), scenery_center.z());
+  _position->setSceneryCenter(center);
 }
 
 bool