]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/placement.hxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / model / placement.hxx
index 59fe525eec7aa2ece15d834b08b6ed2bb9af86b6..ebcf67cf4071bf91c858fd1bc43383a895f13b09 100644 (file)
 #include <osg/ref_ptr>
 #include <osg/Node>
 #include <osg/Switch>
+#include <osg/PositionAttitudeTransform>
 
-#include <simgear/props/props.hxx>
-
-#include "placementtrans.hxx"
-
-// Don't pull in the headers, since we don't need them here.
-class SGLocation;
-
+#include <simgear/math/SGMath.hxx>
 
 // Has anyone done anything *really* stupid, like making min and max macros?
 #ifdef min
@@ -47,24 +42,16 @@ public:
   virtual ~SGModelPlacement ();
 
   virtual void init( osg::Node* model );
-
+  void clear();
+  void add( osg::Node* model );
+  
   virtual void update();
 
   virtual osg::Node* getSceneGraph () { return _selector.get(); }
 
-  virtual SGLocation * getSGLocation () { return _location; }
-
   virtual bool getVisible () const;
   virtual void setVisible (bool visible);
 
-  virtual double getLongitudeDeg () const { return _position.getLongitudeDeg(); }
-  virtual double getLatitudeDeg () const { return _position.getLatitudeDeg(); }
-  virtual double getElevationFt () const { return _position.getElevationFt(); }
-
-  virtual void setLongitudeDeg (double lon_deg);
-  virtual void setLatitudeDeg (double lat_deg);
-  virtual void setElevationFt (double elev_ft);
-  virtual void setPosition (double lon_deg, double lat_deg, double elev_ft);
   void setPosition(const SGGeod& position);
   const SGGeod& getPosition() const { return _position; }
 
@@ -79,11 +66,11 @@ public:
                                double heading_deg);
   void setOrientation(const SGQuatd& orientation);
 
+  void setReferenceTime(const double& referenceTime);
   void setBodyLinearVelocity(const SGVec3d& velocity);
   void setBodyAngularVelocity(const SGVec3d& velocity);
   
 private:
-
                                 // Geodetic position
   SGGeod _position;
 
@@ -93,10 +80,7 @@ private:
   double _heading_deg;
 
   osg::ref_ptr<osg::Switch> _selector;
-  osg::ref_ptr<SGPlacementTransform> _transform;
-
-                                // Location
-  SGLocation * _location;
+  osg::ref_ptr<osg::PositionAttitudeTransform> _transform;
 };
 
 #endif // _SG_PLACEMENT_HXX