]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/placement.hxx
- better error message when submodel loading failed
[simgear.git] / simgear / scene / model / placement.hxx
index 453353b89daf2b065d1a0d757f301c8864bd5255..1b6654feb9bd8656d651de13d8765dd0d1f449e8 100644 (file)
 # error This library requires C++
 #endif
 
-#include <vector>
-
-SG_USING_STD(vector);
-
 #include <plib/sg.h>
 #include <plib/ssg.h>
 
 #include <simgear/math/point3d.hxx>
 #include <simgear/props/props.hxx>
+#include <simgear/structure/ssgSharedPtr.hxx>
 
 
 // Don't pull in the headers, since we don't need them here.
-class FGLocation;
+class SGLocation;
+class ssgPlacementTransform;
 
 
 // Has anyone done anything *really* stupid, like making min and max macros?
@@ -42,23 +40,20 @@ class FGLocation;
 /**
  * A wrapper for a model with a definite placement.
  */
-class FGModelPlacement
+class SGModelPlacement
 {
 public:
 
-  FGModelPlacement ();
-  virtual ~FGModelPlacement ();
+  SGModelPlacement ();
+  virtual ~SGModelPlacement ();
+
+  virtual void init( ssgBranch * model );
 
-    virtual void FGModelPlacement::init( ssgBranch * model );
-  /* virtual void init( const string &fg_root,
-                     const string &path,
-                     SGPropertyNode *prop_root,
-                     double sim_time_sec, int dummy ); */
-  virtual void update( const Point3D scenery_center );
+  virtual void update();
 
   virtual ssgEntity * getSceneGraph () { return (ssgEntity *)_selector; }
 
-  virtual FGLocation * getFGLocation () { return _location; }
+  virtual SGLocation * getSGLocation () { return _location; }
 
   virtual bool getVisible () const;
   virtual void setVisible (bool visible);
@@ -82,9 +77,8 @@ public:
   virtual void setOrientation (double roll_deg, double pitch_deg,
                                double heading_deg);
   
-  // Addition by Diarmuid Tyson for Multiplayer Support
-  // Allows multiplayer to get players position transform
-  virtual const sgVec4 *get_POS() { return POS; }
+  ssgPlacementTransform * getTransform(void)
+  { return _position; }
 
 private:
 
@@ -98,18 +92,11 @@ private:
   double _pitch_deg;
   double _heading_deg;
 
-  ssgSelector * _selector;
-  ssgTransform * _position;
+  ssgSharedPtr<ssgSelector> _selector;
+  ssgSharedPtr<ssgPlacementTransform> _position;
 
                                 // Location
-  FGLocation * _location;
-
-
-  // Addition by Diarmuid Tyson for Multiplayer Support
-  // Moved from update method
-  // POS for transformation Matrix
-  sgMat4 POS;
-
+  SGLocation * _location;
 };
 
 #endif // _SG_PLACEMENT_HXX