00001 /* 00002 * WorldObjects.h 00003 * 00004 * Part of Fly! Legacy project 00005 * 00006 * Copyright 2003 Chris Wallace 00007 * 00008 * Fly! Legacy is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * Fly! Legacy is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with Fly! Legacy; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 */ 00023 00034 #include "FlyLegacy.h" 00035 #include "UserVehicles.h" 00036 #include "Airplane.h" 00037 00038 #ifndef WORLDOBJECTS_H 00039 #define WORLDOBJECTS_H 00040 00041 00042 // 00043 // CWorldObjectBase is an abstract parent class for all Fly world object types 00044 // 00045 // Stream file declaration: 00046 // <wobj> 00047 // wobj 00048 // <bgno> 00049 // <endo> 00050 // 00051 class CWorldObjectBase : public CStreamObject { 00052 public: 00053 virtual ~CWorldObjectBase (void) {}; 00054 00055 virtual Tag GetType (void) = 0; 00056 }; 00057 00058 00059 // 00060 // The CWorldObject object is a dynamic scenery model with 00061 // <wobj> signature of TYPE_FLY_WORLDOBJECT 00062 // 00063 // Stream file declaration: 00064 // <wobj> 00065 // wobj 00066 // <bgno> 00067 // <endo> 00068 // 00069 class CWorldObject : public CWorldObjectBase { 00070 public: 00071 CWorldObject (void); 00072 00073 // CStreamObject methods 00074 virtual int Read (SStream *stream, Tag tag); 00075 virtual void ReadFinished (void); 00076 00077 // CWorldObjectBase methods 00078 virtual Tag GetType (void); 00079 virtual SPosition GetPosition (void); 00080 virtual void SetPosition (SPosition pos); 00081 virtual SVector GetOrientation (void); 00082 virtual void SetOrientation (SVector v); 00083 00084 protected: 00085 Tag type; // Object type 00086 SPosition geop; // Position (lat/lon/alt) of the object 00087 SVector iang; // Inertial angular orientation 00088 bool geopRead, iangRead; 00089 }; 00090 00091 00092 // 00093 // The CModelManager represents a single model representation of a world object 00094 // 00095 class CModelManager : public CStreamObject { 00096 public: 00097 CModelManager (void); 00098 virtual ~CModelManager (void); 00099 00100 // CStreamObject methods 00101 virtual int Read (SStream *stream, Tag tag); 00102 00103 // CModelManager methods 00104 ssgEntity *GetSSGEntity (void); 00105 00106 protected: 00107 Tag tag; 00108 CModelSMF *model; // Model (SMF, ACM or BIN), see Utility.h and ModelXXX.cpp 00109 }; 00110 00111 00112 // 00113 // The CModelObject object refines the CWorldObject by adding a static 3D model. 00114 // 00115 // Stream file declaration: 00116 // <wobj> 00117 // mobj 00118 // <bgno> 00119 // <endo> 00120 // 00121 class CModelObject : public CWorldObject { 00122 public: 00123 CModelObject (void); 00124 virtual ~CModelObject (void); 00125 00126 // CWorldObject methods 00127 virtual void SetPosition (SPosition pos); 00128 00129 // CStreamObject methods 00130 virtual int Read (SStream *stream, Tag tag); 00131 virtual void ReadFinished (void); 00132 00133 // CModelObject methods 00134 virtual ssgEntity *GetSSGEntity (void); 00135 00136 protected: 00137 unsigned int flags; 00138 int detail; 00139 ssgTransform *top; // Top-level transform for 3D model 00140 ssgSelector *daynight; // Selector for day/night models 00141 CModelManager *dayModel; 00142 CModelManager *nightModel; 00143 }; 00144 00145 00146 // 00147 // The CSimulatedObject object has some behaviour tied to the real-time simulation. 00148 // This could be an animated object, e.g. windsock. 00149 // 00150 // Stream file declaration: 00151 // <wobj> 00152 // sobj 00153 // <bgno> 00154 // <endo> 00155 // 00156 class CSimulatedObject : public CModelObject { 00157 public: 00158 // Constructors / destructor 00159 CSimulatedObject (void); 00160 00161 // CStreamObject methods 00162 virtual int Read (SStream *stream, Tag tag); 00163 virtual void ReadFinished (void); 00164 }; 00165 00166 00167 // 00168 // The CVehicleObject object is ... 00169 // <wobj> signature of TYPE_FLY_VEHICLEOBJECT 00170 // 00171 // Stream file declaration: 00172 // <wobj> 00173 // vehi 00174 // <bgno> 00175 // <endo> 00176 // 00177 class CVehicleObject : public CSimulatedObject { 00178 public: 00179 // Constructors / destructor 00180 CVehicleObject (void); 00181 virtual ~CVehicleObject (void); 00182 00183 // CStreamObject methods 00184 virtual int Read (SStream *stream, Tag tag); 00185 virtual void ReadFinished (void); 00186 00187 // CVehicleObject methods 00188 virtual bool isUserVehicle (void); 00189 virtual CCameraManager* GetCameraManager (void); 00190 virtual CCockpitManager* GetCockpitManager (void); 00191 virtual Tag GetPanel (void) { return 0; } 00192 virtual void SetPanel (Tag tag) {} 00193 virtual void DrawPanel () {} 00194 00195 protected: 00196 bool user; // Is this the user vehicle? 00197 Tag vmode; // View mode (ID of default camera) 00198 }; 00199 00200 00201 // 00202 // The CGroundVehicleObject object is ... 00203 // <wobj> signature of TYPE_FLY_GROUNDVEHICLEOBJECT 00204 // 00205 // Stream file declaration: 00206 // <wobj> 00207 // gveh 00208 // <bgno> 00209 // <endo> 00210 // 00211 class CGroundVehicleObject : public CVehicleObject { 00212 public: 00213 // Constructors / destructor 00214 CGroundVehicleObject (void); 00215 00216 // CStreamObject methods 00217 virtual int Read (SStream *stream, Tag tag); 00218 }; 00219 00220 00221 // 00222 // The CAirplane object represents a fixed-wing aircraft 00223 // with <wobj> signature of TYPE_FLY_AIRPLANE 00224 // 00225 // Stream file declaration: 00226 // <wobj> 00227 // plan 00228 // <bgno> 00229 // <endo> 00230 // 00231 class CAirplaneObject : public CVehicleObject { 00232 public: 00233 // Constructors / destructor 00234 CAirplaneObject (void); 00235 virtual ~CAirplaneObject (void); 00236 00237 // CStreamObject methods 00238 virtual int Read (SStream *stream, Tag tag); 00239 virtual void ReadFinished (void); 00240 00241 // CWorldObject methods 00242 // virtual void SetPosition (SPosition pos); 00243 00244 // CVehicleObject methods 00245 virtual CCameraManager* GetCameraManager (void); 00246 virtual CCockpitManager* GetCockpitManager (void); 00247 virtual Tag GetPanel (void); 00248 virtual void SetPanel (Tag tag); 00249 virtual void DrawPanel (); 00250 00251 public: 00252 char nfoFilename[64]; 00253 CAirplane *pAirplane; 00254 }; 00255 00256 00257 // 00258 // The CHelicopter object represents a rotary-wing aircraft 00259 // with <wobj> signature of TYPE_FLY_HELICOPTER 00260 // 00261 // Stream file declaration: 00262 // <wobj> 00263 // heli 00264 // <bgno> 00265 // <endo> 00266 // 00267 class CHelicopterObject : public CVehicleObject { 00268 public: 00269 // Constructors / destructor 00270 CHelicopterObject (void); 00271 virtual ~CHelicopterObject (void); 00272 00273 // CStreamObject methods 00274 virtual int Read (SStream *stream, Tag tag); 00275 00276 // CVehicleObject methods 00277 00278 protected: 00279 char nfoFilename[64]; 00280 CHelicopter *pHelicopter; 00281 }; 00282 00283 #endif // WORLDOBJECTS_H
|
|
Documentation generated by
|