[Gcblue-commits] gcb_wx/include/sim tcAirfieldObject.h,NONE,1.1 Game.h,1.41,1.42 tc3DViewer.h,1.23,1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:11
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/sim Modified Files: Game.h tc3DViewer.h tcAeroAirObject.h tcAirObject.h tcCarrierObject.h tcFlightOpsObject.h tcFlightPort.h tcGameObject.h Added Files: tcAirfieldObject.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcGameObject.h 4 Jun 2004 21:39:22 -0000 1.20 --- tcGameObject.h 18 Jul 2004 03:18:00 -0000 1.21 *************** *** 71,74 **** --- 71,78 ---- bool isVisible; + tsRelativePosition(float _dx, float _dy, float _dz) + : dx(_dx), dy(_dy), dz(_dz) {} + tsRelativePosition() + : dx(0), dy(0), dz(0), yaw(0), pitch(0), roll(0), isVisible(false) {} tcStream& operator<<(tcStream& stream); tcStream& operator>>(tcStream& stream); *************** *** 110,113 **** --- 114,119 ---- void GetRelPosOf(tcGameObject *obj, tsRelativePosition& rel_pos); virtual void RandInitNear(float afLon_deg, float afLat_deg); + tsGeoPoint RelPosToLatLonAlt(const tsRelativePosition& rel_pos) const; + tsGeoPoint RelPosToLatLonAlt(const float& dx, const float& dy, const float& dz) const; virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcAeroAirObject.h 13 Feb 2004 01:31:32 -0000 1.3 --- tcAeroAirObject.h 18 Jul 2004 03:18:00 -0000 1.4 *************** *** 30,33 **** --- 30,38 ---- } + /** + * Aerodynamic air object model. + * A cross between a basic constant-velocity model + * and a flight-sim style model + */ class tcAeroAirObject : public tcAirObject { Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcAirObject.h 24 May 2004 00:14:46 -0000 1.8 --- tcAirObject.h 18 Jul 2004 03:18:00 -0000 1.9 *************** *** 31,34 **** --- 31,37 ---- #define MAX_PITCH_RAD 0.875f + /** + * Models air object that can land + */ class tcAirObject : public tcPlatformObject { Index: tcFlightOpsObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightOpsObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightOpsObject.h 13 Jul 2004 23:28:02 -0000 1.1 --- tcFlightOpsObject.h 18 Jul 2004 03:18:00 -0000 1.2 *************** *** 28,35 **** --- 28,45 ---- class tcGameObject; + namespace Database + { + class tcDatabase; + } + class tcTrack; + /** * Models a sim object with a flightport for air ops. * tcFlightOpsObjects can launch, land, and reposition aircraft. * + * This code started as part of tcCarrierObject and was extracted + * in an attempt to generalize application to airstrips, helo decks + * etc. + * * @see tcFlightPort */ *************** *** 37,58 **** { public: - tcFlightPort flight_deck; ! bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); ! int CheckLanding(tcGameObject* obj); virtual void Clear(); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); void PrintToFile(tcFile& file); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! void SetFlightportDefaults(); virtual void Update(double afStatusTime); virtual void UpdateLaunch(); ! tcFlightOpsObject(); ! tcFlightOpsObject(tcGenericDBObject *obj); virtual ~tcFlightOpsObject(); private: tcGameObject* gameObj; ///< to avoid (some) virtual inheritance inefficiency }; \ No newline at end of file --- 47,71 ---- { public: ! ! virtual bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); ! virtual int CheckLanding(tcGameObject* obj); virtual void Clear(); ! tcFlightPort* GetFlightPort(); ! tcTrack GetLandingData(); void PrintToFile(tcFile& file); ! void RandInitNear(float afLon_deg, float afLat_deg); ! ! virtual void SetFlightportDefaults(); virtual void Update(double afStatusTime); virtual void UpdateLaunch(); ! tcFlightOpsObject(tcFlightportDBObject* dbObject, tcGameObject* gameObject); virtual ~tcFlightOpsObject(); private: + static Database::tcDatabase* database; + tcFlightPort flight_deck; tcGameObject* gameObj; ///< to avoid (some) virtual inheritance inefficiency + + tcFlightOpsObject(); }; \ No newline at end of file Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightPort.h 4 Jan 2004 22:24:52 -0000 1.4 --- tcFlightPort.h 18 Jul 2004 03:18:00 -0000 1.5 *************** *** 107,110 **** --- 107,112 ---- tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); unsigned GetHangarCapacity() const {return hangarCapacity;} + tcTrack GetLandingData(const tcGameObject* obj); + std::vector<tsSpotInfo>* GetLocVector(teLocation loc); void InitFromDatabase(Database::tcFlightportDBObject *dbObj); --- NEW FILE: tcAirfieldObject.h --- /* @file tcAirfieldObject.h */ /* ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #pragma once #include "tcFile.h" #include "tcPlatformObject.h" #include "tcFlightOpsObject.h" /** * Models an airfield * * @see tcFlightOpsObject */ class tcAirfieldObject : public tcPlatformObject, public tcFlightOpsObject { public: virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); void PrintToFile(tcFile& file); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); virtual void Update(double afStatusTime); tcAirfieldObject(); tcAirfieldObject(tcAirfieldObject&); tcAirfieldObject(tcGenericDBObject* obj); virtual ~tcAirfieldObject(); }; Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Game.h 21 Jun 2004 22:21:43 -0000 1.41 --- Game.h 18 Jul 2004 03:18:00 -0000 1.42 *************** *** 157,161 **** tcOOBView* oobView; tcPopupControl* popupControl; // popup control object ! tcDatabase mcDatabase; tcSimState* simState; tcMapData mcMapData; --- 157,161 ---- tcOOBView* oobView; tcPopupControl* popupControl; // popup control object ! tcDatabase* database; tcSimState* simState; tcMapData mcMapData; Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DViewer.h 4 Jun 2004 21:39:22 -0000 1.23 --- tc3DViewer.h 18 Jul 2004 03:18:00 -0000 1.24 *************** *** 157,160 **** --- 157,161 ---- osg::Vec3 cameraPositionOffset; ///< current position offset of camera rel to target, for moveWith osg::Vec3 cameraTarget; ///< point camera is looking at for lookAt modes + osg::Vec3 cameraTargetOffset; ///< offset for lookAt modes float cameraAz; ///< camera azimuth relative to target for moveWith modes float cameraEl; ///< camera elevation relative to target for moveWith modes *************** *** 165,168 **** --- 166,171 ---- float azStart; ///< camera az start for mouse look float elStart; ///< camera el start for mouse look + float lookAzStart; ///< camera look az start for mouse look + float lookElStart; ///< camera look el start for mouse look bool isMouseDown; Index: tcCarrierObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCarrierObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcCarrierObject.h 13 Jul 2004 23:28:02 -0000 1.7 --- tcCarrierObject.h 18 Jul 2004 03:18:00 -0000 1.8 *************** *** 22,39 **** #include "tcFile.h" #include "tcSurfaceObject.h" ! #include "tcFlightPort.h" /** ! * Represents a Carrier * * @see tcSurfaceObject */ ! class tcCarrierObject : public tcSurfaceObject { public: - tcFlightPort flight_deck; - - bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); - int CheckLanding(tcGameObject *obj); virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); --- 22,38 ---- #include "tcFile.h" #include "tcSurfaceObject.h" ! #include "tcFlightOpsObject.h" /** ! * Models a Carrier ! * Changed to derive from tcFlightOpsObject instead of implementing ! * flight ops here. * * @see tcSurfaceObject + * @see tcFlightOpsObject */ ! class tcCarrierObject : public tcSurfaceObject, public tcFlightOpsObject { public: virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); *************** *** 42,48 **** void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! void SetFlightportDefaults(); virtual void Update(double afStatusTime); - virtual void UpdateLaunch(); tcCarrierObject(); --- 41,46 ---- void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! virtual void Update(double afStatusTime); tcCarrierObject(); |