1 // placement.hxx - manage the placment of a 3D model.
2 // Written by David Megginson, started 2002.
4 // This file is in the Public Domain, and comes with no warranty.
7 #ifndef _SG_PLACEMENT_HXX
8 #define _SG_PLACEMENT_HXX 1
11 # error This library requires C++
21 #include <simgear/math/point3d.hxx>
22 #include <simgear/props/props.hxx>
25 // Don't pull in the headers, since we don't need them here.
29 // Has anyone done anything *really* stupid, like making min and max macros?
38 ////////////////////////////////////////////////////////////////////////
40 ////////////////////////////////////////////////////////////////////////
43 * A wrapper for a model with a definite placement.
45 class SGModelPlacement
50 virtual ~SGModelPlacement ();
52 virtual void SGModelPlacement::init( ssgBranch * model );
53 /* virtual void init( const string &fg_root,
55 SGPropertyNode *prop_root,
56 double sim_time_sec, int dummy ); */
57 virtual void update( const Point3D scenery_center );
59 virtual ssgEntity * getSceneGraph () { return (ssgEntity *)_selector; }
61 virtual SGLocation * getSGLocation () { return _location; }
63 virtual bool getVisible () const;
64 virtual void setVisible (bool visible);
66 virtual double getLongitudeDeg () const { return _lon_deg; }
67 virtual double getLatitudeDeg () const { return _lat_deg; }
68 virtual double getElevationFt () const { return _elev_ft; }
70 virtual void setLongitudeDeg (double lon_deg);
71 virtual void setLatitudeDeg (double lat_deg);
72 virtual void setElevationFt (double elev_ft);
73 virtual void setPosition (double lon_deg, double lat_deg, double elev_ft);
75 virtual double getRollDeg () const { return _roll_deg; }
76 virtual double getPitchDeg () const { return _pitch_deg; }
77 virtual double getHeadingDeg () const { return _heading_deg; }
79 virtual void setRollDeg (double roll_deg);
80 virtual void setPitchDeg (double pitch_deg);
81 virtual void setHeadingDeg (double heading_deg);
82 virtual void setOrientation (double roll_deg, double pitch_deg,
85 // Addition by Diarmuid Tyson for Multiplayer Support
86 // Allows multiplayer to get players position transform
87 virtual const sgVec4 *get_POS() { return POS; }
101 ssgSelector * _selector;
102 ssgTransform * _position;
105 SGLocation * _location;
108 // Addition by Diarmuid Tyson for Multiplayer Support
109 // Moved from update method
110 // POS for transformation Matrix
115 #endif // _SG_PLACEMENT_HXX