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++
17 #include <simgear/math/point3d.hxx>
18 #include <simgear/props/props.hxx>
21 // Don't pull in the headers, since we don't need them here.
23 class ssgPlacementTransform;
26 // Has anyone done anything *really* stupid, like making min and max macros?
35 ////////////////////////////////////////////////////////////////////////
37 ////////////////////////////////////////////////////////////////////////
40 * A wrapper for a model with a definite placement.
42 class SGModelPlacement
47 virtual ~SGModelPlacement ();
49 virtual void SGModelPlacement::init( ssgBranch * model );
50 /* virtual void init( const string &fg_root,
52 SGPropertyNode *prop_root,
53 double sim_time_sec, int dummy ); */
54 virtual void update( const Point3D scenery_center );
56 virtual ssgEntity * getSceneGraph () { return (ssgEntity *)_selector; }
58 virtual SGLocation * getSGLocation () { return _location; }
60 virtual bool getVisible () const;
61 virtual void setVisible (bool visible);
63 virtual double getLongitudeDeg () const { return _lon_deg; }
64 virtual double getLatitudeDeg () const { return _lat_deg; }
65 virtual double getElevationFt () const { return _elev_ft; }
67 virtual void setLongitudeDeg (double lon_deg);
68 virtual void setLatitudeDeg (double lat_deg);
69 virtual void setElevationFt (double elev_ft);
70 virtual void setPosition (double lon_deg, double lat_deg, double elev_ft);
72 virtual double getRollDeg () const { return _roll_deg; }
73 virtual double getPitchDeg () const { return _pitch_deg; }
74 virtual double getHeadingDeg () const { return _heading_deg; }
76 virtual void setRollDeg (double roll_deg);
77 virtual void setPitchDeg (double pitch_deg);
78 virtual void setHeadingDeg (double heading_deg);
79 virtual void setOrientation (double roll_deg, double pitch_deg,
82 // Addition by Diarmuid Tyson for Multiplayer Support
83 // Allows multiplayer to get players position transform
84 virtual const sgVec4 *get_POS() { return POS; }
86 ssgPlacementTransform * getTransform(void)
101 ssgSelector * _selector;
102 // ssgTransform * _position;
103 ssgPlacementTransform * _position;
106 SGLocation * _location;
109 // Addition by Diarmuid Tyson for Multiplayer Support
110 // Moved from update method
111 // POS for transformation Matrix
116 #endif // _SG_PLACEMENT_HXX