gcblue-commits Mailing List for Global Conflict Blue (Page 25)
Status: Alpha
Brought to you by:
ddcforge
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(112) |
Feb
(106) |
Mar
(88) |
Apr
(111) |
May
(53) |
Jun
(60) |
Jul
(58) |
Aug
(61) |
Sep
(45) |
Oct
(31) |
Nov
(71) |
Dec
(70) |
| 2005 |
Jan
(33) |
Feb
(57) |
Mar
(98) |
Apr
(47) |
May
(53) |
Jun
(79) |
Jul
(79) |
Aug
|
Sep
(33) |
Oct
(1) |
Nov
(20) |
Dec
(64) |
| 2006 |
Jan
(20) |
Feb
(1) |
Mar
(43) |
Apr
(11) |
May
(8) |
Jun
(23) |
Jul
|
Aug
(28) |
Sep
(58) |
Oct
(25) |
Nov
(47) |
Dec
(70) |
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/src/database Modified Files: CsvTranslator.cpp tcAirDBObject.cpp tcBallisticDBObject.cpp tcDBString.cpp tcDatabase.cpp tcDatabaseIterator.cpp tcDatabaseObject.cpp tcESMDBObject.cpp tcFixedDBObject.cpp tcFlightportDBObject.cpp tcGenericDBObject.cpp tcLauncherDBObject.cpp tcMissileDBObject.cpp tcOpticalDBObject.cpp tcRadarDBObject.cpp tcSensorDBObject.cpp tcSensorPlatformDBObject.cpp tcSonarDBObject.cpp tcSonobuoyDBObject.cpp tcSqlReader.cpp tcStoresDBObject.cpp tcTorpedoDBObject.cpp tcWeaponDBObject.cpp Log Message: namespace housekeeping Index: CsvTranslator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/CsvTranslator.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CsvTranslator.cpp 21 May 2005 02:01:04 -0000 1.6 --- CsvTranslator.cpp 1 Jun 2005 00:13:29 -0000 1.7 *************** *** 35,39 **** using namespace std; ! namespace Database { /** --- 35,39 ---- using namespace std; ! namespace database { /** Index: tcSensorDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorDBObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSensorDBObject.cpp 2 Mar 2005 22:28:42 -0000 1.11 --- tcSensorDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.12 *************** *** 43,47 **** using namespace std; ! namespace Database { --- 43,47 ---- using namespace std; ! namespace database { *************** *** 133,137 **** } ! int tcSensorDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 133,137 ---- } ! int tcSensorDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcSqlReader.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSqlReader.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSqlReader.cpp 2 Nov 2004 04:23:55 -0000 1.3 --- tcSqlReader.cpp 1 Jun 2005 00:13:29 -0000 1.4 *************** *** 29,33 **** #endif ! namespace Database { --- 29,33 ---- #endif ! namespace database { Index: tcDatabaseIterator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseIterator.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcDatabaseIterator.cpp 6 Nov 2004 15:13:41 -0000 1.1 --- tcDatabaseIterator.cpp 1 Jun 2005 00:13:29 -0000 1.2 *************** *** 34,38 **** #endif ! namespace Database { --- 34,38 ---- #endif ! namespace database { Index: tcMissileDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcMissileDBObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcMissileDBObject.cpp 31 Mar 2005 03:51:12 -0000 1.17 --- tcMissileDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.18 *************** *** 44,48 **** using namespace std; ! namespace Database { --- 44,48 ---- using namespace std; ! namespace database { *************** *** 213,217 **** } ! int tcMissileDBObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { tcWeaponDBObject::SerializeCSV(csv, mbLoad); --- 213,217 ---- } ! int tcMissileDBObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { tcWeaponDBObject::SerializeCSV(csv, mbLoad); *************** *** 356,360 **** } ! int tcMissileDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcWeaponDBObject::WriteCSVHeader(csv); --- 356,360 ---- } ! int tcMissileDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcWeaponDBObject::WriteCSVHeader(csv); *************** *** 640,643 **** } ! } // namespace Database --- 640,643 ---- } ! } // namespace database Index: tcSonobuoyDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSonobuoyDBObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSonobuoyDBObject.cpp 5 Mar 2005 22:37:51 -0000 1.1 --- tcSonobuoyDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.2 *************** *** 37,41 **** using namespace std; ! namespace Database { /** --- 37,41 ---- using namespace std; ! namespace database { /** Index: tcAirDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAirDBObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcAirDBObject.cpp 27 May 2005 00:28:21 -0000 1.14 --- tcAirDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.15 *************** *** 32,36 **** #endif ! namespace Database { std::vector<float> tcAirDBObject::tableAltitudes; --- 32,36 ---- #endif ! namespace database { std::vector<float> tcAirDBObject::tableAltitudes; *************** *** 158,162 **** ! int tcAirDBObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { csv->SetWriteLineBlock(true); --- 158,162 ---- ! int tcAirDBObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { csv->SetWriteLineBlock(true); *************** *** 223,227 **** } ! int tcAirDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { csv->SetWriteLineBlock(true); --- 223,227 ---- } ! int tcAirDBObject::WriteCSVHeader(database::CsvTranslator *csv) { csv->SetWriteLineBlock(true); Index: tcESMDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcESMDBObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcESMDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.9 --- tcESMDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.10 *************** *** 40,44 **** using namespace std; ! namespace Database { --- 40,44 ---- using namespace std; ! namespace database { *************** *** 101,105 **** ! int tcESMDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcSensorDBObject::WriteCSVHeader(csv); --- 101,105 ---- ! int tcESMDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcSensorDBObject::WriteCSVHeader(csv); Index: tcSensorPlatformDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSensorPlatformDBObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSensorPlatformDBObject.cpp 4 Mar 2005 00:46:16 -0000 1.1 --- tcSensorPlatformDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.2 *************** *** 43,47 **** using namespace std; ! namespace Database { --- 43,47 ---- using namespace std; ! namespace database { *************** *** 82,86 **** ! int tcSensorPlatformDBObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { if (mbLoad) --- 82,86 ---- ! int tcSensorPlatformDBObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { if (mbLoad) *************** *** 144,148 **** } ! int tcSensorPlatformDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { int i; --- 144,148 ---- } ! int tcSensorPlatformDBObject::WriteCSVHeader(database::CsvTranslator *csv) { int i; Index: tcDatabaseObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabaseObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcDatabaseObject.cpp 31 Jan 2005 01:33:07 -0000 1.16 --- tcDatabaseObject.cpp 1 Jun 2005 00:13:29 -0000 1.17 *************** *** 37,40 **** --- 37,41 ---- #include "common/tinyxml.h" #include "database/tcSqlReader.h" + #include <osg/Geometry> #ifdef _DEBUG *************** *** 42,46 **** #endif ! namespace Database { tcDatabase* tcDatabaseObject::database = NULL; --- 43,47 ---- #endif ! namespace database { tcDatabase* tcDatabaseObject::database = NULL; *************** *** 220,224 **** } ! int tcDatabaseObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { if (mbLoad) --- 221,225 ---- } ! int tcDatabaseObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { if (mbLoad) *************** *** 280,284 **** ! int tcDatabaseObject::WriteCSVHeader(Database::CsvTranslator *csv) { *csv << "Database class"; // database class --- 281,285 ---- ! int tcDatabaseObject::WriteCSVHeader(database::CsvTranslator *csv) { *csv << "Database class"; // database class Index: tcBallisticDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcBallisticDBObject.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcBallisticDBObject.cpp 25 Mar 2005 03:48:07 -0000 1.10 --- tcBallisticDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.11 *************** *** 40,44 **** using namespace std; ! namespace Database { --- 40,44 ---- using namespace std; ! namespace database { *************** *** 190,194 **** } ! int tcBallisticDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcWeaponDBObject::WriteCSVHeader(csv); --- 190,194 ---- } ! int tcBallisticDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcWeaponDBObject::WriteCSVHeader(csv); Index: tcTorpedoDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcTorpedoDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcTorpedoDBObject.cpp 7 Dec 2004 04:00:28 -0000 1.2 --- tcTorpedoDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 *************** *** 42,46 **** ! namespace Database { --- 42,46 ---- ! namespace database { *************** *** 252,255 **** } ! } // namespace Database --- 252,255 ---- } ! } // namespace database Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcRadarDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.15 --- tcRadarDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.16 *************** *** 39,43 **** #endif ! namespace Database { --- 39,43 ---- #endif ! namespace database { *************** *** 189,193 **** } ! int tcRadarDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcSensorDBObject::WriteCSVHeader(csv); --- 189,193 ---- } ! int tcRadarDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcSensorDBObject::WriteCSVHeader(csv); Index: tcDBString.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDBString.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcDBString.cpp 2 Nov 2004 04:23:55 -0000 1.6 --- tcDBString.cpp 1 Jun 2005 00:13:29 -0000 1.7 *************** *** 29,33 **** #endif ! namespace Database { --- 29,33 ---- #endif ! namespace database { Index: tcStoresDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcStoresDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcStoresDBObject.cpp 2 Dec 2004 04:17:24 -0000 1.2 --- tcStoresDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 *************** *** 39,43 **** using namespace std; ! namespace Database { --- 39,43 ---- using namespace std; ! namespace database { *************** *** 136,140 **** ! int tcStoresDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 136,140 ---- ! int tcStoresDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcSonarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSonarDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSonarDBObject.cpp 7 Dec 2004 04:00:28 -0000 1.2 --- tcSonarDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 *************** *** 37,41 **** #endif ! namespace Database { --- 37,41 ---- #endif ! namespace database { Index: tcOpticalDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcOpticalDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcOpticalDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.2 --- tcOpticalDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.3 *************** *** 39,43 **** #endif ! namespace Database { --- 39,43 ---- #endif ! namespace database { Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcLauncherDBObject.cpp 26 May 2005 11:54:11 -0000 1.15 --- tcLauncherDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.16 *************** *** 41,45 **** using namespace std; ! namespace Database { --- 41,45 ---- using namespace std; ! namespace database { *************** *** 172,176 **** ! int tcLauncherDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 172,176 ---- ! int tcLauncherDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcGenericDBObject.cpp 4 Mar 2005 00:46:16 -0000 1.21 --- tcGenericDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.22 *************** *** 43,47 **** using namespace std; ! namespace Database { --- 43,47 ---- using namespace std; ! namespace database { *************** *** 262,266 **** } ! int tcGenericDBObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { tcDatabaseObject::SerializeCSV(csv, mbLoad); --- 262,266 ---- } ! int tcGenericDBObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { tcDatabaseObject::SerializeCSV(csv, mbLoad); *************** *** 437,441 **** } ! int tcGenericDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 437,441 ---- } ! int tcGenericDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcDatabase.cpp 17 Apr 2005 22:35:31 -0000 1.26 --- tcDatabase.cpp 1 Jun 2005 00:13:29 -0000 1.27 *************** *** 61,65 **** using namespace std; ! namespace Database { --- 61,65 ---- using namespace std; ! namespace database { Index: tcFixedDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcFixedDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcFixedDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.8 --- tcFixedDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.9 *************** *** 38,42 **** using namespace std; ! namespace Database { --- 38,42 ---- using namespace std; ! namespace database { *************** *** 88,92 **** } ! int tcFixedDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 88,92 ---- } ! int tcFixedDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcWeaponDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcWeaponDBObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcWeaponDBObject.cpp 7 Dec 2004 04:00:28 -0000 1.7 --- tcWeaponDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.8 *************** *** 40,44 **** using namespace std; ! namespace Database { --- 40,44 ---- using namespace std; ! namespace database { *************** *** 117,121 **** } ! int tcWeaponDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 117,121 ---- } ! int tcWeaponDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); Index: tcFlightportDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcFlightportDBObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcFlightportDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.7 --- tcFlightportDBObject.cpp 1 Jun 2005 00:13:29 -0000 1.8 *************** *** 38,42 **** using namespace std; ! namespace Database { --- 38,42 ---- using namespace std; ! namespace database { *************** *** 64,68 **** ! int tcFlightportDBObject::SerializeCSV(Database::CsvTranslator *csv, bool mbLoad) { tcDatabaseObject::SerializeCSV(csv, mbLoad); --- 64,68 ---- ! int tcFlightportDBObject::SerializeCSV(database::CsvTranslator *csv, bool mbLoad) { tcDatabaseObject::SerializeCSV(csv, mbLoad); *************** *** 195,199 **** ! int tcFlightportDBObject::WriteCSVHeader(Database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); --- 195,199 ---- ! int tcFlightportDBObject::WriteCSVHeader(database::CsvTranslator *csv) { tcDatabaseObject::WriteCSVHeader(csv); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/include/graphics Modified Files: ObjectUpdater.h tc3DModel.h tc3DWindow.h tcDisplaySettingsView.h tcGameView.h tcHookInfo.h tcMapObject.h tcMapView.h tcOOBView.h tcPopupControl.h tcTerrainView.h tcXmlWindow.h Log Message: namespace housekeeping Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcXmlWindow.h 21 Oct 2004 04:10:58 -0000 1.4 --- tcXmlWindow.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 45,49 **** const wxPoint& pos, const wxSize& size, const wxString& configFile = "", ! const wxString& name = "StandardWindow"); virtual ~tcXmlWindow(); protected: --- 45,50 ---- const wxPoint& pos, const wxSize& size, const wxString& configFile = "", ! const wxString& name = "StandardWindow", ! tc3DWindow* graphicsHost = 0); virtual ~tcXmlWindow(); protected: Index: tcDisplaySettingsView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDisplaySettingsView.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDisplaySettingsView.h 2 Oct 2004 22:41:32 -0000 1.3 --- tcDisplaySettingsView.h 1 Jun 2005 00:13:26 -0000 1.4 *************** *** 31,35 **** ! #include "tcOptions.h" #include "tcXmlWindow.h" #include "tcSound.h" --- 31,35 ---- ! //#include "tcOptions.h" #include "tcXmlWindow.h" #include "tcSound.h" Index: tcOOBView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcOOBView.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcOOBView.h 11 Dec 2004 01:09:04 -0000 1.4 --- tcOOBView.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 37,48 **** #define MAX_OOB_OBJECTS 512 ! namespace MapView ! { ! class tcTacticalMapView; ! } class tcSimState; ! using namespace MapView; ! using namespace Database; struct tsOOBInfo --- 37,46 ---- #define MAX_OOB_OBJECTS 512 ! ! class tcTacticalMapView; ! class tcSimState; ! using namespace database; struct tsOOBInfo Index: ObjectUpdater.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/ObjectUpdater.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ObjectUpdater.h 6 Nov 2004 15:13:40 -0000 1.7 --- ObjectUpdater.h 1 Jun 2005 00:13:26 -0000 1.8 *************** *** 28,36 **** class tc3DViewer; class tcSimState; ! namespace Sensor ! { ! class tcSensorMap; ! } ! using Sensor::tcSensorMap; using osg::Node; using osg::NodeCallback; --- 28,33 ---- class tc3DViewer; class tcSimState; ! class tcSensorMap; ! using osg::Node; using osg::NodeCallback; Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc3DModel.h 21 May 2005 02:00:27 -0000 1.16 --- tc3DModel.h 1 Jun 2005 00:13:26 -0000 1.17 *************** *** 47,55 **** //} ! namespace Sensor ! { ! class tcSensorMapTrack; ! } ! using Sensor::tcSensorMapTrack; /** --- 47,53 ---- //} ! ! class tcSensorMapTrack; ! /** Index: tcTerrainView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainView.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcTerrainView.h 16 Apr 2005 20:43:55 -0000 1.4 --- tcTerrainView.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 39,43 **** namespace osg { ! class Texture2D; } --- 39,43 ---- namespace osg { ! class Texture2D; } *************** *** 45,100 **** class tcOptions; ! namespace MapView { ! struct tsTerrainViewParameters ! { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! tcRect mrectDisplay; ! }; ! /** ! * Modified to use OSG. This constructs a textured image using map data and ! * uses it to draw a textured quad showing a color elevation map for the view ! * area. ! */ ! class tcTerrainView : public tc3DWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! void Draw(); ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Maximize(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(); ! void SetActive(bool abActive); ! void SetDisplayRegion(tcRect& r); ! void SetView(tcGeoRect r); - tcTerrainView(wxWindow *parent, - const wxPoint& pos, const wxSize& size, - bool isHighRes, - const wxString& name = "TerrainView"); - ~tcTerrainView(); - private: - const bool highRes; - tcMapData* mpMapData; - tcOptions* mpOptions; - tcGeoRect mrectMap; ///< current borders of loaded map - tcRect displayRegion; ///< normalized coords [0, 1] to display on textured quad - tcRect displayRegionWrapped; ///< wrapped section for wrapped view - float wrapWidth; ///< 0-1.0 fraction of view for wrapped portion of map - bool isWrapped; ///< true if wrapped - osg::ref_ptr<osg::Texture2D> mapImage; - bool redraw; ///< true to redraw - }; - } #endif --- 45,99 ---- class tcOptions; ! ! struct tsTerrainViewParameters { ! int mnSurfaceWidth; ! int mnSurfaceHeight; ! tcGeoRect mrectGeo; ! tcRect mrectDisplay; ! }; ! /** ! * Modified to use OSG. This constructs a textured image using map data and ! * uses it to draw a textured quad showing a color elevation map for the view ! * area. ! */ ! class tcTerrainView : public tc3DWindow ! { ! public: ! tcGeoRect mrectCurrentView; ! void Draw(); ! void GetViewParameters(tsTerrainViewParameters& vp); ! void AttachMapData(tcMapData *apMapData) {mpMapData = apMapData;} ! int LoadHighResSurface(); ! int LoadLowResSurface(); ! void Maximize(); ! void Minimize(); ! int RefreshSurfaces(); ///< reloads terrain data to map view ! int CreateSurfaces(); ! void SetActive(bool abActive); ! void SetDisplayRegion(tcRect& r); ! void SetView(tcGeoRect r); ! ! tcTerrainView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! bool isHighRes, ! const wxString& name = "TerrainView"); ! ~tcTerrainView(); ! private: ! const bool highRes; ! tcMapData* mpMapData; ! tcOptions* mpOptions; ! tcGeoRect mrectMap; ///< current borders of loaded map ! tcRect displayRegion; ///< normalized coords [0, 1] to display on textured quad ! tcRect displayRegionWrapped; ///< wrapped section for wrapped view ! float wrapWidth; ///< 0-1.0 fraction of view for wrapped portion of map ! bool isWrapped; ///< true if wrapped ! osg::ref_ptr<osg::Texture2D> mapImage; ! bool redraw; ///< true to redraw ! }; #endif Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMapView.h 6 May 2005 23:57:15 -0000 1.18 --- tcMapView.h 1 Jun 2005 00:13:26 -0000 1.19 *************** *** 50,55 **** class tcMapOverlay; - namespace MapView - { #define MAXMAPOBJ 256 --- 50,53 ---- *************** *** 60,158 **** #define SYMBOLOGY_PATH "symbology\\" ! enum teSymbol ! { ! SYMBOL_UNKNOWN = 0, ! SYMBOL_SURFACE = 1, ! SYMBOL_SMALLSURFACE = 2, ! SYMBOL_LARGESURFACE = 3, ! SYMBOL_AIR = 4, ! SYMBOL_FIXEDWING = 5, ! SYMBOL_MISSILE = 6, ! SYMBOL_HELO = 7, ! SYMBOL_SUBSURFACE = 8, ! SYMBOL_SUBMARINE = 9, ! SYMBOL_TORPEDO = 10, ! SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 ! }; #define MAX_SYMBOL 16 ! enum teSymbology ! { ! NTDS = 0, ! M2525 = 1 ! }; ! class tcMapObj ! { ! public: ! UCHAR mbExists; ! UCHAR mbFocus; ! unsigned int mnColor; ///< ARGB (ABGR?) color ! float mfHeading; ! float mfLon,mfLat; ! teSymbol meSymbol; ! teAffiliation meAffiliation; ! long mnID; ! float mfArc_deg; ///< for pie symbol ! float mfLonExtent; ///< for pie ! float mfLatExtent; ///< for pie ! bool isStaleTrack; ///< true for stale track ! bool isDestroyed; ///< true for destroyed track ! bool useAltered; ///< use altered symbol (e.g. for objects not controlled by player in multiplayer mode) ! UINT8 mnFlags; ! void Clear() ! { ! meAffiliation = UNKNOWN; ! meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0; ! mnFlags = 0; ! isStaleTrack = false; ! isDestroyed = false; ! useAltered = false; ! } ! }; ! struct tsWorldMapObj ! { ! UCHAR mbExists; ! unsigned int mnColor; ! teAffiliation meAffiliation; ! float mfLon,mfLat; ! unsigned long mnID; ! void Clear() {mbExists=0;mnColor=0;mfLon=0;mfLat=0;mnID=0;} ! }; ! enum teMapCmdType ! { ! MC_NONE, ! MC_HEADING, ! MC_TARGET, ! MC_DATUM ! }; ! /* map symbol types */ ! /* ! #define SYMBOL_UNKNOWN 0 ! #define SYMBOL_SURFACE 1 ! #define SYMBOL_SMALLSURFACE 2 ! #define SYMBOL_LARGESURFACE 3 ! #define SYMBOL_AIR 4 ! #define SYMBOL_FIXEDWING 5 ! #define SYMBOL_MISSILE 6 ! #define SYMBOL_HELO 7 ! #define SYMBOL_SUBSURFACE 8 ! #define SYMBOL_SUBMARINE 9 ! #define SYMBOL_TORPEDO 10 ! #define SYMBOL_FIXED 11 ! #define SYMBOL_SENSOR 30 ! #define SYMBOL_TARGET 40 ! #define SYMBOL_PIE 50 ! */ #define CMD_DEACTIVATE 0 --- 58,156 ---- #define SYMBOLOGY_PATH "symbology\\" ! enum teSymbol ! { ! SYMBOL_UNKNOWN = 0, ! SYMBOL_SURFACE = 1, ! SYMBOL_SMALLSURFACE = 2, ! SYMBOL_LARGESURFACE = 3, ! SYMBOL_AIR = 4, ! SYMBOL_FIXEDWING = 5, ! SYMBOL_MISSILE = 6, ! SYMBOL_HELO = 7, ! SYMBOL_SUBSURFACE = 8, ! SYMBOL_SUBMARINE = 9, ! SYMBOL_TORPEDO = 10, ! SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 ! }; #define MAX_SYMBOL 16 ! enum teSymbology ! { ! NTDS = 0, ! M2525 = 1 ! }; ! class tcMapObj ! { ! public: ! UCHAR mbExists; ! UCHAR mbFocus; ! unsigned int mnColor; ///< ARGB (ABGR?) color ! float mfHeading; ! float mfLon,mfLat; ! teSymbol meSymbol; ! teAffiliation meAffiliation; ! long mnID; ! float mfArc_deg; ///< for pie symbol ! float mfLonExtent; ///< for pie ! float mfLatExtent; ///< for pie ! bool isStaleTrack; ///< true for stale track ! bool isDestroyed; ///< true for destroyed track ! bool useAltered; ///< use altered symbol (e.g. for objects not controlled by player in multiplayer mode) ! UINT8 mnFlags; ! void Clear() ! { ! meAffiliation = UNKNOWN; ! meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0; ! mnFlags = 0; ! isStaleTrack = false; ! isDestroyed = false; ! useAltered = false; ! } ! }; ! struct tsWorldMapObj ! { ! UCHAR mbExists; ! unsigned int mnColor; ! teAffiliation meAffiliation; ! float mfLon,mfLat; ! unsigned long mnID; ! void Clear() {mbExists=0;mnColor=0;mfLon=0;mfLat=0;mnID=0;} ! }; ! enum teMapCmdType ! { ! MC_NONE, ! MC_HEADING, ! MC_TARGET, ! MC_DATUM ! }; ! /* map symbol types */ ! /* ! #define SYMBOL_UNKNOWN 0 ! #define SYMBOL_SURFACE 1 ! #define SYMBOL_SMALLSURFACE 2 ! #define SYMBOL_LARGESURFACE 3 ! #define SYMBOL_AIR 4 ! #define SYMBOL_FIXEDWING 5 ! #define SYMBOL_MISSILE 6 ! #define SYMBOL_HELO 7 ! #define SYMBOL_SUBSURFACE 8 ! #define SYMBOL_SUBMARINE 9 ! #define SYMBOL_TORPEDO 10 ! #define SYMBOL_FIXED 11 ! #define SYMBOL_SENSOR 30 ! #define SYMBOL_TARGET 40 ! #define SYMBOL_PIE 50 ! */ #define CMD_DEACTIVATE 0 *************** *** 162,250 **** #define N_PENS 10 ! /** ! * Base class for tactical map and world map views ! */ ! class tcMapView : public tc3DWindow ! { ! public: ! // view parameters ! int mnXCenter,mnYCenter; ///< center pixel coords of map window ! tcGeoRect mrectCurrentView; ! tcGeoRect mrectViewBounds; ///< can't view outside of these ! float mfLonCenter,mfLatCenter; ///< coordinates of center of current view ! float mfLonWidth,mfLatWidth; ! float mfGridSize_rad; ! float mfGridBaseLon_rad,mfGridBaseLat_rad; ! float mfScaleX_pelprad; ///< map scale in X, pixels per radian ! float mfScaleX_radppel; ///< map scale in X, radians per pixel ! float mfScaleY_pelprad; ///< map scale in Y, pixels per radian ! float mfScaleY_radppel; ///< map scale in Y, radians per pixel ! std::vector<tcMapObject*> specialGraphics; ///< mission graphics display for now ! void AddMapObject(tcMapObject *obj); ! void ClearSpecialGraphics(); ! void AttachMapData(tcMapData *apMapData) ! { ! mpMapData=apMapData; ! terrainView->AttachMapData(apMapData); ! } ! void AttachOptions(tcOptions *apOptions) ! { ! mpOptions=apOptions; ! } ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(); ! virtual void Freeze(); ! tcPoint GeoToScreen(tcPoint pgeo); ! tcPoint GeoToScreen(float afLon, float afLat); ! float GeoExtentToScreen(float afExtent_rad); ! osg::Vec4 GetAffiliationColor(teAffiliation a); ! /* ! Gdiplus::Pen* GetPen() {return mpPen;} ! Gdiplus::Pen* GetPenThin() {return mpPenThin;} ! Gdiplus::SolidBrush* GetBrush() {return mpBrush;} ! Gdiplus::Font* GetFont() {return mpFont;} ! Gdiplus::Font* GetFontSmall() {return mpFontSmall;} ! */ ! int PointInView(tcPoint& p); ! void RefreshTerrainView() {terrainView->RefreshSurfaces();} ! tcPoint ScreenToGeo(wxPoint pscreen); ! tcPoint ScreenToGeo(float x, float y); ! virtual void SetActive(bool abActive); ///< overrides base class ! virtual void SetBaseRenderBin(int n); ! void SetSize(const wxRect& rect); ! virtual void SetView(tcPoint center, float afLonSpan); ! void SetViewCenterZoom(wxPoint pscreen, float afZoom); ! //void SetWindow(RECT& r); ! void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! virtual void Thaw(); ! tcMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "MapView"); ! virtual ~tcMapView(); ! protected: ! WCHAR mzwchar[255]; ! tcCommandQueue *mpCommandInterface; ! tcMapData *mpMapData; ! tcOptions *mpOptions; ! tcTerrainView *terrainView; ! /* ! Gdiplus::Pen *mpPen; ///< GDI+ objects ! Gdiplus::Pen *mpPenThin; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontSmall; ! */ ! osg::Vec4 ConvertColor(unsigned int nColor); ! virtual void OnSize(wxSizeEvent& event); ! }; #define GAMEMODE_NORMAL 0 --- 160,248 ---- #define N_PENS 10 ! /** ! * Base class for tactical map and world map views ! */ ! class tcMapView : public tc3DWindow ! { ! public: ! // view parameters ! int mnXCenter,mnYCenter; ///< center pixel coords of map window ! tcGeoRect mrectCurrentView; ! tcGeoRect mrectViewBounds; ///< can't view outside of these ! float mfLonCenter,mfLatCenter; ///< coordinates of center of current view ! float mfLonWidth,mfLatWidth; ! float mfGridSize_rad; ! float mfGridBaseLon_rad,mfGridBaseLat_rad; ! float mfScaleX_pelprad; ///< map scale in X, pixels per radian ! float mfScaleX_radppel; ///< map scale in X, radians per pixel ! float mfScaleY_pelprad; ///< map scale in Y, pixels per radian ! float mfScaleY_radppel; ///< map scale in Y, radians per pixel ! std::vector<tcMapObject*> specialGraphics; ///< mission graphics display for now ! void AddMapObject(tcMapObject *obj); ! void ClearSpecialGraphics(); ! void AttachMapData(tcMapData *apMapData) ! { ! mpMapData=apMapData; ! terrainView->AttachMapData(apMapData); ! } ! void AttachOptions(tcOptions *apOptions) ! { ! mpOptions=apOptions; ! } ! void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(); ! virtual void Freeze(); ! tcPoint GeoToScreen(tcPoint pgeo); ! tcPoint GeoToScreen(float afLon, float afLat); ! float GeoExtentToScreen(float afExtent_rad); ! osg::Vec4 GetAffiliationColor(teAffiliation a); ! /* ! Gdiplus::Pen* GetPen() {return mpPen;} ! Gdiplus::Pen* GetPenThin() {return mpPenThin;} ! Gdiplus::SolidBrush* GetBrush() {return mpBrush;} ! Gdiplus::Font* GetFont() {return mpFont;} ! Gdiplus::Font* GetFontSmall() {return mpFontSmall;} ! */ ! int PointInView(tcPoint& p); ! void RefreshTerrainView() {terrainView->RefreshSurfaces();} ! tcPoint ScreenToGeo(wxPoint pscreen); ! tcPoint ScreenToGeo(float x, float y); ! virtual void SetActive(bool abActive); ///< overrides base class ! virtual void SetBaseRenderBin(int n); ! void SetSize(const wxRect& rect); ! virtual void SetView(tcPoint center, float afLonSpan); ! void SetViewCenterZoom(wxPoint pscreen, float afZoom); ! //void SetWindow(RECT& r); ! void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! virtual void Thaw(); ! tcMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "MapView"); ! virtual ~tcMapView(); ! protected: ! WCHAR mzwchar[255]; ! tcCommandQueue *mpCommandInterface; ! tcMapData *mpMapData; ! tcOptions *mpOptions; ! tcTerrainView *terrainView; ! /* ! Gdiplus::Pen *mpPen; ///< GDI+ objects ! Gdiplus::Pen *mpPenThin; ! Gdiplus::SolidBrush *mpBrush; ! Gdiplus::Font *mpFont; ! Gdiplus::Font *mpFontSmall; ! */ ! osg::Vec4 ConvertColor(unsigned int nColor); ! virtual void OnSize(wxSizeEvent& event); ! }; #define GAMEMODE_NORMAL 0 *************** *** 252,443 **** #define GAMEMODE_EDIT 2 ! /** ! * Tactical (theater) map with color elevation map ! */ ! class tcTacticalMapView : public tcMapView ! { ! public: ! tcMapObj maMapObj[MAXMAPOBJ]; ! UINT32 mnObjCount; ! bool mbBypassPythonCallback; ! int mnCounter; ! int mnGameMode; ! bool mbShowTrackID; ! float mfFrameRate; ! int mnScrollState; ! float mfScrollDirection; ! std::vector<long> hookedId; ///< vector of hooked obj ids ! UINT mnHookAlliance; ! float mfHookLon,mfHookLat; ! int mbMapCmdActive; ! teMapCmdType meMapCmd; ! wxPoint mpointMouse; ///< current location of mouse cursor ! tcPoint mpointGeoDatum; ///< for MC_DATUM map command to store user-selected location ! float mfMapCmdHeading; ! long mnMapCmdTarget; ! char mzMapCmdCallback[128]; ! int callbackParam; ! std::vector<long> callbackPlatformID; ///< platform ID vector for callback ! void UpdateNavPoints(std::vector<GeoPoint> *mpPoints); ! ! /// returns id of closest unit to <pscreen> within fixed dist or -1 if none ! long GetClosest(wxPoint pscreen); ! void GetMapCmdDatum(tcPoint& p) {p=mpointGeoDatum;} ! float GetMapCmdHeading() {return mfMapCmdHeading;} ! long GetMapCmdTarget() {return mnMapCmdTarget;} ! void SetMapCmdCallback(const char *azCallback, const std::vector<long>& id, int param = -1); ! void SetMousePoint(wxPoint point) {mpointMouse = point;} // used to be TranslatePoint(point); ! void SetView(tcPoint center, float afLonSpan); ! void ScrollMap(float afDirection_deg); ! void ClearMapCmd() {meMapCmd = MC_NONE;} ! void Draw(); ! void DrawGrid(); ! void DrawScaleBar(); ! void DrawSelectionBox(); ! void DrawTerrainText(); ! void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(); ! void DrawIndicator(int anType); ! void DrawSpecial(); ! size_t GetHookCount(); ! std::vector<long>& GetHookedGroup(); ! long GetHookID(size_t idx = 0); ! tcMapOverlay* GetMapOverlay() const; ! long Hook(wxPoint pscreen); ! void HookAnother(wxPoint pscreen); ! void HookGroup(wxRect& region); ! long HookSecondary(wxPoint pscreen); ! bool IsFirstHook(long id); ! bool IsHooked(long id); ! bool IsMapCmdActive() {return meMapCmd != MC_NONE;} ! void OnChar(wxKeyEvent& event); ! void OnLeaveWindow(wxMouseEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnLButtonUp(wxMouseEvent& event); ! void OnLButtonDownMapCmd(wxPoint point); ! void OnMouseMove(wxMouseEvent& event); ! void OnMouseWheel(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void OnSize(wxSizeEvent& event); ! void Refresh(); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! void ClearMapObjects(); ! void Init(); ! void SetActive(bool abActive); ///< overrides base class ! void SetBaseRenderBin(int n); ! void SetDateTime(const std::string& s) {dateTime = s;} ! void SetHookID(long id); ! void SetGroupHook(std::vector<long>& hookedUnits); ! void SetTextLeftMargin(float x); ! void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} ! void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} ! tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "TacticalMapView"); ! virtual ~tcTacticalMapView(); ! private: ! tcMapOverlay* overlay; ! std::string dateTime; ///< string with complete date/time ! WCHAR mzwchar[255]; ! std::vector<GeoPoint> maNavPointGeo; ! std::vector<tcPoint> maNavPointScreen; ! osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; ! /// faded versions for stale tracks ! osg::ref_ptr<osg::Geometry> maSymbolA_fade[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; ! /// altered versions of symbols (e.g. objects not under control of player) ! osg::ref_ptr<osg::Geometry> maSymbolA_alt[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_alt[4][MAX_SYMBOL]; ! teSymbology meSymbology; ! float mfSymbolXOffset, mfSymbolYOffset; ! bool isLButtonDown; ///< true if left mouse button is down while in window (dragging) ! wxPoint buttonDownPoint; ///< start point for click-drag operations ! float leftMargin; ///< screen position to use for info text and symbols ! void Build2525(); ! void BuildNTDS(); ! osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolAltered(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolFaded(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Image* LoadSymbolImage(const char *azSymbolName); ! void AddArcPrimitive(osg::Geometry* symbol, osg::Vec3Array* vertices, ! float xc, float yc, float width, float height, ! float startAngle, float stopAngle, unsigned int nPoints); ! void CreateAlternateSymbols(); ! osg::Geometry* CreateSymbolGeometry(); ! osg::Geometry* CreateTexturedSymbol(const char* symbolName); ! osg::Geometry* DrawDefaultMark(teAffiliation affil); ! osg::Geometry* DrawNTDSSurface(teAffiliation affil); ! osg::Geometry* DrawNTDSGround(teAffiliation affil); ! osg::Geometry* DrawNTDSAirFW(teAffiliation affil); ! osg::Geometry* DrawNTDSAirRW(teAffiliation affil); ! osg::Geometry* DrawNTDSMissile(teAffiliation affil); ! osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); ! osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); ! osg::Geometry* DrawNTDSUnknown(teAffiliation affil); ! void DrawSymbol2(tcMapObj* pMO); ! //Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); ! ! void UpdateScreenNavPoints(); ! }; ! /** ! * TODO move this class to separate file ! */ ! class tcWorldMapView : public tcMapView ! { ! public: ! tsWorldMapObj maMapObj[MAXWORLDMAPOBJ]; ! UINT32 mnObjCount; ! int mnCounter; ! void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void Draw(); ! void DrawGrid(); ! void DrawTheaterBox(); ! void OnChar(wxKeyEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(); ! void Init(); ! virtual void SetActive(bool abActive); ! void SetTheater(tcGeoRect r) {mrectTheater = r;} ! void ToggleMapSize(); ! tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "WorldMapView"); ! virtual ~tcWorldMapView(); ! private: ! WCHAR mzwchar[255]; ! wxPoint mpointMouse; ! tcGeoRect mrectTheater; ///< active theater view region - void DrawSymbol(tsWorldMapObj *pMO); - }; - } #endif --- 250,441 ---- #define GAMEMODE_EDIT 2 ! /** ! * Tactical (theater) map with color elevation map ! */ ! class tcTacticalMapView : public tcMapView ! { ! public: ! tcMapObj maMapObj[MAXMAPOBJ]; ! UINT32 mnObjCount; ! bool mbBypassPythonCallback; ! int mnCounter; ! int mnGameMode; ! bool mbShowTrackID; ! float mfFrameRate; ! int mnScrollState; ! float mfScrollDirection; ! std::vector<long> hookedId; ///< vector of hooked obj ids ! UINT mnHookAlliance; ! float mfHookLon,mfHookLat; ! int mbMapCmdActive; ! teMapCmdType meMapCmd; ! wxPoint mpointMouse; ///< current location of mouse cursor ! tcPoint mpointGeoDatum; ///< for MC_DATUM map command to store user-selected location ! float mfMapCmdHeading; ! long mnMapCmdTarget; ! char mzMapCmdCallback[128]; ! int callbackParam; ! std::vector<long> callbackPlatformID; ///< platform ID vector for callback ! void UpdateNavPoints(std::vector<GeoPoint> *mpPoints); ! /// returns id of closest unit to <pscreen> within fixed dist or -1 if none ! long GetClosest(wxPoint pscreen); ! void GetMapCmdDatum(tcPoint& p) {p=mpointGeoDatum;} ! float GetMapCmdHeading() {return mfMapCmdHeading;} ! long GetMapCmdTarget() {return mnMapCmdTarget;} ! void SetMapCmdCallback(const char *azCallback, const std::vector<long>& id, int param = -1); ! void SetMousePoint(wxPoint point) {mpointMouse = point;} // used to be TranslatePoint(point); ! void SetView(tcPoint center, float afLonSpan); ! void ScrollMap(float afDirection_deg); ! void ClearMapCmd() {meMapCmd = MC_NONE;} ! void Draw(); ! void DrawGrid(); ! void DrawScaleBar(); ! void DrawSelectionBox(); ! void DrawTerrainText(); ! void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(); ! void DrawIndicator(int anType); ! void DrawSpecial(); ! size_t GetHookCount(); ! std::vector<long>& GetHookedGroup(); ! long GetHookID(size_t idx = 0); ! tcMapOverlay* GetMapOverlay() const; ! long Hook(wxPoint pscreen); ! void HookAnother(wxPoint pscreen); ! void HookGroup(wxRect& region); ! long HookSecondary(wxPoint pscreen); ! bool IsFirstHook(long id); ! bool IsHooked(long id); ! bool IsMapCmdActive() {return meMapCmd != MC_NONE;} ! void OnChar(wxKeyEvent& event); ! void OnLeaveWindow(wxMouseEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnLButtonUp(wxMouseEvent& event); ! void OnLButtonDownMapCmd(wxPoint point); ! void OnMouseMove(wxMouseEvent& event); ! void OnMouseWheel(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void OnSize(wxSizeEvent& event); ! void Refresh(); ! void ActivateCmd(teMapCmdType aeCmd) {mbMapCmdActive=true; meMapCmd=aeCmd;} ! void DeactivateCmd() {mbMapCmdActive=false; meMapCmd=MC_NONE;} ! void ClearMapObjects(); ! void Init(); ! void SetActive(bool abActive); ///< overrides base class ! void SetBaseRenderBin(int n); ! void SetDateTime(const std::string& s) {dateTime = s;} ! void SetHookID(long id); ! void SetGroupHook(std::vector<long>& hookedUnits); ! void SetTextLeftMargin(float x); ! void ToggleShowTrackTags() {mbShowTrackID = !mbShowTrackID;} ! void UpdateViewBounds() {mpMapData->GetTheaterArea(mrectViewBounds);} ! tcTacticalMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "TacticalMapView"); ! virtual ~tcTacticalMapView(); ! private: ! tcMapOverlay* overlay; ! std::string dateTime; ///< string with complete date/time ! WCHAR mzwchar[255]; ! std::vector<GeoPoint> maNavPointGeo; ! std::vector<tcPoint> maNavPointScreen; ! osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; ! /// faded versions for stale tracks ! osg::ref_ptr<osg::Geometry> maSymbolA_fade[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_fade[4][MAX_SYMBOL]; ! /// altered versions of symbols (e.g. objects not under control of player) ! osg::ref_ptr<osg::Geometry> maSymbolA_alt[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB_alt[4][MAX_SYMBOL]; ! teSymbology meSymbology; ! float mfSymbolXOffset, mfSymbolYOffset; ! bool isLButtonDown; ///< true if left mouse button is down while in window (dragging) ! wxPoint buttonDownPoint; ///< start point for click-drag operations ! float leftMargin; ///< screen position to use for info text and symbols ! void Build2525(); ! void BuildNTDS(); ! osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolAltered(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Geometry* GetSymbolFaded(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Image* LoadSymbolImage(const char *azSymbolName); ! void AddArcPrimitive(osg::Geometry* symbol, osg::Vec3Array* vertices, ! float xc, float yc, float width, float height, ! float startAngle, float stopAngle, unsigned int nPoints); ! void CreateAlternateSymbols(); ! osg::Geometry* CreateSymbolGeometry(); ! osg::Geometry* CreateTexturedSymbol(const char* symbolName); ! ! osg::Geometry* DrawDefaultMark(teAffiliation affil); ! osg::Geometry* DrawNTDSSurface(teAffiliation affil); ! osg::Geometry* DrawNTDSGround(teAffiliation affil); ! osg::Geometry* DrawNTDSAirFW(teAffiliation affil); ! osg::Geometry* DrawNTDSAirRW(teAffiliation affil); ! osg::Geometry* DrawNTDSMissile(teAffiliation affil); ! osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); ! osg::Geometry* DrawNTDSTorpedo(teAffiliation affil); ! osg::Geometry* DrawNTDSUnknown(teAffiliation affil); ! void DrawSymbol2(tcMapObj* pMO); ! //Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); ! void UpdateScreenNavPoints(); ! }; ! /** ! * TODO move this class to separate file ! */ ! class tcWorldMapView : public tcMapView ! { ! public: ! tsWorldMapObj maMapObj[MAXWORLDMAPOBJ]; ! UINT32 mnObjCount; ! int mnCounter; ! void ChangeTheater(float lon_deg, float lat_deg); ! int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void Draw(); ! void DrawGrid(); ! void DrawTheaterBox(); ! void OnChar(wxKeyEvent& event); ! void OnLButtonDown(wxMouseEvent& event); ! void OnMouseMove(wxMouseEvent& event); ! void OnRButtonDown(wxMouseEvent& event); ! void ClearMapObjects(); ! void Init(); ! virtual void SetActive(bool abActive); ! void SetTheater(tcGeoRect r) {mrectTheater = r;} ! void ToggleMapSize(); ! tcWorldMapView(wxWindow *parent, ! const wxPoint& pos, const wxSize& size, ! const wxString& name = "WorldMapView"); ! virtual ~tcWorldMapView(); ! ! private: ! WCHAR mzwchar[255]; ! wxPoint mpointMouse; ! tcGeoRect mrectTheater; ///< active theater view region ! ! void DrawSymbol(tsWorldMapObj *pMO); ! }; #endif Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcMapObject.h 8 May 2005 23:27:55 -0000 1.9 --- tcMapObject.h 1 Jun 2005 00:13:26 -0000 1.10 *************** *** 43,50 **** class tcUpdateStream; ! namespace MapView ! { ! class tcMapView; ! } namespace osg { --- 43,48 ---- class tcUpdateStream; ! class tcMapView; ! namespace osg { *************** *** 72,76 **** void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} ! static void SetMapView(MapView::tcMapView *mv); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); --- 70,74 ---- void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} ! static void SetMapView(tcMapView *mv); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); *************** *** 86,90 **** static osg::ref_ptr<osg::Geometry> marker; ! static MapView::tcMapView *mapView; ///< used to translate lat/lon coords into screen coords static void LoadMarker(); --- 84,88 ---- static osg::ref_ptr<osg::Geometry> marker; ! static tcMapView *mapView; ///< used to translate lat/lon coords into screen coords static void LoadMarker(); Index: tcPopupControl.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcPopupControl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPopupControl.h 11 Dec 2004 01:09:04 -0000 1.4 --- tcPopupControl.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 38,42 **** ! namespace ScriptInterface { class tcSimPythonInterface; --- 38,42 ---- ! namespace scriptinterface { class tcSimPythonInterface; *************** *** 45,49 **** class tcCommandQueue; ! using namespace ScriptInterface; enum teMenuMode --- 45,49 ---- class tcCommandQueue; ! using namespace scriptinterface; enum teMenuMode Index: tcGameView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcGameView.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcGameView.h 2 Oct 2004 22:41:32 -0000 1.1 --- tcGameView.h 1 Jun 2005 00:13:26 -0000 1.2 *************** *** 40,49 **** class tcGameObject; ! namespace MapView ! { ! class tcTacticalMapView; ! class tcWorldMapView; ! enum teSymbol; ! } enum teAffiliation; --- 40,47 ---- class tcGameObject; ! class tcTacticalMapView; ! class tcWorldMapView; ! enum teSymbol; ! enum teAffiliation; *************** *** 57,61 **** #endif - using namespace MapView; /** --- 55,58 ---- *************** *** 111,115 **** void AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation); void AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime); ! MapView::teSymbol GetMapSymbolByClassification(int anClassification); void OnMouseMove3D(UINT nFlags, wxPoint point); int OnMouseWheel3D(UINT nFlags, short zDelta, wxPoint point); --- 108,112 ---- void AddTruthTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, teAffiliation aeAffiliation); void AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime); ! teSymbol GetMapSymbolByClassification(int anClassification); void OnMouseMove3D(UINT nFlags, wxPoint point); int OnMouseWheel3D(UINT nFlags, short zDelta, wxPoint point); Index: tcHookInfo.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcHookInfo.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcHookInfo.h 6 Nov 2004 15:13:40 -0000 1.4 --- tcHookInfo.h 1 Jun 2005 00:13:26 -0000 1.5 *************** *** 38,52 **** class tcSimState; class tcGameObject; ! namespace Database { class tcDatabaseObject; } - namespace Sensor - { - class tcSensorMapTrack; - } ! using namespace Database; #ifndef tnPoolIndex --- 38,51 ---- class tcSimState; class tcGameObject; + class tcSensorMapTrack; ! namespace database { class tcDatabaseObject; } ! ! ! using namespace database; #ifndef tnPoolIndex *************** *** 86,91 **** //Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged( ! const Sensor::tcSensorMapTrack *smtrack, float& x, float& y); void GetFunctionalName(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); --- 85,89 ---- //Gdiplus::Font *mpFont, *mpFontLarge; ! void DrawTrackEngaged(const tcSensorMapTrack *smtrack, float& x, float& y); void GetFunctionalName(std::string& s, tcDatabaseObject *apDBObject, tcGameObject *apGameObject); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tc3DWindow.h 31 Mar 2005 03:51:11 -0000 1.14 --- tc3DWindow.h 1 Jun 2005 00:13:26 -0000 1.15 *************** *** 173,177 **** bool IsSurfaceModified(); virtual bool IsWindowMinimized() const; ! void LoadBackgroundImage(char* fileName); static osg::Image* LoadImage(const char* fileName); static osg::Texture2D* LoadTexture(const char* fileName); --- 173,177 ---- bool IsSurfaceModified(); virtual bool IsWindowMinimized() const; ! void LoadBackgroundImage(const char* fileName); static osg::Image* LoadImage(const char* fileName); static osg::Texture2D* LoadTexture(const char* fileName); |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/database Modified Files: database.db Log Message: namespace housekeeping Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsHOO4Ks and /tmp/cvsJcrvR6 differ |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/src/ai Modified Files: Nav.cpp ScriptedTask.cpp ScriptedTaskInterface.cpp SelfPreservation.cpp Task.cpp Added Files: tcAIData.cpp Log Message: namespace housekeeping Index: ScriptedTask.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/ScriptedTask.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScriptedTask.cpp 16 Feb 2005 23:13:49 -0000 1.1 --- ScriptedTask.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 34,38 **** using namespace ai; ! using ScriptInterface::tcSimPythonInterface; --- 34,38 ---- using namespace ai; ! using scriptinterface::tcSimPythonInterface; Index: ScriptedTaskInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/ScriptedTaskInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScriptedTaskInterface.cpp 2 Mar 2005 22:28:42 -0000 1.3 --- ScriptedTaskInterface.cpp 1 Jun 2005 00:13:28 -0000 1.4 *************** *** 39,43 **** using namespace ai; using namespace boost::python; ! using ScriptInterface::tcPlatformInterface; bool ScriptedTaskInterface::pythonInitialized = false; --- 39,43 ---- using namespace ai; using namespace boost::python; ! using scriptinterface::tcPlatformInterface; bool ScriptedTaskInterface::pythonInitialized = false; Index: Nav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Nav.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Nav.cpp 4 Mar 2005 00:46:19 -0000 1.1 --- Nav.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 35,39 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; void Nav::AddWaypoint(double lon_rad, double lat_rad, float alt_m) --- 35,39 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; void Nav::AddWaypoint(double lon_rad, double lat_rad, float alt_m) Index: Task.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Task.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Task.cpp 24 Feb 2005 22:19:15 -0000 1.3 --- Task.cpp 1 Jun 2005 00:13:28 -0000 1.4 *************** *** 35,39 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; --- 35,39 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; --- NEW FILE: tcAIData.cpp --- /* ** Copyright (C) 2003 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 */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/tcAIData.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace std; using namespace ai; void tcOrder::SetDestinationDeg(float lon_deg, float lat_deg) { msDestination.Set(C_PIOVER180*lon_deg, C_PIOVER180*lat_deg); } tcOrder::tcOrder() { data = 0; mfTime = 0; msDestination.Set(0,0,0); mstrOrdername = "NULL"; } tcOrder::~tcOrder() { } void tcAIData::AddOrder(const tcOrder& wp) { if (maOrder.size() >= MAX_WAYPOINTS) {return;} // list full maOrder.push_back(wp); } void tcAIData::GetOrder(tcOrder& wp, unsigned n) { if (n >= maOrder.size()) { // out of range wp.mstrOrdername = "BAD WAYPOINT"; return; } wp = maOrder[n]; } void tcAIData::SetOrder(const tcOrder& wp, unsigned n) { if (n >= maOrder.size()) {return;} // out of range maOrder[n] = wp; } void tcAIData::DeleteOrder(unsigned n) { if (n >= maOrder.size()) {return;} // out of range maOrder.erase(maOrder.begin() + n); } void tcAIData::InsertOrderBefore(const tcOrder& wp, unsigned n) { unsigned nSize = (unsigned)maOrder.size(); if (nSize >= MAX_WAYPOINTS) {return;} // list full if (n >= nSize) {return;} // out of range maOrder.insert(maOrder.begin() + n, wp); } void tcAIData::ClearOrders(void) { maOrder.clear(); mnCurrentOrder = 0; } bool tcAIData::HasOrders(void) { return (mnCurrentOrder < maOrder.size()); } tcOrder tcAIData::GetCurrentOrder(void) { tcOrder o; GetOrder(o,mnCurrentOrder); return o; } /** * Move to next order and clear script * variables. */ void tcAIData::CompletedOrder(void) { mnCurrentOrder++; ClearVars(); } // add coordinates to mpPoints vector for all "Nav" orders in current order set void tcAIData::GetNavPoints(vector<tcPoint> *mpPoints) { int nSize = (int)maOrder.size(); for (int i=mnCurrentOrder;i<nSize;i++) { tcOrder order = maOrder[i]; if (order.mstrOrdername == "Nav") { tcPoint p; p.x = order.msDestination.mfLon_rad; p.y = order.msDestination.mfLat_rad; mpPoints->push_back(p); } } } UINT32 tcAIData::GetVar(int n) { if ((n < 0)||(n >= N_VAR)) { return 0xFFFFFFFF; // error out of range } else { return mnScriptVar[n]; } } void tcAIData::SetVar(int n, UINT32 val) { if ((n < 0)||(n >= N_VAR)) { return; // error out of range } else { mnScriptVar[n] = val; } } void tcAIData::Clear(void) { ClearOrders(); ClearVars(); mfNextUpdate = randf(4.0f); mfUpdateInterval = 4.0f; mzActionText = "-"; ClearTarget(); } /** * Clears script variables. */ void tcAIData::ClearVars() { for(int n=0;n<N_VAR;n++) { mnScriptVar[n] = 0; } } tcAIData::tcAIData(void) { Clear(); } tcAIData::~tcAIData(void) { } Index: SelfPreservation.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/SelfPreservation.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelfPreservation.cpp 16 Feb 2005 23:13:49 -0000 1.1 --- SelfPreservation.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 34,38 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; --- 34,38 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387 Modified Files: GCblue.vcproj Log Message: namespace housekeeping Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** GCblue.vcproj 17 May 2005 00:20:38 -0000 1.92 --- GCblue.vcproj 1 Jun 2005 00:13:23 -0000 1.93 *************** *** 39,43 **** Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib sqlite.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib wrap_oald.lib ALutd.lib oalppd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" --- 39,43 ---- Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib GLaux.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib zlibd.lib pngd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgParticled.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib sqlited.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib wrap_oald.lib ALutd.lib oalppd.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" *************** *** 258,261 **** --- 258,264 ---- </File> <File + RelativePath=".\src\graphics\tcContainerGui.cpp"> + </File> + <File RelativePath=".\src\graphics\tcControl.cpp"> </File> *************** *** 413,419 **** </File> <File - RelativePath="src\sim\tcAIData.cpp"> - </File> - <File RelativePath=".\src\sim\tcAirfieldObject.cpp"> </File> --- 416,419 ---- *************** *** 716,719 **** --- 716,722 ---- RelativePath=".\src\ai\Task.cpp"> </File> + <File + RelativePath=".\src\ai\tcAIData.cpp"> + </File> </Filter> </Filter> *************** *** 1237,1240 **** --- 1240,1246 ---- </File> <File + RelativePath=".\include\graphics\tcContainerGui.h"> + </File> + <File RelativePath=".\include\graphics\tcControl.h"> </File> *************** *** 1383,1389 **** </File> <File - RelativePath="include\sim\tcAIData.h"> - </File> - <File RelativePath=".\include\sim\tcAirfieldObject.h"> </File> --- 1389,1392 ---- *************** *** 1698,1701 **** --- 1701,1707 ---- RelativePath=".\include\ai\Task.h"> </File> + <File + RelativePath=".\include\ai\tcAIData.h"> + </File> </Filter> </Filter> |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/include/scriptinterface Modified Files: tcFlightPortInterface.h tcGroupInterface.h tcPanelInterface.h tcPlatformInterface.h tcPythonInterface.h tcScenarioInterface.h tcSimPythonInterface.h tcSubInterface.h tcTrackInterface.h Log Message: namespace housekeeping Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** tcPlatformInterface.h 5 May 2005 02:14:19 -0000 1.40 --- tcPlatformInterface.h 1 Jun 2005 00:13:27 -0000 1.41 *************** *** 35,42 **** using namespace boost::python; ! namespace Sensor ! { ! class tcAllianceSensorMap; ! } namespace ai { --- 35,41 ---- using namespace boost::python; ! ! class tcAllianceSensorMap; ! namespace ai { *************** *** 46,52 **** class tcSoundConsole; class tcCommandQueue; - using namespace Sensor; ! namespace ScriptInterface { class tcFlightPortInterface; --- 45,51 ---- class tcSoundConsole; class tcCommandQueue; ! ! namespace scriptinterface { class tcFlightPortInterface; Index: tcTrackInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcTrackInterface.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcTrackInterface.h 6 Nov 2004 15:13:40 -0000 1.6 --- tcTrackInterface.h 1 Jun 2005 00:13:27 -0000 1.7 *************** *** 28,40 **** #include "gctypes.h" - namespace Sensor - { - class tcAllianceSensorMap; - class tcSensorMapTrack; - } ! using namespace Sensor; ! namespace ScriptInterface { class tcTrackInterface --- 28,36 ---- #include "gctypes.h" ! class tcAllianceSensorMap; ! class tcSensorMapTrack; ! namespace scriptinterface { class tcTrackInterface Index: tcFlightPortInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcFlightPortInterface.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcFlightPortInterface.h 8 Aug 2004 00:31:32 -0000 1.6 --- tcFlightPortInterface.h 1 Jun 2005 00:13:27 -0000 1.7 *************** *** 38,45 **** class tcSimState; class tcSoundConsole; ! using namespace Sensor; using namespace boost::python; ! namespace ScriptInterface { class tcFlightUnitStatus --- 38,45 ---- class tcSimState; class tcSoundConsole; ! using namespace boost::python; ! namespace scriptinterface { class tcFlightUnitStatus Index: tcScenarioInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcScenarioInterface.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcScenarioInterface.h 8 May 2005 23:27:57 -0000 1.18 --- tcScenarioInterface.h 1 Jun 2005 00:13:27 -0000 1.19 *************** *** 29,33 **** #include <string> #include <boost/python.hpp> ! #include "tcAIData.h" #include "tcGoal.h" --- 29,33 ---- #include <string> #include <boost/python.hpp> ! #include "ai/tcAIData.h" #include "tcGoal.h" *************** *** 42,48 **** * */ ! namespace ScriptInterface { ! using namespace AI; /** * This may be redundant with other 3D point structs/classes. --- 42,48 ---- * */ ! namespace scriptinterface { ! using namespace ai; /** * This may be redundant with other 3D point structs/classes. Index: tcGroupInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcGroupInterface.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcGroupInterface.h 10 Jan 2005 00:30:20 -0000 1.2 --- tcGroupInterface.h 1 Jun 2005 00:13:27 -0000 1.3 *************** *** 34,38 **** class tcSimState; ! namespace ScriptInterface { class tcPlatformInterface; --- 34,38 ---- class tcSimState; ! namespace scriptinterface { class tcPlatformInterface; Index: tcPanelInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPanelInterface.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPanelInterface.h 8 Aug 2004 00:31:32 -0000 1.4 --- tcPanelInterface.h 1 Jun 2005 00:13:27 -0000 1.5 *************** *** 34,38 **** class tcPanel; ! namespace ScriptInterface { class tcPanelInterface { public: --- 34,38 ---- class tcPanel; ! namespace scriptinterface { class tcPanelInterface { public: Index: tcSubInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSubInterface.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSubInterface.h 23 Nov 2004 23:30:47 -0000 1.1 --- tcSubInterface.h 1 Jun 2005 00:13:27 -0000 1.2 *************** *** 35,39 **** ! namespace ScriptInterface { /** * Interface class for submarine vehicle interface. --- 35,39 ---- ! namespace scriptinterface { /** * Interface class for submarine vehicle interface. Index: tcPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPythonInterface.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcPythonInterface.h 8 Aug 2004 00:31:32 -0000 1.5 --- tcPythonInterface.h 1 Jun 2005 00:13:27 -0000 1.6 *************** *** 44,48 **** using namespace boost::python; ! namespace ScriptInterface { class tcPythonInterface { public: --- 44,48 ---- using namespace boost::python; ! namespace scriptinterface { class tcPythonInterface { public: Index: tcSimPythonInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSimPythonInterface.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcSimPythonInterface.h 6 May 2005 23:57:16 -0000 1.24 --- tcSimPythonInterface.h 1 Jun 2005 00:13:27 -0000 1.25 *************** *** 43,50 **** class tcDirector; ! namespace Sensor ! { ! class tcAllianceSensorMap; ! } class tcSoundConsole; class tcCommandQueue; --- 43,48 ---- class tcDirector; ! ! class tcAllianceSensorMap; class tcSoundConsole; class tcCommandQueue; *************** *** 53,58 **** class tcCommandStream; - using namespace Sensor; - namespace ai { --- 51,54 ---- *************** *** 68,72 **** * Contains all python interface classes. */ ! namespace ScriptInterface { class tcScenarioInterface; --- 64,68 ---- * Contains all python interface classes. */ ! namespace scriptinterface { class tcScenarioInterface; *************** *** 93,97 **** }; - using namespace Sensor; /** --- 89,92 ---- |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/include/common Modified Files: math_constants.h nsNav.h Log Message: namespace housekeeping Index: nsNav.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/nsNav.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nsNav.h 8 Aug 2004 00:31:31 -0000 1.7 --- nsNav.h 1 Jun 2005 00:13:25 -0000 1.8 *************** *** 28,51 **** #include "math_constants.h" ! namespace nsNav { ! typedef struct _geopointrad { ! float mfLon_rad; ! float mfLat_rad; ! } tsGeoPointRad; ! float GCDistance_rad(tsGeoPointRad a, tsGeoPointRad b); ! float GCDistanceApprox_rad(tsGeoPointRad a, tsGeoPointRad b); ! float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); ! float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad, ! float afAltA_m, float afAltB_m); ! float GCHeading_rad(tsGeoPointRad a, tsGeoPointRad b, float *apfDistance_rad = 0); ! float GCHeadingApprox_rad(tsGeoPointRad a, tsGeoPointRad b); ! float GCHeadingApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); ! void Offset(const tsGeoPointRad& a, tsGeoPointRad& b, float afHeading_rad, float afRange_rad); ! void OffsetApprox(const tsGeoPointRad& a, tsGeoPointRad& b, float afHeading_rad, float afRange_rad); ! void OffsetApprox(float afLatA_rad, float afLonA_rad, ! float& afLatB_rad, float& afLonB_rad, float afHeading_rad, float afRange_rad); ! float GetLatAlongGCPath(tsGeoPointRad a, tsGeoPointRad b, float afLon_rad); ! void Test(void); ! } --- 28,57 ---- #include "math_constants.h" ! class nsNav ! { ! public: ! struct tsGeoPointRad ! { ! float mfLon_rad; ! float mfLat_rad; ! }; ! static float GCDistance_rad(tsGeoPointRad a, tsGeoPointRad b); ! static float GCDistanceApprox_rad(tsGeoPointRad a, tsGeoPointRad b); ! static float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); ! static float GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad, ! float afAltA_m, float afAltB_m); ! ! static float GCHeading_rad(tsGeoPointRad a, tsGeoPointRad b, float *apfDistance_rad = 0); ! static float GCHeadingApprox_rad(tsGeoPointRad a, tsGeoPointRad b); ! static float GCHeadingApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad); ! ! static void Offset(const tsGeoPointRad& a, tsGeoPointRad& b, float afHeading_rad, float afRange_rad); ! static void OffsetApprox(const tsGeoPointRad& a, tsGeoPointRad& b, float afHeading_rad, float afRange_rad); ! static void OffsetApprox(float afLatA_rad, float afLonA_rad, ! ! float& afLatB_rad, float& afLonB_rad, float afHeading_rad, float afRange_rad); ! static float GetLatAlongGCPath(tsGeoPointRad a, tsGeoPointRad b, float afLon_rad); ! static void Test(); ! }; Index: math_constants.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/math_constants.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** math_constants.h 7 Mar 2005 01:54:18 -0000 1.10 --- math_constants.h 1 Jun 2005 00:13:25 -0000 1.11 *************** *** 55,64 **** #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) #define C_VISUALHOR 2.78f ///< visible horizon in km = constant*sqrt(h in meters) ! namespace UnitConversions { ! double toRadians(double deg); ! float toRadians(float deg); ! double toDegrees(double rad); ! float toDegrees(float rad); ! } #endif --- 55,69 ---- #define C_RADARHOR 3.92482f ///< radar horizon in km = constant*sqrt(h in meters) #define C_VISUALHOR 2.78f ///< visible horizon in km = constant*sqrt(h in meters) ! ! ! class UnitConversions { ! public: ! static double toRadians(double deg); ! static float toRadians(float deg); ! static double toDegrees(double rad); ! static float toDegrees(float rad); ! }; ! ! #endif |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:10
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/include/ai Modified Files: ScriptedTaskInterface.h Task.h Added Files: tcAIData.h Log Message: namespace housekeeping --- NEW FILE: tcAIData.h --- /* ** Copyright (C) 2003 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 */ #ifndef _AIDATA_H_ #define _AIDATA_H_ #if _MSC_VER > 1000 #pragma once #endif #include "simmath.h" #include <string> #include <vector> #ifndef NULL_INDEX #define NULL_INDEX -1 #endif namespace ai { class tcOrder { public: std::string mstrOrdername; GeoPoint msDestination; ///< destination for order double mfTime; ///< time for order long data; ///< additional data for order (e.g. target ID) void SetDestinationDeg(float lon_deg, float lat_deg); void SetOrderName(std::string ordername) {mstrOrdername = ordername;} tcOrder(); ~tcOrder(); }; /** * holds data for basic order navigation and AI at the platform (unit) level */ class tcAIData { enum { MAX_WAYPOINTS = 8, N_VAR = 4 }; public: std::vector<tcOrder> maOrder; unsigned mnCurrentOrder; UINT32 mnScriptVar[N_VAR]; ///< variables for use in scripts double mfNextUpdate; ///< time for next update of AI float mfUpdateInterval; ///< interval for AI updates std::string mzActionText; ///< text for script to set to describe current platform action // order methods void AddOrder(const tcOrder& wp); int GetCurrentOrderIdx(void) {return (int)mnCurrentOrder;} int GetOrderCount(void) {return (int)maOrder.size();} void GetOrder(tcOrder& wp, unsigned n); void SetOrder(const tcOrder& wp, unsigned n); void DeleteOrder(unsigned n); void InsertOrderBefore(const tcOrder& wp, unsigned n); void ClearOrders(void); bool HasOrders(void); tcOrder GetCurrentOrder(void); void CompletedOrder(void); void GetNavPoints(std::vector<tcPoint> *mpPoints); // script variable methods UINT32 GetVar(int n); void SetVar(int n, UINT32 val); void Clear(void); void ClearVars(); void GetActionText(std::string& text) {text = mzActionText;} void SetTarget(long anId) {mnTargetID = anId;} long GetTarget(void) {return mnTargetID;} // long to work better with Python void ClearTarget(void) {mnTargetID = NULL_INDEX;} tcAIData(void); virtual ~tcAIData(void); private: long mnTargetID; ///< target for AI engagements }; } #endif Index: ScriptedTaskInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/ScriptedTaskInterface.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ScriptedTaskInterface.h 24 Feb 2005 22:19:13 -0000 1.2 --- ScriptedTaskInterface.h 1 Jun 2005 00:13:25 -0000 1.3 *************** *** 33,37 **** #include <vector> ! namespace ScriptInterface { class tcPlatformInterface; --- 33,37 ---- #include <vector> ! namespace scriptinterface { class tcPlatformInterface; Index: Task.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/Task.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Task.h 24 Feb 2005 22:19:13 -0000 1.4 --- Task.h 1 Jun 2005 00:13:25 -0000 1.5 *************** *** 33,42 **** #include <vector> ! namespace ScriptInterface { class tcPlatformInterface; } ! using ScriptInterface::tcPlatformInterface; class tcPlatformObject; --- 33,42 ---- #include <vector> ! namespace scriptinterface { class tcPlatformInterface; } ! using scriptinterface::tcPlatformInterface; class tcPlatformObject; |
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:09
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/src/common Modified Files: math_constants.cpp nsNav.cpp Log Message: namespace housekeeping Index: nsNav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/nsNav.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nsNav.cpp 8 Aug 2004 00:31:33 -0000 1.7 --- nsNav.cpp 1 Jun 2005 00:13:28 -0000 1.8 *************** *** 18,24 **** */ ! #include "wx/wx.h" ! #ifdef WIN32 ! #include "wx/msw/private.h" // for MS Windows specific definitions #endif --- 18,25 ---- */ ! #include "stdwx.h" ! ! #ifndef WX_PRECOMP ! #include "wx/wx.h" #endif *************** *** 34,38 **** // both points are assumed to be at sea level #define GCDISTANCE_APPROXDELTA 2.0f*C_PIOVER180 ! float nsNav::GCDistance_rad(tsGeoPointRad a, tsGeoPointRad b) { float fDeltaLat = fabsf(a.mfLat_rad - b.mfLat_rad); --- 35,41 ---- // both points are assumed to be at sea level #define GCDISTANCE_APPROXDELTA 2.0f*C_PIOVER180 ! ! float nsNav::GCDistance_rad(tsGeoPointRad a, tsGeoPointRad b) ! { float fDeltaLat = fabsf(a.mfLat_rad - b.mfLat_rad); *************** *** 56,60 **** } } ! // version that always uses approximation float nsNav::GCDistanceApprox_rad(tsGeoPointRad a, tsGeoPointRad b) { --- 59,66 ---- } } ! ! /** ! * version that always uses approximation ! */ float nsNav::GCDistanceApprox_rad(tsGeoPointRad a, tsGeoPointRad b) { *************** *** 83,86 **** --- 89,94 ---- return sqrtf(fDeltaLat*fDeltaLat + adjustedLon*adjustedLon); } + + float nsNav::GCDistanceApprox_rad(float afLatA_rad, float afLonA_rad, float afLatB_rad, float afLonB_rad, *************** *** 98,101 **** --- 106,110 ---- return sqrtf(fDeltaLat*fDeltaLat + adjustedLon*adjustedLon + fDeltaAlt*fDeltaAlt); } + /** * great circle heading from point a to point b *************** *** 279,280 **** --- 288,290 ---- } + Index: math_constants.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/math_constants.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** math_constants.cpp 8 Aug 2004 00:31:33 -0000 1.4 --- math_constants.cpp 1 Jun 2005 00:13:28 -0000 1.5 *************** *** 21,30 **** #include "math_constants.h" ! namespace UnitConversions { ! double toRadians(double deg) {return C_PIOVER180*deg;} ! float toRadians(float deg) {return C_PIOVER180*deg;} ! double toDegrees(double rad) {return C_180OVERPI*rad;} ! float toDegrees(float rad) {return C_180OVERPI*rad;} } --- 21,44 ---- #include "math_constants.h" ! ! double UnitConversions::toRadians(double deg) { ! return C_PIOVER180*deg; ! } ! ! float UnitConversions::toRadians(float deg) ! { ! return C_PIOVER180*deg; ! } ! ! double UnitConversions::toDegrees(double rad) ! { ! return C_180OVERPI*rad; } + float UnitConversions::toDegrees(float rad) + { + return C_180OVERPI*rad; + } + + |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/src/sim Modified Files: Game.cpp tcAero.cpp tcAeroAirObject.cpp tcDirectorEvent.cpp tcFlightOpsObject.cpp tcFlightPort.cpp tcGameObject.cpp tcLauncher.cpp tcLauncherState.cpp tcObjectControl.cpp tcPlatformObject.cpp tcSensorMap.cpp tcSensorMapTrack.cpp tcSensorPlatform.cpp tcSensorTrackIterator.cpp tcSimState.cpp tcWeaponObject.cpp Removed Files: tcAIData.cpp Log Message: namespace housekeeping Index: tcSensorTrackIterator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorTrackIterator.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSensorTrackIterator.cpp 17 May 2005 00:20:41 -0000 1.2 --- tcSensorTrackIterator.cpp 1 Jun 2005 00:13:33 -0000 1.3 *************** *** 36,40 **** #endif ! namespace Sensor { tcSimState* tcSensorTrackIterator::simState = NULL; --- 36,40 ---- #endif ! tcSimState* tcSensorTrackIterator::simState = NULL; *************** *** 197,199 **** } - } \ No newline at end of file --- 197,198 ---- Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tcObjectControl.cpp 5 May 2005 02:14:54 -0000 1.36 --- tcObjectControl.cpp 1 Jun 2005 00:13:32 -0000 1.37 *************** *** 32,36 **** #include "ai/Brain.h" #include "tcAeroAirObject.h" ! #include "tcAIData.h" #include "tcAirDBObject.h" #include "tcAltitudeBarControl.h" --- 32,36 ---- #include "ai/Brain.h" #include "tcAeroAirObject.h" ! #include "ai/tcAIData.h" #include "tcAirDBObject.h" #include "tcAltitudeBarControl.h" *************** *** 59,64 **** ! using namespace AI; ! using namespace Database; /******************* tcAIPanel ************************/ --- 59,64 ---- ! using namespace ai; ! using namespace database; /******************* tcAIPanel ************************/ Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcFlightPort.cpp 21 May 2005 02:01:04 -0000 1.18 --- tcFlightPort.cpp 1 Jun 2005 00:13:32 -0000 1.19 *************** *** 706,710 **** * Initialize flightport using data in dbObj. */ ! void tcFlightPort::InitFromDatabase(Database::tcFlightportDBObject *dbObj) { wxASSERT(dbObj); --- 706,710 ---- * Initialize flightport using data in dbObj. */ ! void tcFlightPort::InitFromDatabase(database::tcFlightportDBObject *dbObj) { wxASSERT(dbObj); Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcLauncher.cpp 21 May 2005 02:01:04 -0000 1.20 --- tcLauncher.cpp 1 Jun 2005 00:13:32 -0000 1.21 *************** *** 530,534 **** void tcLauncher::UpdateStatus() { ! using namespace Database; if (mnCurrent <= 0) --- 530,534 ---- void tcLauncher::UpdateStatus() { ! using namespace database; if (mnCurrent <= 0) *************** *** 835,839 **** int temp; buffer >> temp; ! meLaunchMode = (Database::teWeaponLaunchMode)temp; buffer >> mnTargetFlags; --- 835,839 ---- int temp; buffer >> temp; ! meLaunchMode = (database::teWeaponLaunchMode)temp; buffer >> mnTargetFlags; Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcPlatformObject.cpp 21 May 2005 02:01:04 -0000 1.46 --- tcPlatformObject.cpp 1 Jun 2005 00:13:33 -0000 1.47 *************** *** 44,48 **** #endif ! using namespace AI; void tcPlatformObject::DesignateDatum(tcPoint p) --- 44,48 ---- #endif ! using namespace ai; void tcPlatformObject::DesignateDatum(tcPoint p) *************** *** 887,891 **** : tcGameObject(obj), tcSensorPlatform() { ! using namespace Database; tcSensorPlatform::Init(obj, this); --- 887,891 ---- : tcGameObject(obj), tcSensorPlatform() { ! using namespace database; tcSensorPlatform::Init(obj, this); Index: tcSensorMap.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMap.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcSensorMap.cpp 17 May 2005 00:20:40 -0000 1.21 --- tcSensorMap.cpp 1 Jun 2005 00:13:33 -0000 1.22 *************** *** 33,38 **** #endif - using namespace Sensor; - --- 33,36 ---- *************** *** 103,107 **** ! bool tcAllianceSensorMap::AddReport(const Sensor::tcSensorReport& report) { tnPoolIndex nTrackID = report.mnTrackID; --- 101,105 ---- ! bool tcAllianceSensorMap::AddReport(const tcSensorReport& report) { tnPoolIndex nTrackID = report.mnTrackID; *************** *** 129,135 **** } ! bool tcAllianceSensorMap::UpdateActiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID, tnPoolIndex anTrackID, ! Sensor::tcSensorMapTrack*& rpSMTrack) { tnPoolIndex nIdx = maTrackToSensorTrack[anTrackID]; --- 127,133 ---- } ! bool tcAllianceSensorMap::UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID, tnPoolIndex anTrackID, ! tcSensorMapTrack*& rpSMTrack) { tnPoolIndex nIdx = maTrackToSensorTrack[anTrackID]; *************** *** 171,177 **** ! bool tcAllianceSensorMap::UpdatePassiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID, tnPoolIndex anTrackID, ! Sensor::tcSensorMapTrack*& rpSMTrack) { tnPoolIndex nIdx = maTrackToSensorTrack[anTrackID]; --- 169,175 ---- ! bool tcAllianceSensorMap::UpdatePassiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID, tnPoolIndex anTrackID, ! tcSensorMapTrack*& rpSMTrack) { tnPoolIndex nIdx = maTrackToSensorTrack[anTrackID]; *************** *** 490,500 **** } ! bool tcSensorMap::AddReport(const Sensor::tcSensorReport& report, UINT8 anAlliance) { tcAllianceSensorMap *pMap = GetMap(anAlliance); return pMap->AddReport(report); } ! bool tcSensorMap::UpdateActiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID, ! tnPoolIndex anTrackID, Sensor::tcSensorMapTrack*& rpSMTrack, UINT8 anAlliance) { --- 488,499 ---- } ! bool tcSensorMap::AddReport(const tcSensorReport& report, UINT8 anAlliance) ! { tcAllianceSensorMap *pMap = GetMap(anAlliance); return pMap->AddReport(report); } ! bool tcSensorMap::UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID, ! tnPoolIndex anTrackID, tcSensorMapTrack*& rpSMTrack, UINT8 anAlliance) { *************** *** 503,508 **** } ! bool tcSensorMap::UpdatePassiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID, ! tnPoolIndex anTrackID, Sensor::tcSensorMapTrack*& rpSMTrack, UINT8 anAlliance) { --- 502,507 ---- } ! bool tcSensorMap::UpdatePassiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID, ! tnPoolIndex anTrackID, tcSensorMapTrack*& rpSMTrack, UINT8 anAlliance) { Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** tcGameObject.cpp 21 May 2005 02:01:04 -0000 1.36 --- tcGameObject.cpp 1 Jun 2005 00:13:32 -0000 1.37 *************** *** 75,79 **** bool tcGameObject::clientMode = false; tcMapData* tcGameObject::mapData = NULL; ! Database::tcDatabase* tcGameObject::database = NULL; tcSimState* tcGameObject::simState = NULL; long tcGameObject::hookedId = -1; --- 75,79 ---- bool tcGameObject::clientMode = false; tcMapData* tcGameObject::mapData = NULL; ! database::tcDatabase* tcGameObject::database = NULL; tcSimState* tcGameObject::simState = NULL; long tcGameObject::hookedId = -1; Index: tcAero.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAero.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcAero.cpp 21 May 2005 02:01:04 -0000 1.7 --- tcAero.cpp 1 Jun 2005 00:13:32 -0000 1.8 *************** *** 33,37 **** #endif ! namespace Aero { --- 33,37 ---- #endif ! *************** *** 39,43 **** * Load state from stream */ ! tcStream& tsMissileKState::operator<<(tcStream& stream) { stream >> mfFlightTime; --- 39,43 ---- * Load state from stream */ ! tcStream& Aero::tsMissileKState::operator<<(tcStream& stream) { stream >> mfFlightTime; *************** *** 55,59 **** * Save state to stream */ ! tcStream& tsMissileKState::operator>>(tcStream& stream) { stream << mfFlightTime; --- 55,59 ---- * Save state to stream */ ! tcStream& Aero::tsMissileKState::operator>>(tcStream& stream) { stream << mfFlightTime; *************** *** 72,76 **** * to table) */ ! float GetAirDensity(float afAltitude_m) { float fDensity_kgm3; // kg/m^3 --- 72,76 ---- * to table) */ ! float Aero::GetAirDensity(float afAltitude_m) { float fDensity_kgm3; // kg/m^3 *************** *** 87,91 **** ** standard atmosphere 1976, 59 deg F model */ ! float GetSoundSpeed(float afAltitude_m) { float fSoundSpeed_mps; --- 87,91 ---- ** standard atmosphere 1976, 59 deg F model */ ! float Aero::GetSoundSpeed(float afAltitude_m) { float fSoundSpeed_mps; *************** *** 105,109 **** ! void UpdateMissileKState(tsMissileKState& k, Database::tcMissileDBObject *apMissileData, float afTimeStep) { float rhv2; --- 105,109 ---- ! void Aero::UpdateMissileKState(tsMissileKState& k, database::tcMissileDBObject *apMissileData, float afTimeStep) { float rhv2; *************** *** 191,195 **** ! } --- 191,195 ---- ! Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** tcSimState.cpp 21 May 2005 02:01:05 -0000 1.81 --- tcSimState.cpp 1 Jun 2005 00:13:33 -0000 1.82 *************** *** 64,71 **** #endif ! using namespace Database; ! using namespace Aero; ! using namespace Sensor; ! using namespace ScriptInterface; --- 64,69 ---- #endif ! using namespace database; ! using namespace scriptinterface; Index: tcWeaponObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcWeaponObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcWeaponObject.cpp 29 Apr 2005 18:52:56 -0000 1.12 --- tcWeaponObject.cpp 1 Jun 2005 00:13:50 -0000 1.13 *************** *** 111,115 **** void tcWeaponObject::SetIntendedTarget(long targetId) { - using namespace Sensor; intendedTarget = targetId; if (targetId == -1) return; --- 111,114 ---- Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcFlightOpsObject.cpp 29 Apr 2005 18:52:55 -0000 1.9 --- tcFlightOpsObject.cpp 1 Jun 2005 00:13:32 -0000 1.10 *************** *** 39,43 **** ! Database::tcDatabase* tcFlightOpsObject::database = 0; --- 39,43 ---- ! database::tcDatabase* tcFlightOpsObject::database = 0; Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcLauncherState.cpp 5 May 2005 02:14:54 -0000 1.30 --- tcLauncherState.cpp 1 Jun 2005 00:13:32 -0000 1.31 *************** *** 179,183 **** int tcLauncherState::GetLauncherStatus(unsigned nLauncher) { ! using namespace Database; if (nLauncher > launchers.size()) --- 179,183 ---- int tcLauncherState::GetLauncherStatus(unsigned nLauncher) { ! using namespace database; if (nLauncher > launchers.size()) Index: tcDirectorEvent.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcDirectorEvent.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcDirectorEvent.cpp 27 Jan 2005 01:01:55 -0000 1.14 --- tcDirectorEvent.cpp 1 Jun 2005 00:13:32 -0000 1.15 *************** *** 44,48 **** #endif - using MapView::tcMapView; /********** tcDirectorEvent ****************/ --- 44,47 ---- Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.131 retrieving revision 1.132 diff -C2 -d -r1.131 -r1.132 *** Game.cpp 8 May 2005 23:28:59 -0000 1.131 --- Game.cpp 1 Jun 2005 00:13:32 -0000 1.132 *************** *** 59,62 **** --- 59,63 ---- #include "tcLauncherPopup.h" #include "tcUserSelectedGroups.h" + #include "tcContainerGui.h" #if defined(_MSC_VER) *************** *** 68,72 **** using namespace std; - using namespace MapView; using network::tcMultiplayerInterface; --- 69,72 ---- *************** *** 991,994 **** --- 991,995 ---- tcPopupMessage::SetParent(tacticalMap); tcLauncherPopup::SetParent(tacticalMap); // should inherit these from common base + tcContainerGui::SetParent(tacticalMap); #if 0 *************** *** 2178,2183 **** case 'h': { ! tcPopupMessage* msg = new tcPopupMessage("TEST", wxPoint(50, 50), 100); ! msg->SetActive(true); } return; --- 2179,2185 ---- case 'h': { ! //tcPopupMessage* msg = new tcPopupMessage("TEST", wxPoint(50, 50), 100); ! //msg->SetActive(true); ! tcContainerGui* gui = new tcContainerGui(wxPoint(250, 50), "xml/test_container.xml", "TestContainer"); } return; Index: tcSensorPlatform.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorPlatform.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSensorPlatform.cpp 21 May 2005 02:01:04 -0000 1.4 --- tcSensorPlatform.cpp 1 Jun 2005 00:13:33 -0000 1.5 *************** *** 327,331 **** void tcSensorPlatform::Init(tcSensorPlatformDBObject* obj, tcGameObject* parent) { ! using namespace Database; // add sensors --- 327,331 ---- void tcSensorPlatform::Init(tcSensorPlatformDBObject* obj, tcGameObject* parent) { ! using namespace database; // add sensors Index: tcSensorMapTrack.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorMapTrack.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSensorMapTrack.cpp 17 May 2005 00:20:41 -0000 1.1 --- tcSensorMapTrack.cpp 1 Jun 2005 00:13:33 -0000 1.2 *************** *** 36,41 **** #endif - using namespace Sensor; - /******************************* tcSensorMapTrack ****************************/ --- 36,39 ---- *************** *** 277,281 **** ! bool tcSensorMapTrack::UpdateActiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID) { int nPassiveIdx = -1; --- 275,279 ---- ! bool tcSensorMapTrack::UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID) { int nPassiveIdx = -1; *************** *** 370,374 **** } ! bool tcSensorMapTrack::UpdatePassiveReport(Sensor::tcSensorReport*& rpReport, tnPoolIndex anSensorID) { //int nPassiveIdx = -1; --- 368,373 ---- } ! bool tcSensorMapTrack::UpdatePassiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID) ! { //int nPassiveIdx = -1; *************** *** 428,432 **** * if not add new report if slots are free */ ! bool tcSensorMapTrack::AddReport(const Sensor::tcSensorReport& report) { // search for existing match --- 427,431 ---- * if not add new report if slots are free */ ! bool tcSensorMapTrack::AddReport(const tcSensorReport& report) { // search for existing match --- tcAIData.cpp DELETED --- Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcAeroAirObject.cpp 27 May 2005 00:28:21 -0000 1.17 --- tcAeroAirObject.cpp 1 Jun 2005 00:13:32 -0000 1.18 *************** *** 39,43 **** #endif ! using namespace Database; --- 39,43 ---- #endif ! using namespace database; *************** *** 249,254 **** { // apply engine thrust and fuel consumption decrease with altitude ! fThrust_N = mpDBObject->mfMaxThrust_N * throttleFraction * thrustFactor; ! fuel_kg -= throttleFraction * fuelEfficiencyFactor * mpDBObject->mfFuelRate_kgps * dt_s * damagePenalty; } --- 249,255 ---- { // apply engine thrust and fuel consumption decrease with altitude ! float thrustMultiplier = throttleFraction * thrustFactor; ! fThrust_N = mpDBObject->mfMaxThrust_N * thrustMultiplier; ! fuel_kg -= thrustMultiplier * fuelEfficiencyFactor * mpDBObject->mfFuelRate_kgps * dt_s * damagePenalty; } *************** *** 279,291 **** float fDrag_N, fThrust_N; - using Aero::GetAirDensity; - using Aero::GetSoundSpeed; tcKinematics& k = mcKin; float mfSpeed_mps = k.mfSpeed_kts*C_KTSTOMPS; ! float rho = GetAirDensity(k.mfAlt_m); rhv2 = rho*mfSpeed_mps*mfSpeed_mps; ! vsound = GetSoundSpeed(k.mfAlt_m); vmach = mfSpeed_mps/vsound; --- 280,290 ---- float fDrag_N, fThrust_N; tcKinematics& k = mcKin; float mfSpeed_mps = k.mfSpeed_kts*C_KTSTOMPS; ! float rho = Aero::GetAirDensity(k.mfAlt_m); rhv2 = rho*mfSpeed_mps*mfSpeed_mps; ! vsound = Aero::GetSoundSpeed(k.mfAlt_m); vmach = mfSpeed_mps/vsound; |
|
From: Dewitt C. <ddc...@us...> - 2005-05-27 00:28:31
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5463/src/sim Modified Files: tcAeroAirObject.cpp Log Message: Modified air model to use thrust factor vs. altitude and fuel efficiency vs. alt tables Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcAeroAirObject.cpp 26 May 2005 11:54:11 -0000 1.16 --- tcAeroAirObject.cpp 27 May 2005 00:28:21 -0000 1.17 *************** *** 242,257 **** // calculate thrust decay factor based on altitude ! float decayFactor = mpDBObject->GetThrustFactor(mcKin.mfAlt_m); ! if (throttleFraction <= 1.0f) { // apply engine thrust and fuel consumption decrease with altitude ! fThrust_N = mpDBObject->mfMaxThrust_N * throttleFraction * decayFactor; ! fuel_kg -= throttleFraction * mpDBObject->mfFuelRate_kgps * dt_s * damagePenalty; } else { ! fThrust_N = mpDBObject->mfAfterburnThrust_N * decayFactor; fuel_kg -= mpDBObject->mfAfterburnFuelRate_kgps * dt_s * damagePenalty; } --- 242,259 ---- // calculate thrust decay factor based on altitude ! float thrustFactor; ! float fuelEfficiencyFactor; ! mpDBObject->GetThrustAndEfficiencyFactors(mcKin.mfAlt_m, thrustFactor, fuelEfficiencyFactor); if (throttleFraction <= 1.0f) { // apply engine thrust and fuel consumption decrease with altitude ! fThrust_N = mpDBObject->mfMaxThrust_N * throttleFraction * thrustFactor; ! fuel_kg -= throttleFraction * fuelEfficiencyFactor * mpDBObject->mfFuelRate_kgps * ! dt_s * damagePenalty; } else { ! fThrust_N = mpDBObject->mfAfterburnThrust_N * thrustFactor; fuel_kg -= mpDBObject->mfAfterburnFuelRate_kgps * dt_s * damagePenalty; } |
|
From: Dewitt C. <ddc...@us...> - 2005-05-27 00:28:31
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5463/src/database Modified Files: tcAirDBObject.cpp Log Message: Modified air model to use thrust factor vs. altitude and fuel efficiency vs. alt tables Index: tcAirDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAirDBObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcAirDBObject.cpp 26 May 2005 11:54:11 -0000 1.13 --- tcAirDBObject.cpp 27 May 2005 00:28:21 -0000 1.14 *************** *** 1,6 **** /* ! ** tcAirDBObject.cpp ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- /* ! ** @file tcAirDBObject.cpp ! */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 34,38 **** namespace Database { ! #define THRUST_DECAY_ALT 5000.0f /** * Calculate private parameters. Should be called after --- 34,60 ---- namespace Database { ! std::vector<float> tcAirDBObject::tableAltitudes; ! ! /** ! * Static function to initialize common table of altitude points (in meters) ! * Must be called once before starting simulation ! */ ! void tcAirDBObject::InitializeTableAltitudes() ! { ! wxASSERT(tableAltitudes.size() == 0); ! tableAltitudes.clear(); ! ! tableAltitudes.push_back(2000.0f); ! tableAltitudes.push_back(4000.0f); ! tableAltitudes.push_back(6000.0f); ! tableAltitudes.push_back(8000.0f); ! tableAltitudes.push_back(10000.0f); ! tableAltitudes.push_back(12000.0f); ! tableAltitudes.push_back(16000.0f); ! tableAltitudes.push_back(20000.0f); ! tableAltitudes.push_back(25000.0f); ! tableAltitudes.push_back(30000.0f); ! } ! /** * Calculate private parameters. Should be called after *************** *** 51,70 **** { invMachRange = 0; ! } ! ! ! // thrustDecayFactor ! const float decay_alt = THRUST_DECAY_ALT; // altitude that decay begins at ! wxASSERT(zeroThrustAltitude_m > decay_alt); ! ! if (zeroThrustAltitude_m > decay_alt) ! { ! thrustDecayFactor = 1.0f / (zeroThrustAltitude_m - 5000.0f); ! } ! else ! { ! thrustDecayFactor = 0; ! } } /** --- 73,80 ---- { invMachRange = 0; ! } } + + /** *************** *** 103,124 **** * Placed here to allow better thrust decay model to be incorporated into * database without affecting air model - * @return thrust decay factor */ ! float tcAirDBObject::GetThrustFactor(float alt_m) const { ! const float decay_alt = THRUST_DECAY_ALT; // altitude that decay begins at ! ! float d_alt = alt_m - decay_alt; ! if (d_alt <= 0) return 1.0f; ! ! float thrustFactor = 1.0f - thrustDecayFactor * d_alt; ! if (thrustFactor > 0) ! { ! return thrustFactor * thrustFactor; ! } ! else ! { ! return 0; ! } } --- 113,149 ---- * Placed here to allow better thrust decay model to be incorporated into * database without affecting air model */ ! void tcAirDBObject::GetThrustAndEfficiencyFactors(float alt_m, float& thrustFactor, float& fuelEfficienyFactor) const { ! thrustFactor = 1.0f; ! fuelEfficienyFactor = 1.0f; ! ! size_t nAlt = tableAltitudes.size(); ! ! if (alt_m < tableAltitudes[0]) return; ! if (alt_m >= tableAltitudes[nAlt-1]) ! { ! thrustFactor = thrustTable[nAlt-1]; ! fuelEfficienyFactor = fuelEfficiencyTable[nAlt-1]; ! return; ! } ! ! // search for position in table and linearly interpolate factors ! for (size_t idx=2; idx<nAlt; idx++) ! { ! float alt_low = tableAltitudes[idx-1]; ! float alt_high = tableAltitudes[idx]; ! if (alt_m <= alt_high) ! { ! float low_weight = (alt_high - alt_m) / (alt_high - alt_low); ! float high_weight = 1.0f - low_weight; ! thrustFactor = low_weight * thrustTable[idx-1] + high_weight * thrustTable[idx]; ! fuelEfficienyFactor = low_weight * fuelEfficiencyTable[idx-1] + ! high_weight * fuelEfficiencyTable[idx]; ! return; ! } ! } ! ! wxASSERT(false); // error, corrupt table } *************** *** 141,149 **** if (mbLoad) { - *csv >> zeroThrustAltitude_m; *csv >> mfAfterburnFuelRate_kgps; ! *csv >> mfAfterburnThrust_N; ! *csv >> mfDragArea_sm; ! *csv >> mfWingArea_sm; *csv >> mfCdpsub; *csv >> mfCdptran; --- 166,171 ---- if (mbLoad) { *csv >> mfAfterburnFuelRate_kgps; ! *csv >> mfAfterburnThrust_N; *csv >> mfCdpsub; *csv >> mfCdptran; *************** *** 157,165 **** else { - *csv << zeroThrustAltitude_m; *csv << mfAfterburnFuelRate_kgps; ! *csv << mfAfterburnThrust_N; ! *csv << mfDragArea_sm; ! *csv << mfWingArea_sm; *csv << mfCdpsub; *csv << mfCdptran; --- 179,184 ---- else { *csv << mfAfterburnFuelRate_kgps; ! *csv << mfAfterburnThrust_N; *csv << mfCdpsub; *csv << mfCdptran; *************** *** 190,198 **** TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("air"))->ToElement(); - localNode->SetAttribute("ZeroThrustAltitude_m", zeroThrustAltitude_m); localNode->SetAttribute("afterburnFuelRate_kgps", mfAfterburnFuelRate_kgps); ! localNode->SetAttribute("afterburnThrust_N", mfAfterburnThrust_N); ! localNode->SetAttribute("dragArea_sm", mfDragArea_sm); ! localNode->SetAttribute("wingArea_sm", mfWingArea_sm); localNode->SetAttribute("cdpsub", mfCdpsub); localNode->SetAttribute("cdptran", mfCdptran); --- 209,214 ---- TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("air"))->ToElement(); localNode->SetAttribute("afterburnFuelRate_kgps", mfAfterburnFuelRate_kgps); ! localNode->SetAttribute("afterburnThrust_N", mfAfterburnThrust_N); localNode->SetAttribute("cdpsub", mfCdpsub); localNode->SetAttribute("cdptran", mfCdptran); *************** *** 213,221 **** csv->SetWriteLineBlock(false); - *csv << "ZeroThrustAltitude_m"; *csv << "AfterburnFuelRate_kgps"; *csv << "AfterburnThrust_N"; - *csv << "DragArea_sm"; - *csv << "WingArea_sm"; *csv << "Cdpsub"; *csv << "Cdptran"; --- 229,234 ---- *************** *** 240,248 **** columnString += ","; - columnString += "ZeroThrustAltitude_m number(5),"; columnString += "ABFuelRate_kgps number(8),"; columnString += "ABThrust_N number(8),"; - columnString += "DragArea_sm number(8),"; - columnString += "WingArea_sm number(8),"; columnString += "Cdpsub number(8),"; columnString += "Cdptran number(8),"; --- 253,258 ---- *************** *** 254,257 **** --- 264,286 ---- columnString += "Gmax number(8)"; + if (tableAltitudes.size() == 0) + { + InitializeTableAltitudes(); + } + + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + wxString s; + s.Printf(",T%d number(5)", int(0.001f*tableAltitudes[idx])); + columnString += s.c_str(); + } + + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + wxString s; + s.Printf(",FE%d number(5)", int(0.001f*tableAltitudes[idx])); + columnString += s.c_str(); + } + } *************** *** 260,268 **** tcGenericDBObject::ReadSql(entry); - zeroThrustAltitude_m = entry.GetDouble("ZeroThrustAltitude_m"); mfAfterburnFuelRate_kgps = entry.GetDouble("ABFuelRate_kgps"); ! mfAfterburnThrust_N = entry.GetDouble("ABThrust_N"); ! mfDragArea_sm = entry.GetDouble("DragArea_sm"); ! mfWingArea_sm = entry.GetDouble("WingArea_sm"); mfCdpsub = entry.GetDouble("Cdpsub"); mfCdptran = entry.GetDouble("Cdptran"); --- 289,294 ---- tcGenericDBObject::ReadSql(entry); mfAfterburnFuelRate_kgps = entry.GetDouble("ABFuelRate_kgps"); ! mfAfterburnThrust_N = entry.GetDouble("ABThrust_N"); mfCdpsub = entry.GetDouble("Cdpsub"); mfCdptran = entry.GetDouble("Cdptran"); *************** *** 274,277 **** --- 300,322 ---- mfGmax = entry.GetDouble("Gmax"); + thrustTable.clear(); + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + wxString s; + s.Printf("T%d", int(0.001f*tableAltitudes[idx])); + float thrustFactor = entry.GetDouble(s.c_str()); + thrustTable.push_back(thrustFactor); + } + + fuelEfficiencyTable.clear(); + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + wxString s; + s.Printf("FE%d", int(0.001f*tableAltitudes[idx])); + float fuelEfficiency = entry.GetDouble(s.c_str()); + fuelEfficiencyTable.push_back(fuelEfficiency); + } + + CalculateParams(); } *************** *** 284,292 **** s << ","; - s << zeroThrustAltitude_m << ","; s << mfAfterburnFuelRate_kgps << ","; ! s << mfAfterburnThrust_N << ","; ! s << mfDragArea_sm << ","; ! s << mfWingArea_sm << ","; s << mfCdpsub << ","; s << mfCdptran << ","; --- 329,334 ---- s << ","; s << mfAfterburnFuelRate_kgps << ","; ! s << mfAfterburnThrust_N << ","; s << mfCdpsub << ","; s << mfCdptran << ","; *************** *** 298,301 **** --- 340,355 ---- s << mfGmax; + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + s << ","; + s << thrustTable[idx]; + } + + for (size_t idx=0; idx<tableAltitudes.size(); idx++) + { + s << ","; + s << fuelEfficiencyTable[idx]; + } + valueString += s.str(); *************** *** 304,326 **** tcAirDBObject::tcAirDBObject() ! : thrustDecayFactor(0), ! invMachRange(0) { mnClassID = DTYPE_AIR; mnModelType = MTYPE_FIXEDWINGX; mnType = PTYPE_FIXEDWING; // functional classification } tcAirDBObject::tcAirDBObject(tcAirDBObject& obj) : tcGenericDBObject(obj), - thrustDecayFactor(obj.thrustDecayFactor), invMachRange(obj.invMachRange) { mnClassID = DTYPE_AIR; ! zeroThrustAltitude_m = obj.zeroThrustAltitude_m; mfAfterburnFuelRate_kgps = obj.mfAfterburnFuelRate_kgps; ! mfAfterburnThrust_N = obj.mfAfterburnThrust_N; ! mfDragArea_sm = obj.mfDragArea_sm; ! mfWingArea_sm = obj.mfWingArea_sm; mfCdpsub = obj.mfCdpsub; mfCdptran = obj.mfCdptran; --- 358,381 ---- tcAirDBObject::tcAirDBObject() ! : invMachRange(0) { mnClassID = DTYPE_AIR; mnModelType = MTYPE_FIXEDWINGX; mnType = PTYPE_FIXEDWING; // functional classification + + if (tableAltitudes.size() == 0) + { + InitializeTableAltitudes(); + } } tcAirDBObject::tcAirDBObject(tcAirDBObject& obj) : tcGenericDBObject(obj), invMachRange(obj.invMachRange) { mnClassID = DTYPE_AIR; ! mfAfterburnFuelRate_kgps = obj.mfAfterburnFuelRate_kgps; ! mfAfterburnThrust_N = obj.mfAfterburnThrust_N; mfCdpsub = obj.mfCdpsub; mfCdptran = obj.mfCdptran; *************** *** 331,334 **** --- 386,394 ---- stallSpeed_mps = obj.stallSpeed_mps; mfGmax = obj.mfGmax; + + if (tableAltitudes.size() == 0) + { + InitializeTableAltitudes(); + } } |
|
From: Dewitt C. <ddc...@us...> - 2005-05-27 00:28:14
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5373/include/database Modified Files: tcAirDBObject.h Log Message: Modified air model to use thrust factor vs. altitude and fuel efficiency vs. alt tables Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcAirDBObject.h 26 May 2005 11:53:37 -0000 1.11 --- tcAirDBObject.h 27 May 2005 00:28:04 -0000 1.12 *************** *** 1,4 **** ! /* ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcAirDBObject.h ! */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 50,64 **** { public: - float zeroThrustAltitude_m; ///< [m] altitude where thrust falls to zero with parametric model float mfAfterburnFuelRate_kgps; ///< [kg/s] with afterburners float mfAfterburnThrust_N; ///< [N] afterburners engine thrust ! float mfDragArea_sm; ///< equivalent flat plate area for parasitic drag ! float mfWingArea_sm; ///< wing (lift) area ! float mfCdpsub; ///< parasitic drag coeff, subsonic, modifies flat plate drag area ! float mfCdptran; ///< transonic ! float mfCdpsup; ///< supersonic float mfMcm; ///< critical mach number float mfMsupm; ///< supersonic mach number ! float mfKdi; ///< constant for simplified induced drag model float stallSpeed_mps; ///< [m/s] stall speed at sea level float mfGmax; ///< max Gs --- 52,63 ---- { public: float mfAfterburnFuelRate_kgps; ///< [kg/s] with afterburners float mfAfterburnThrust_N; ///< [N] afterburners engine thrust ! float mfCdpsub; ///< parasitic "flat plate" drag area, subsonic ! float mfCdptran; ///< transonic drag area ! float mfCdpsup; ///< supersonic drag area float mfMcm; ///< critical mach number float mfMsupm; ///< supersonic mach number ! float mfKdi; ///< constant for induced drag model float stallSpeed_mps; ///< [m/s] stall speed at sea level float mfGmax; ///< max Gs *************** *** 66,70 **** float GetParasiticDragCoefficient(float vmach) const; ! float GetThrustFactor(float alt_m) const; virtual const char* GetClassName() {return "Air";} ///< returns class name of database object --- 65,69 ---- float GetParasiticDragCoefficient(float vmach) const; ! void GetThrustAndEfficiencyFactors(float alt_m, float& thrustFactor, float& fuelEfficienyFactor) const; virtual const char* GetClassName() {return "Air";} ///< returns class name of database object *************** *** 85,94 **** private: - void CalculateParams(); - // calculated parameters float invMachRange; ///< 1 / (width of transonic) ! float thrustDecayFactor; ! }; --- 84,96 ---- private: // calculated parameters float invMachRange; ///< 1 / (width of transonic) ! ! std::vector<float> thrustTable; ///< vector of thrust factor vs. altitude point ! std::vector<float> fuelEfficiencyTable; ///< vector of fuel efficiency vs. altitude point ! static std::vector<float> tableAltitudes; ///< altitudes for thrust and fuel efficiency tables ! ! void CalculateParams(); ! static void InitializeTableAltitudes(); }; |
|
From: Dewitt C. <ddc...@us...> - 2005-05-26 11:54:26
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29026/src/database Modified Files: tcAirDBObject.cpp tcLauncherDBObject.cpp Log Message: air model changes Index: tcAirDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAirDBObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcAirDBObject.cpp 21 May 2005 02:01:04 -0000 1.12 --- tcAirDBObject.cpp 26 May 2005 11:54:11 -0000 1.13 *************** *** 34,39 **** namespace Database { ! ! /** * workaround for write serialization issue --- 34,126 ---- namespace Database { ! #define THRUST_DECAY_ALT 5000.0f ! /** ! * Calculate private parameters. Should be called after ! * object is loaded. ! */ ! void tcAirDBObject::CalculateParams() ! { ! // invMachRange ! wxASSERT(mfMsupm > mfMcm); ! ! if (mfMsupm > mfMcm) ! { ! invMachRange = 1.0f / (mfMsupm - mfMcm); ! } ! else ! { ! invMachRange = 0; ! } ! ! ! // thrustDecayFactor ! const float decay_alt = THRUST_DECAY_ALT; // altitude that decay begins at ! wxASSERT(zeroThrustAltitude_m > decay_alt); ! ! if (zeroThrustAltitude_m > decay_alt) ! { ! thrustDecayFactor = 1.0f / (zeroThrustAltitude_m - 5000.0f); ! } ! else ! { ! thrustDecayFactor = 0; ! } ! } ! ! /** ! * @param vmach Speed divided by speed of sound (mach number) ! * @return interpolated parasitic drag coeff ! */ ! float tcAirDBObject::GetParasiticDragCoefficient(float vmach) const ! { ! float K_dp; // parasitic drag coeff ! float mcrit = mfMcm; // critical mach number ! float msup = mfMsupm; // midpoint of transonic region ! float mtran = 0.5f*(mcrit + msup); // start of supersonic region ! ! if (vmach <= mcrit) ! { ! K_dp = mfCdpsub; // drag coeff includes 0.5*area factor ! } ! else if (vmach >= msup) ! { ! K_dp = mfCdpsup; ! } ! else if (vmach <= mtran) ! { ! K_dp = 2.0f * (vmach - mcrit) * (mfCdptran - mfCdpsub) * invMachRange ! + mfCdpsub; ! } ! else // (vmach > mtran)&&(vmach < msup) ! { ! K_dp = 2.0f * (msup - vmach) * (mfCdptran - mfCdpsup) * invMachRange ! + mfCdpsup; ! } ! return K_dp; ! } ! ! /** ! * Placed here to allow better thrust decay model to be incorporated into ! * database without affecting air model ! * @return thrust decay factor ! */ ! float tcAirDBObject::GetThrustFactor(float alt_m) const ! { ! const float decay_alt = THRUST_DECAY_ALT; // altitude that decay begins at ! ! float d_alt = alt_m - decay_alt; ! if (d_alt <= 0) return 1.0f; ! ! float thrustFactor = 1.0f - thrustDecayFactor * d_alt; ! if (thrustFactor > 0) ! { ! return thrustFactor * thrustFactor; ! } ! else ! { ! return 0; ! } ! } ! /** * workaround for write serialization issue *************** *** 54,58 **** if (mbLoad) { ! *csv >> mfAltThrustDecay_pm; *csv >> mfAfterburnFuelRate_kgps; *csv >> mfAfterburnThrust_N; --- 141,145 ---- if (mbLoad) { ! *csv >> zeroThrustAltitude_m; *csv >> mfAfterburnFuelRate_kgps; *csv >> mfAfterburnThrust_N; *************** *** 70,74 **** else { ! *csv << mfAltThrustDecay_pm; *csv << mfAfterburnFuelRate_kgps; *csv << mfAfterburnThrust_N; --- 157,161 ---- else { ! *csv << zeroThrustAltitude_m; *csv << mfAfterburnFuelRate_kgps; *csv << mfAfterburnThrust_N; *************** *** 86,89 **** --- 173,179 ---- csv->WriteLine(); } + + CalculateParams(); + return 1; } *************** *** 100,104 **** TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("air"))->ToElement(); ! localNode->SetAttribute("altThrustDecay_pm", mfAltThrustDecay_pm); localNode->SetAttribute("afterburnFuelRate_kgps", mfAfterburnFuelRate_kgps); localNode->SetAttribute("afterburnThrust_N", mfAfterburnThrust_N); --- 190,194 ---- TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("air"))->ToElement(); ! localNode->SetAttribute("ZeroThrustAltitude_m", zeroThrustAltitude_m); localNode->SetAttribute("afterburnFuelRate_kgps", mfAfterburnFuelRate_kgps); localNode->SetAttribute("afterburnThrust_N", mfAfterburnThrust_N); *************** *** 123,127 **** csv->SetWriteLineBlock(false); ! *csv << "Thrust altitude decay factor [1/m]"; *csv << "AfterburnFuelRate_kgps"; *csv << "AfterburnThrust_N"; --- 213,217 ---- csv->SetWriteLineBlock(false); ! *csv << "ZeroThrustAltitude_m"; *csv << "AfterburnFuelRate_kgps"; *csv << "AfterburnThrust_N"; *************** *** 150,154 **** columnString += ","; ! columnString += "ThrustDecay number(8),"; columnString += "ABFuelRate_kgps number(8),"; columnString += "ABThrust_N number(8),"; --- 240,244 ---- columnString += ","; ! columnString += "ZeroThrustAltitude_m number(5),"; columnString += "ABFuelRate_kgps number(8),"; columnString += "ABThrust_N number(8),"; *************** *** 170,174 **** tcGenericDBObject::ReadSql(entry); ! mfAltThrustDecay_pm = entry.GetDouble("ThrustDecay"); mfAfterburnFuelRate_kgps = entry.GetDouble("ABFuelRate_kgps"); mfAfterburnThrust_N = entry.GetDouble("ABThrust_N"); --- 260,264 ---- tcGenericDBObject::ReadSql(entry); ! zeroThrustAltitude_m = entry.GetDouble("ZeroThrustAltitude_m"); mfAfterburnFuelRate_kgps = entry.GetDouble("ABFuelRate_kgps"); mfAfterburnThrust_N = entry.GetDouble("ABThrust_N"); *************** *** 183,187 **** stallSpeed_mps = entry.GetDouble("StallSpeed_mps"); mfGmax = entry.GetDouble("Gmax"); ! } --- 273,278 ---- stallSpeed_mps = entry.GetDouble("StallSpeed_mps"); mfGmax = entry.GetDouble("Gmax"); ! ! CalculateParams(); } *************** *** 193,197 **** s << ","; ! s << mfAltThrustDecay_pm << ","; s << mfAfterburnFuelRate_kgps << ","; s << mfAfterburnThrust_N << ","; --- 284,288 ---- s << ","; ! s << zeroThrustAltitude_m << ","; s << mfAfterburnFuelRate_kgps << ","; s << mfAfterburnThrust_N << ","; *************** *** 213,216 **** --- 304,309 ---- tcAirDBObject::tcAirDBObject() + : thrustDecayFactor(0), + invMachRange(0) { mnClassID = DTYPE_AIR; *************** *** 220,227 **** tcAirDBObject::tcAirDBObject(tcAirDBObject& obj) ! : tcGenericDBObject(obj) { mnClassID = DTYPE_AIR; ! mfAltThrustDecay_pm = obj.mfAltThrustDecay_pm; mfAfterburnFuelRate_kgps = obj.mfAfterburnFuelRate_kgps; mfAfterburnThrust_N = obj.mfAfterburnThrust_N; --- 313,322 ---- tcAirDBObject::tcAirDBObject(tcAirDBObject& obj) ! : tcGenericDBObject(obj), ! thrustDecayFactor(obj.thrustDecayFactor), ! invMachRange(obj.invMachRange) { mnClassID = DTYPE_AIR; ! zeroThrustAltitude_m = obj.zeroThrustAltitude_m; mfAfterburnFuelRate_kgps = obj.mfAfterburnFuelRate_kgps; mfAfterburnThrust_N = obj.mfAfterburnThrust_N; Index: tcLauncherDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcLauncherDBObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcLauncherDBObject.cpp 4 Feb 2005 18:50:35 -0000 1.14 --- tcLauncherDBObject.cpp 26 May 2005 11:54:11 -0000 1.15 *************** *** 243,247 **** maChildClass[mnConfigurations] = entry.GetString(s.GetBuffer()).c_str(); ! if (strlen(maChildClass[mnConfigurations].mz) > 0) { mnConfigurations++; --- 243,247 ---- maChildClass[mnConfigurations] = entry.GetString(s.GetBuffer()).c_str(); ! if (strlen(maChildClass[mnConfigurations].mz) > 2) { mnConfigurations++; |
|
From: Dewitt C. <ddc...@us...> - 2005-05-26 11:54:22
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29026/src/sim Modified Files: tcAeroAirObject.cpp tcMapData.cpp Log Message: air model changes Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcMapData.cpp 11 Mar 2005 02:34:58 -0000 1.18 --- tcMapData.cpp 26 May 2005 11:54:12 -0000 1.19 *************** *** 364,370 **** void tcMapData::CreatePalettes() { ! int nRed,nGreen,nBlue,nAlpha; - nAlpha = 255; for (int k=0; k<100; k++) { --- 364,371 ---- void tcMapData::CreatePalettes() { ! unsigned int nRed,nGreen,nBlue; ! ! unsigned int alpha_val = 0xFF000000; for (int k=0; k<100; k++) { *************** *** 372,376 **** nGreen = 10; nBlue = 90; ! maPalette1[k] = nRed + (nGreen << 8) + (nBlue << 16) + (nAlpha << 24); } for (k=100; k<1024; k++) --- 373,377 ---- nGreen = 10; nBlue = 90; ! maPalette1[k] = nRed + (nGreen << 8) + (nBlue << 16) + alpha_val; } for (k=100; k<1024; k++) *************** *** 380,387 **** nBlue = (k-100)*8/10; ! nRed = min(255,nRed+80); ! nGreen = min(255,nGreen+80); ! nBlue = min(255,nBlue+60); ! maPalette1[k] = nRed + (nGreen << 8) + (nBlue << 16) + (nAlpha << 24); } } --- 381,395 ---- nBlue = (k-100)*8/10; ! /* For some reason values have to be limited to 128 to avoid distorted colors. ! ** This started happening after switching the terrain map to use osg::Texture ! */ ! nRed = min(128,nRed+80); ! nGreen = min(128,nGreen+80); ! nBlue = min(128,nBlue+60); ! ! maPalette1[k] = nRed + (nGreen << 8) + (nBlue << 16) + alpha_val; ! //unsigned int nGray = (k-100); ! //if (nGray > 128) nGray = 128; ! //maPalette1[k] = nGray + (nGray << 8) + (nGray << 16) + alpha_val; } } *************** *** 1180,1186 **** pval = (anMapID==0) ? maGlobal[m][n] : maTheater[m][n]; // TODO: move out of loop somehow nPaletteIndex = (pval/10) + 100; ! if (nPaletteIndex > 147) // TODO bug here that needs fixing, higher values distort on texture { ! nPaletteIndex = 147; } else if (nPaletteIndex < 0) --- 1188,1194 ---- pval = (anMapID==0) ? maGlobal[m][n] : maTheater[m][n]; // TODO: move out of loop somehow nPaletteIndex = (pval/10) + 100; ! if (nPaletteIndex > 247) // TODO bug here that needs fixing, higher values distort on texture { ! nPaletteIndex = 247; } else if (nPaletteIndex < 0) Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcAeroAirObject.cpp 21 May 2005 02:01:04 -0000 1.15 --- tcAeroAirObject.cpp 26 May 2005 11:54:11 -0000 1.16 *************** *** 225,260 **** * @return parasitic drag coeff including 0.5 factor */ ! float tcAeroAirObject::GetParasiticDragCoefficient(float vmach) { ! float mcrit; // critical mach number ! float mtran; // midpoint of transonic region ! float msup; // start of supersonice region ! float K_dp; // parasitic drag coeff ! ! // parasitic drag coeff calculation ! mcrit = mpDBObject->mfMcm; ! msup = mpDBObject->mfMsupm; ! mtran = 0.5f*(mcrit + msup); ! ! ! if (vmach <= mcrit) ! { ! K_dp = mpDBObject->mfCdpsub; // drag coeff includes 0.5*area factor ! } ! else if (vmach >= msup) ! { ! K_dp = mpDBObject->mfCdpsup; ! } ! else if (vmach <= mtran) ! { ! K_dp = (vmach - mcrit)*(mpDBObject->mfCdptran-mpDBObject->mfCdpsub)/(mtran-mcrit) ! + mpDBObject->mfCdpsub; ! } ! else // (vmach > mtran)&&(vmach < msup) ! { ! K_dp = (msup - vmach)*(mpDBObject->mfCdptran-mpDBObject->mfCdpsup)/(msup-mtran) ! + mpDBObject->mfCdpsup; ! } ! return K_dp; } --- 225,231 ---- * @return parasitic drag coeff including 0.5 factor */ ! float tcAeroAirObject::GetParasiticDragCoefficient(float vmach) const { ! return mpDBObject->GetParasiticDragCoefficient(vmach); } *************** *** 271,282 **** // calculate thrust decay factor based on altitude ! float decayFactor = 1.0f; ! const float decayAlt = 5000.0f; // altitude to start decay at ! if (mcKin.mfAlt_m > decayAlt) ! { ! float dalt = mcKin.mfAlt_m - decayAlt; ! decayFactor = expf(-(dalt * dalt * mpDBObject->mfAltThrustDecay_pm)); ! } ! if (throttleFraction <= 1.0f) --- 242,247 ---- // calculate thrust decay factor based on altitude ! float decayFactor = mpDBObject->GetThrustFactor(mcKin.mfAlt_m); ! if (throttleFraction <= 1.0f) *************** *** 340,349 **** float ias_mps = sqrtf(0.8f * rho) * mfSpeed_mps; // approximate indicated airspeed ! float stall_margin = ias_mps - mpDBObject->stallSpeed_mps; - const float induced_drag_zone = 100.0f; - const float aoaConstant = 0.001f; ! if (stall_margin <= 0) { throttleFraction = 1.0f; --- 305,313 ---- float ias_mps = sqrtf(0.8f * rho) * mfSpeed_mps; // approximate indicated airspeed ! const float aoaConstant = 5.0f; // for approximation, aoa = C / IAS ! angleOfAttack = aoaConstant / ias_mps; ! if (ias_mps <= mpDBObject->stallSpeed_mps) { throttleFraction = 1.0f; *************** *** 351,368 **** inducedDrag_N = 0; // stall, no induced drag } ! else if (stall_margin < induced_drag_zone) { ! inducedDrag_N = mpDBObject->mfKdi * (induced_drag_zone - stall_margin); ! angleOfAttack = aoaConstant * (induced_drag_zone - stall_margin); } ! else ! { ! inducedDrag_N = 0; ! angleOfAttack = 0; ! } float netForce_N = fThrust_N - fDrag_N - inducedDrag_N - weight_N *sinf(k.mfClimbAngle_rad); ! /* drag model has some issues, acceleration is too slow, faster accel can ** obtained by climbing and then descending which is not correct. ** Adding a 4.0 factor for faster accel/decel --- 315,328 ---- inducedDrag_N = 0; // stall, no induced drag } ! else { ! // assumes level flight ! inducedDrag_N = mpDBObject->mfKdi * weight_N * angleOfAttack; } ! float netForce_N = fThrust_N - fDrag_N - inducedDrag_N - weight_N *sinf(k.mfClimbAngle_rad); ! /* drag model has issues: acceleration is too slow, faster accel can ** obtained by climbing and then descending which is not correct. ** Adding a 4.0 factor for faster accel/decel |
|
From: Dewitt C. <ddc...@us...> - 2005-05-26 11:54:21
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29026/src/graphics Modified Files: tc3DTerrain.cpp Log Message: air model changes Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tc3DTerrain.cpp 23 Nov 2004 23:30:55 -0000 1.17 --- tc3DTerrain.cpp 26 May 2005 11:54:11 -0000 1.18 *************** *** 343,346 **** --- 343,347 ---- { if (texFactory) delete texFactory; + if (baseTexture) delete baseTexture; } |
|
From: Dewitt C. <ddc...@us...> - 2005-05-26 11:53:51
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28951/include/database Modified Files: tcAirDBObject.h Log Message: air model changes Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcAirDBObject.h 21 May 2005 02:00:27 -0000 1.10 --- tcAirDBObject.h 26 May 2005 11:53:37 -0000 1.11 *************** *** 50,54 **** { public: ! float mfAltThrustDecay_pm; ///< [1/m] available thrust decay with altitude float mfAfterburnFuelRate_kgps; ///< [kg/s] with afterburners float mfAfterburnThrust_N; ///< [N] afterburners engine thrust --- 50,54 ---- { public: ! float zeroThrustAltitude_m; ///< [m] altitude where thrust falls to zero with parametric model float mfAfterburnFuelRate_kgps; ///< [kg/s] with afterburners float mfAfterburnThrust_N; ///< [N] afterburners engine thrust *************** *** 64,67 **** --- 64,71 ---- float mfGmax; ///< max Gs + + float GetParasiticDragCoefficient(float vmach) const; + float GetThrustFactor(float alt_m) const; + virtual const char* GetClassName() {return "Air";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj *************** *** 79,82 **** --- 83,95 ---- tcAirDBObject(tcAirDBObject& obj); ///< copy constructor virtual ~tcAirDBObject(); + + private: + void CalculateParams(); + + // calculated parameters + float invMachRange; ///< 1 / (width of transonic) + float thrustDecayFactor; + + }; } |
|
From: Dewitt C. <ddc...@us...> - 2005-05-26 11:53:50
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28951/include/sim Modified Files: Game.h tcAeroAirObject.h Log Message: air model changes Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcAeroAirObject.h 21 May 2005 02:00:28 -0000 1.11 --- tcAeroAirObject.h 26 May 2005 11:53:37 -0000 1.12 *************** *** 83,87 **** ! float GetParasiticDragCoefficient(float vmach); float UpdateThrust(float dt_s); }; --- 83,87 ---- ! float GetParasiticDragCoefficient(float vmach) const; float UpdateThrust(float dt_s); }; Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Game.h 6 May 2005 23:57:16 -0000 1.56 --- Game.h 26 May 2005 11:53:37 -0000 1.57 *************** *** 51,54 **** --- 51,55 ---- #include "cspDate.h" + namespace ScriptInterface { |
|
From: Dewitt C. <ddc...@us...> - 2005-05-21 02:01:19
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19637/src/sim Modified Files: tcAero.cpp tcAeroAirObject.cpp tcAirObject.cpp tcCommandObject.cpp tcFlightPort.cpp tcGameObject.cpp tcLauncher.cpp tcPlatformObject.cpp tcRadar.cpp tcSensorPlatform.cpp tcSimState.cpp tcStores.cpp Log Message: Mods to allow aircraft to load / unload with airbase stores, simplified flight model Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcFlightPort.cpp 10 May 2005 02:26:06 -0000 1.17 --- tcFlightPort.cpp 21 May 2005 02:01:04 -0000 1.18 *************** *** 782,786 **** if (airstate->current_location == READY) { ! if ((airstate->current_spot >= 0) && (airstate->current_spot < ready_spots.size())) { ready_spots[airstate->current_spot].obj_info = airstate; --- 782,786 ---- if (airstate->current_location == READY) { ! if ((airstate->current_spot >= 0) && ((unsigned)airstate->current_spot < ready_spots.size())) { ready_spots[airstate->current_spot].obj_info = airstate; *************** *** 789,793 **** else if (airstate->current_location == LAUNCH) { ! if ((airstate->current_spot >= 0) && (airstate->current_spot < launch_spots.size())) { launch_spots[airstate->current_spot].obj_info = airstate; --- 789,793 ---- else if (airstate->current_location == LAUNCH) { ! if ((airstate->current_spot >= 0) && ((unsigned)airstate->current_spot < launch_spots.size())) { launch_spots[airstate->current_spot].obj_info = airstate; Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcLauncher.cpp 6 May 2005 23:57:51 -0000 1.19 --- tcLauncher.cpp 21 May 2005 02:01:04 -0000 1.20 *************** *** 39,42 **** --- 39,48 ---- tcSimState* tcLauncher::simState = 0; + void tcLauncher::AttachSimState(tcSimState* ss) + { + simState = ss; + } + + /** * *************** *** 210,213 **** --- 216,237 ---- /** + * This can be a substitute for IsItemCompatible by testing != 0 + * @see IsItemCompatible + */ + unsigned int tcLauncher::GetCapacityForItem(const std::string& item) const + { + unsigned nTypes = GetCompatibleCount(); + for (unsigned k=0; k<nTypes; k++) + { + if (item == mpLauncherDBObj->maChildClass[k].mz) + { + return mpLauncherDBObj->maCapacity[k]; + } + } + + return 0; + } + + /** * @return number of compatible items for this launcher */ *************** *** 383,386 **** --- 407,411 ---- mnUncommitted = 0; errorCode = 0; + capacity = GetCapacityForItem(childClass); // set detailed launch mode if missile *************** *** 441,449 **** { mnCurrent = quantity; ! if (mnCurrent > (int)mpLauncherDBObj->mnCapacity) { ! mnCurrent = (int)mpLauncherDBObj->mnCapacity; } mnUncommitted = mnCurrent; } --- 466,476 ---- { mnCurrent = quantity; ! if (mnCurrent > (int)capacity) { ! mnCurrent = (int)capacity; } mnUncommitted = mnCurrent; + mfTimeToReady = 0; + SetLoadState(false); } *************** *** 664,668 **** long fcID = parent->mnID; ! unsigned fcIdx = fireControlSensorIdx; bool canDetect = simState->RadarCanDetect(nSensorKey, targetObj, --- 691,695 ---- long fcID = parent->mnID; ! unsigned int fcIdx = fireControlSensorIdx; bool canDetect = simState->RadarCanDetect(nSensorKey, targetObj, *************** *** 684,687 **** --- 711,717 ---- } + + + /** * Converts launcher status code into string. *************** *** 774,784 **** wxASSERT(dbObj); wxASSERT(parent); SetChildClass(dbObj->mzChildClass.mz); ! ! mnCurrent = mpLauncherDBObj->mnCapacity; ! mnUncommitted = mpLauncherDBObj->mnCapacity; ! ! if (!simState) simState = tcSimState::Get(); ! } --- 804,811 ---- wxASSERT(dbObj); wxASSERT(parent); + wxASSERT(simState); + SetChildClass(dbObj->mzChildClass.mz); ! SetChildQuantity(capacity); } Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** tcPlatformObject.cpp 8 May 2005 23:28:59 -0000 1.45 --- tcPlatformObject.cpp 21 May 2005 02:01:04 -0000 1.46 *************** *** 667,674 **** if (updateMask & UPDATE_GUIDANCE) { ! ! commandObj.LoadCommandParam(stream, mcGS.mfGoalHeading_deg, HEADING_CMD); ! commandObj.LoadCommandParam(stream, mcGS.mfGoalSpeed_kts, SPEED_CMD); ! commandObj.LoadCommandParam(stream, mcGS.mfGoalAltitude_m, ALT_CMD); stream >> mcGS.mbIntercept; --- 667,673 ---- if (updateMask & UPDATE_GUIDANCE) { ! stream >> mcGS.mfGoalHeading_deg; ! stream >> mcGS.mfGoalSpeed_kts; ! stream >> mcGS.mfGoalAltitude_m; stream >> mcGS.mbIntercept; Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcAeroAirObject.cpp 6 May 2005 23:57:51 -0000 1.14 --- tcAeroAirObject.cpp 21 May 2005 02:01:04 -0000 1.15 *************** *** 48,52 **** tcAirObject::operator<<(stream); ! commandObj.LoadCommandParam(stream, throttleFraction, THROTTLE_CMD); return stream; --- 48,52 ---- tcAirObject::operator<<(stream); ! stream >> throttleFraction; return stream; *************** *** 318,322 **** float mfSpeed_mps = k.mfSpeed_kts*C_KTSTOMPS; ! rhv2 = GetAirDensity(k.mfAlt_m)*mfSpeed_mps*mfSpeed_mps; vsound = GetSoundSpeed(k.mfAlt_m); vmach = mfSpeed_mps/vsound; --- 318,323 ---- float mfSpeed_mps = k.mfSpeed_kts*C_KTSTOMPS; ! float rho = GetAirDensity(k.mfAlt_m); ! rhv2 = rho*mfSpeed_mps*mfSpeed_mps; vsound = GetSoundSpeed(k.mfAlt_m); vmach = mfSpeed_mps/vsound; *************** *** 331,366 **** float weight_N = C_G * mass_kg; ! /* Skip induced drag, angle of attack calculation ! ** for now. TODO add later. ! float inducedDrag_N; ! */ // calculate lift needed to balance weight ! float lift_N = weight_N * cosf(k.mfClimbAngle_rad); ! float Cl = lift_N / (rhv2 * mpDBObject->mfWingArea_sm); ! float inducedDrag_N; ! if (Cl > mpDBObject->mfMaxCl) { throttleFraction = 1.0f; ! mcGS.mfGoalAltitude_m = k.mfAlt_m - 50.0f*mpDBObject->mfMaxCl; // avoid flooding connection with stall adjustments ! //SetAltitude(k.mfAlt_m - 50.0f*mpDBObject->mfMaxCl); // max throttle and dive to get out of stall ! Cl = mpDBObject->mfMaxCl; inducedDrag_N = 0; // stall, no induced drag } ! else if (Cl > 0.9f*mpDBObject->mfMaxCl) ! { ! throttleFraction = 1.0f; ! mcGS.mfGoalAltitude_m = k.mfAlt_m - 500.0f*(Cl-0.9f*mpDBObject->mfMaxCl); ! //SetAltitude(k.mfAlt_m - 500.0f*(Cl-0.9f*mpDBObject->mfMaxCl)); // max throttle and dive to avoid impending stall ! inducedDrag_N = mpDBObject->mfKdi * Cl * Cl * lift_N; ! } ! else { ! inducedDrag_N = mpDBObject->mfKdi * Cl * Cl * lift_N; } ! ! angleOfAttack = Cl*liftCoeffToAoa; ! float netForce_N = fThrust_N - fDrag_N - inducedDrag_N - weight_N *sinf(k.mfClimbAngle_rad); --- 332,364 ---- float weight_N = C_G * mass_kg; ! // calculate lift needed to balance weight ! //float lift_N = weight_N * cosf(k.mfClimbAngle_rad); ! //float Cl = lift_N / (rhv2 * mpDBObject->mfWingArea_sm); ! ! float inducedDrag_N = 0; ! float ias_mps = sqrtf(0.8f * rho) * mfSpeed_mps; // approximate indicated airspeed + float stall_margin = ias_mps - mpDBObject->stallSpeed_mps; ! const float induced_drag_zone = 100.0f; ! const float aoaConstant = 0.001f; ! ! if (stall_margin <= 0) { throttleFraction = 1.0f; ! mcGS.mfGoalAltitude_m = k.mfAlt_m - 50.0f; // avoid flooding connection with stall adjustments inducedDrag_N = 0; // stall, no induced drag } ! else if (stall_margin < induced_drag_zone) { ! inducedDrag_N = mpDBObject->mfKdi * (induced_drag_zone - stall_margin); ! angleOfAttack = aoaConstant * (induced_drag_zone - stall_margin); } ! else ! { ! inducedDrag_N = 0; ! angleOfAttack = 0; ! } float netForce_N = fThrust_N - fDrag_N - inducedDrag_N - weight_N *sinf(k.mfClimbAngle_rad); *************** *** 388,392 **** */ tcAeroAirObject::tcAeroAirObject() ! : tcAirObject(), liftCoeffToAoa(1) { mnModelType = MTYPE_FIXEDWINGX; --- 386,390 ---- */ tcAeroAirObject::tcAeroAirObject() ! : tcAirObject() { mnModelType = MTYPE_FIXEDWINGX; *************** *** 397,401 **** */ tcAeroAirObject::tcAeroAirObject(tcAirDBObject *obj) ! : tcAirObject(obj), liftCoeffToAoa(obj->mfMaxAoa_rad/obj->mfMaxCl) { mpDBObject = obj; --- 395,399 ---- */ tcAeroAirObject::tcAeroAirObject(tcAirDBObject *obj) ! : tcAirObject(obj) { mpDBObject = obj; Index: tcCommandObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCommandObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcCommandObject.cpp 5 May 2005 02:14:54 -0000 1.4 --- tcCommandObject.cpp 21 May 2005 02:01:04 -0000 1.5 *************** *** 51,131 **** - - - /** - * Used with multiplayer client to load a parameter from the server that - * the client can command e.g. heading, speed, altitude. If a client command - * request is outstanding and the server update does not match, then the update - * is ignored. If the update matches, the command flag is cleared representing - * a successful acknowledge of the command. - */ - void tcCommandObject::LoadCommandParam(tcCommandStream& stream, float& param, int flag) - { - float temp; - stream >> temp; // read into temporary variable - - param = temp; // apply update - - /* - - if (stream.GetAck()) - { - if ((commandStatus & flag) && (temp == param)) - { - commandStatus &= (~flag); // clear flag, successful ack - } - } - else // not an ack - { - if (clientMode && (commandStatus & flag)) - { - // ignore update - } - else - { - param = temp; // apply update - commandStatus &= (~flag); // clear flag - } - - } - */ - } - - /** - * version that takes int param - */ - void tcCommandObject::LoadCommandParam(tcCommandStream& stream, int& param, int flag) - { - int temp; - stream >> temp; // read into temporary variable - - param = temp; - - /* - if (stream.GetAck()) - { - if ((commandStatus & flag) && (temp == param)) - { - commandStatus &= (~flag); // clear flag, successful ack - } - } - else // not an ack - { - if (clientMode && (commandStatus & flag)) - { - // ignore update - } - else - { - param = temp; // apply update - commandStatus &= (~flag); // clear flag - } - - } - */ - } - - - /** * Called on new command. Sets bit in commandStatus and --- 51,54 ---- Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcGameObject.cpp 29 Apr 2005 18:52:55 -0000 1.35 --- tcGameObject.cpp 21 May 2005 02:01:04 -0000 1.36 *************** *** 274,277 **** --- 274,294 ---- /** + * O[nChildren] search to verify child + */ + bool tcGameObject::IsChild(const tcGameObject* child) const + { + size_t nChildren = children.size(); + for (size_t n=0; n<nChildren; n++) + { + if (children[n] == child) + { + return true; + } + } + + return false; + } + + /** * Removes child without freeing memory (use for transfers only). */ Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** tcSimState.cpp 8 May 2005 23:28:59 -0000 1.80 --- tcSimState.cpp 21 May 2005 02:01:05 -0000 1.81 *************** *** 2730,2733 **** --- 2730,2734 ---- tcGoal::AttachSimState(this); + tcLauncher::AttachSimState(this); tcLauncherState::AttachSimState(this); tcSensorState::AttachSimState(this); Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcAirObject.cpp 8 May 2005 23:28:59 -0000 1.23 --- tcAirObject.cpp 21 May 2005 02:01:04 -0000 1.24 *************** *** 47,51 **** tcPlatformObject::operator<<(stream); ! commandObj.LoadCommandParam(stream, readyForLanding, LANDING_CMD); return stream; --- 47,51 ---- tcPlatformObject::operator<<(stream); ! stream >> readyForLanding; return stream; Index: tcSensorPlatform.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSensorPlatform.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSensorPlatform.cpp 17 Apr 2005 22:35:32 -0000 1.3 --- tcSensorPlatform.cpp 21 May 2005 02:01:04 -0000 1.4 *************** *** 222,227 **** for(size_t n=0; n < nSensors; n++) { ! sensorCommandObj.LoadCommandParam(stream, sensorState[n]->mbActive, ! (0x01) << n); } --- 222,226 ---- for(size_t n=0; n < nSensors; n++) { ! stream >> sensorState[n]->mbActive; } Index: tcAero.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAero.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcAero.cpp 2 Nov 2004 04:23:56 -0000 1.6 --- tcAero.cpp 21 May 2005 02:01:04 -0000 1.7 *************** *** 68,73 **** } ! ! float GetAirDensity(float afAltitude_m) { float fDensity_kgm3; // kg/m^3 --- 68,77 ---- } ! /** ! * TODO look at replacing this with lookup table (or caching equation ! * to table) ! */ ! float GetAirDensity(float afAltitude_m) ! { float fDensity_kgm3; // kg/m^3 *************** *** 78,92 **** } ! // valid from 0 to 36000 m altitude ! // data source, http://www.digitaldutch.com/atmoscalc/index.htm ! // standard atmosphere 1976, 59 deg F model ! float GetSoundSpeed(float afAltitude_m) { float fSoundSpeed_mps; // speed is slightly low near crossover, 11000 m ! if (afAltitude_m <= 10969.0f) { fSoundSpeed_mps = 340.6335f - 0.0041f*afAltitude_m; } ! else { fSoundSpeed_mps = 303.7310f - 0.001130470f*afAltitude_m + 3.597586e-008f*afAltitude_m*afAltitude_m; --- 82,101 ---- } ! /** ! ** valid from 0 to 36000 m altitude ! ** data source, http://www.digitaldutch.com/atmoscalc/index.htm ! ** standard atmosphere 1976, 59 deg F model ! */ ! float GetSoundSpeed(float afAltitude_m) ! { float fSoundSpeed_mps; // speed is slightly low near crossover, 11000 m ! if (afAltitude_m <= 10969.0f) ! { fSoundSpeed_mps = 340.6335f - 0.0041f*afAltitude_m; } ! else ! { fSoundSpeed_mps = 303.7310f - 0.001130470f*afAltitude_m + 3.597586e-008f*afAltitude_m*afAltitude_m; Index: tcStores.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcStores.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcStores.cpp 2 Dec 2004 04:17:27 -0000 1.2 --- tcStores.cpp 21 May 2005 02:01:05 -0000 1.3 *************** *** 182,186 **** void tcStores::CompleteOperation(StoreOperation& op) { ! tcLauncher* launcher = parent->GetLauncher(op.launcherIdx); wxASSERT(launcher); if (!launcher) return; --- 182,191 ---- void tcStores::CompleteOperation(StoreOperation& op) { ! tcGameObject* obj = GetChildOrParent(op.obj); ! ! wxASSERT(obj); ! if (obj == 0) return; ! ! tcLauncher* launcher = obj->GetLauncher(op.launcherIdx); wxASSERT(launcher); if (!launcher) return; *************** *** 188,203 **** if (op.transferType == StoreOperation::LOAD) { ! launcher->mnCurrent = 1; ! launcher->mnUncommitted = 1; ! launcher->mfTimeToReady = 0; } else { ! AddItems(op.item, op.quantity); ! launcher->mnCurrent = 0; ! launcher->mnUncommitted = 0; ! launcher->mfTimeToReady = 0; } - launcher->SetLoadState(false); // clear load state } --- 193,204 ---- if (op.transferType == StoreOperation::LOAD) { ! launcher->SetChildQuantity(op.quantity); // assumes empty launcher } else { ! wxASSERT(launcher->mnCurrent == op.quantity); // no partial unloading ! AddItems(op.item, launcher->mnCurrent); ! launcher->SetChildQuantity(0); } } *************** *** 240,243 **** --- 241,268 ---- /** + * Helper method to support operations between tcStores and + * child object of parent. + * @return parent if child is 0, child if child is valid, 0 otherwise + */ + tcGameObject* tcStores::GetChildOrParent(tcGameObject* child) + { + wxASSERT(parent); + + if (child == 0) + { + return parent; + } + else if (parent->IsChild(child)) + { + return child; + } + else + { + fprintf(stderr, "tcStores::GetChildOrParent - Child not found\n"); + return 0; + } + } + + /** * */ *************** *** 245,249 **** { wxASSERT(storesDBObj); ! for (size_t n=0; n<storesDBObj->compatibleItems.size(); n++) { if (storesDBObj->compatibleItems[n] == item) return true; --- 270,281 ---- { wxASSERT(storesDBObj); ! ! size_t nCompatible = storesDBObj->compatibleItems.size(); ! ! /* if no compatible items are entered, all items are compatible. ! ** This can be used for airfield depots or other general storage */ ! if (nCompatible == 0) return true; ! ! for (size_t n=0; n<nCompatible; n++) { if (storesDBObj->compatibleItems[n] == item) return true; *************** *** 263,280 **** /** ! * */ ! bool tcStores::LoadLauncher(unsigned int idx, const std::string& item) { ! wxASSERT(parent); ! ! tcLauncher* launcher = parent->GetLauncher(idx); if (launcher->mnCurrent) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Cannot load non-empty launcher\n", ! parent->mzUnit.mz, parent->mzClass.mz); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); } --- 295,318 ---- /** ! * Loads exactly one item into launcher */ ! bool tcStores::LoadLauncher(unsigned int idx, const std::string& item, ! tcGameObject* child) { ! tcGameObject* obj = GetChildOrParent(child); ! ! wxASSERT(obj); ! if (obj == 0) return false; + tcLauncher* launcher = obj->GetLauncher(idx); + wxASSERT(launcher); + if (!launcher) return false; + if (launcher->mnCurrent) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Cannot load non-empty launcher\n", ! obj->mzUnit.mz, obj->mzClass.mz); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); } *************** *** 282,288 **** --- 320,340 ---- } + unsigned int launcherCapacity = launcher->GetCapacityForItem(item); + + if (launcherCapacity == 0) + { + if (obj->IsOwnAlliance()) + { + wxString s = wxString::Format("%s (%s) - Incompatible item for launcher\n", + obj->mzUnit.mz, obj->mzClass.mz); + tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); + } + return false; // item not compatible with launcher + } + std::vector<StoreItem>::iterator iter; bool found = false; int nStores = (int)stores.size(); + unsigned int loadQuantity = 0; for (int k=nStores-1; (k>=0) && !found; k--) { *************** *** 291,295 **** found = true; wxASSERT(stores[k].quantity); ! stores[k].quantity--; if (stores[k].quantity == 0) { --- 343,355 ---- found = true; wxASSERT(stores[k].quantity); ! if (stores[k].quantity >= launcherCapacity) ! { ! loadQuantity = launcherCapacity; ! } ! else ! { ! loadQuantity = stores[k].quantity; ! } ! stores[k].quantity -= loadQuantity; if (stores[k].quantity == 0) { *************** *** 301,308 **** if (!found) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - No %s in %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 361,368 ---- if (!found) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - No %s in %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 317,321 **** for (opIter = ops.begin(); (opIter != ops.end()) && (!found); ++opIter) { ! if (opIter->launcherIdx == idx) { matchIter = opIter; --- 377,381 ---- for (opIter = ops.begin(); (opIter != ops.end()) && (!found); ++opIter) { ! if ((opIter->launcherIdx == idx) && (opIter->obj == child)) { matchIter = opIter; *************** *** 329,336 **** if (matchIter->item == item) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Already loading %s in %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 389,396 ---- if (matchIter->item == item) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Already loading %s in %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 342,346 **** AddItems(matchIter->item, matchIter->quantity); matchIter->item = item; ! matchIter->quantity = 1; // only load 1 at a time matchIter->timeToComplete = storesDBObj->moveTime; } --- 402,406 ---- AddItems(matchIter->item, matchIter->quantity); matchIter->item = item; ! matchIter->quantity = loadQuantity; matchIter->timeToComplete = storesDBObj->moveTime; } *************** *** 350,364 **** op.item = item; op.launcherIdx = idx; ! op.quantity = 1; // only load 1 at a time op.timeToComplete = storesDBObj->moveTime; op.transferType = StoreOperation::LOAD; ops.push_back(op); } ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Loading %s in %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 410,425 ---- op.item = item; op.launcherIdx = idx; ! op.quantity = loadQuantity; op.timeToComplete = storesDBObj->moveTime; op.transferType = StoreOperation::LOAD; + op.obj = child; ops.push_back(op); } ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Loading %s in %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 380,397 **** /** ! * */ ! bool tcStores::UnloadLauncher(unsigned int idx) { ! wxASSERT(parent); ! tcLauncher* launcher = parent->GetLauncher(idx); if (launcher->mnCurrent == 0) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Cannot unload empty launcher\n", ! parent->mzUnit.mz, parent->mzClass.mz); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); } --- 441,463 ---- /** ! * Unloads all items from launcher */ ! bool tcStores::UnloadLauncher(unsigned int idx, tcGameObject* child) { ! tcGameObject* obj = GetChildOrParent(child); ! ! wxASSERT(obj); ! if (obj == 0) return false; ! tcLauncher* launcher = obj->GetLauncher(idx); ! wxASSERT(launcher); ! if (!launcher) return false; if (launcher->mnCurrent == 0) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Cannot unload empty launcher\n", ! obj->mzUnit.mz, obj->mzClass.mz); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); } *************** *** 403,410 **** if (!IsCompatible(item)) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - No magazine to hold %s from %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 469,476 ---- if (!IsCompatible(item)) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - No magazine to hold %s from %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 416,423 **** if (IsFull()) { ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Magazine full, cannot unload %s from %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 482,489 ---- if (IsFull()) { ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Magazine full, cannot unload %s from %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 432,436 **** for (opIter = ops.begin(); (opIter != ops.end()) && (!found); ++opIter) { ! if (opIter->launcherIdx == idx) { matchIter = opIter; --- 498,502 ---- for (opIter = ops.begin(); (opIter != ops.end()) && (!found); ++opIter) { ! if ((opIter->launcherIdx == idx) && (opIter->obj == child)) { matchIter = opIter; *************** *** 443,450 **** wxASSERT(matchIter->transferType == StoreOperation::UNLOAD); ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Already unloading %s from %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 509,516 ---- wxASSERT(matchIter->transferType == StoreOperation::UNLOAD); ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Already unloading %s from %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); *************** *** 459,470 **** op.timeToComplete = storesDBObj->moveTime; op.transferType = StoreOperation::UNLOAD; ops.push_back(op); launcher->SetLoadState(true); ! if (parent->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Unloading %s from %s\n", ! parent->mzUnit.mz, parent->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); --- 525,537 ---- op.timeToComplete = storesDBObj->moveTime; op.transferType = StoreOperation::UNLOAD; + op.obj = child; ops.push_back(op); launcher->SetLoadState(true); ! if (obj->IsOwnAlliance()) { wxString s = wxString::Format("%s (%s) - Unloading %s from %s\n", ! obj->mzUnit.mz, obj->mzClass.mz, item.c_str(), storesDBObj->displayName.c_str()); tcMessageInterface::Get()->ChannelMessage("Info", s.c_str()); Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tcRadar.cpp 29 Apr 2005 18:52:56 -0000 1.28 --- tcRadar.cpp 21 May 2005 02:01:04 -0000 1.29 *************** *** 279,283 **** * guidance from the fire control radar. */ ! void tcRadar::SetIlluminator(long illum_id, unsigned sensor_idx) { wxASSERT(isSemiactive || isCommandReceiver); --- 279,283 ---- * guidance from the fire control radar. */ ! void tcRadar::SetIlluminator(long illum_id, unsigned char sensor_idx) { wxASSERT(isSemiactive || isCommandReceiver); |
|
From: Dewitt C. <ddc...@us...> - 2005-05-21 02:01:14
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19637/src/database Modified Files: CsvTranslator.cpp tcAirDBObject.cpp Log Message: Mods to allow aircraft to load / unload with airbase stores, simplified flight model Index: tcAirDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcAirDBObject.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcAirDBObject.cpp 29 Nov 2004 03:55:04 -0000 1.11 --- tcAirDBObject.cpp 21 May 2005 02:01:04 -0000 1.12 *************** *** 65,70 **** *csv >> mfMsupm; *csv >> mfKdi; ! *csv >> mfMaxAoa_rad; ! *csv >> mfMaxCl; *csv >> mfGmax; } --- 65,69 ---- *csv >> mfMsupm; *csv >> mfKdi; ! *csv >> stallSpeed_mps; *csv >> mfGmax; } *************** *** 82,87 **** *csv << mfMsupm; *csv << mfKdi; ! *csv << mfMaxAoa_rad; ! *csv << mfMaxCl; *csv << mfGmax; --- 81,85 ---- *csv << mfMsupm; *csv << mfKdi; ! *csv << stallSpeed_mps; *csv << mfGmax; *************** *** 113,118 **** localNode->SetAttribute("msupm", mfMsupm); localNode->SetAttribute("kdi", mfKdi); ! localNode->SetAttribute("maxAoa_rad", mfMaxAoa_rad); ! localNode->SetAttribute("maxCl", mfMaxCl); localNode->SetAttribute("gmax", mfGmax); --- 111,115 ---- localNode->SetAttribute("msupm", mfMsupm); localNode->SetAttribute("kdi", mfKdi); ! localNode->SetAttribute("stallSpeed_mps", stallSpeed_mps); localNode->SetAttribute("gmax", mfGmax); *************** *** 137,142 **** *csv << "Msupm"; *csv << "Kdi"; ! *csv << "MaxAoa_rad"; ! *csv << "MaxCl"; *csv << "Gmax"; --- 134,138 ---- *csv << "Msupm"; *csv << "Kdi"; ! *csv << "StallSpeed_mps"; *csv << "Gmax"; *************** *** 165,170 **** columnString += "Msupm number(8),"; columnString += "Kdi number(8),"; ! columnString += "MaxAoa_rad number(8),"; ! columnString += "MaxCl number(8),"; columnString += "Gmax number(8)"; --- 161,165 ---- columnString += "Msupm number(8),"; columnString += "Kdi number(8),"; ! columnString += "StallSpeed_mps number(8),";; columnString += "Gmax number(8)"; *************** *** 186,191 **** mfMsupm = entry.GetDouble("Msupm"); mfKdi = entry.GetDouble("Kdi"); ! mfMaxAoa_rad = entry.GetDouble("MaxAoa_rad"); ! mfMaxCl = entry.GetDouble("MaxCl"); mfGmax = entry.GetDouble("Gmax"); --- 181,185 ---- mfMsupm = entry.GetDouble("Msupm"); mfKdi = entry.GetDouble("Kdi"); ! stallSpeed_mps = entry.GetDouble("StallSpeed_mps"); mfGmax = entry.GetDouble("Gmax"); *************** *** 210,215 **** s << mfMsupm << ","; s << mfKdi << ","; ! s << mfMaxAoa_rad << ","; ! s << mfMaxCl << ","; s << mfGmax; --- 204,208 ---- s << mfMsupm << ","; s << mfKdi << ","; ! s << stallSpeed_mps << ","; s << mfGmax; *************** *** 219,223 **** ! tcAirDBObject::tcAirDBObject(void) { mnClassID = DTYPE_AIR; --- 212,216 ---- ! tcAirDBObject::tcAirDBObject() { mnClassID = DTYPE_AIR; *************** *** 241,251 **** mfMsupm = obj.mfMsupm; mfKdi = obj.mfKdi; ! mfMaxAoa_rad = obj.mfMaxAoa_rad; ! mfMaxCl = obj.mfMaxCl; mfGmax = obj.mfGmax; } ! tcAirDBObject::~tcAirDBObject(void) { } --- 234,243 ---- mfMsupm = obj.mfMsupm; mfKdi = obj.mfKdi; ! stallSpeed_mps = obj.stallSpeed_mps; mfGmax = obj.mfGmax; } ! tcAirDBObject::~tcAirDBObject() { } Index: CsvTranslator.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/CsvTranslator.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CsvTranslator.cpp 8 Aug 2004 00:31:33 -0000 1.5 --- CsvTranslator.cpp 21 May 2005 02:01:04 -0000 1.6 *************** *** 270,273 **** --- 270,279 ---- } + CsvTranslator& CsvTranslator::operator>>(short& val) + { + val = (short int)GetFieldAsInt(fieldIdx++); + return *this; + } + CsvTranslator& CsvTranslator::operator>>(unsigned int& val) { *************** *** 276,279 **** --- 282,291 ---- } + CsvTranslator& CsvTranslator::operator>>(unsigned short& val) + { + val = (unsigned short)GetFieldAsInt(fieldIdx++); + return *this; + } + CsvTranslator& CsvTranslator::operator>>(long& val) { |
|
From: Dewitt C. <ddc...@us...> - 2005-05-21 02:00:38
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19557/include/sim Modified Files: tcAeroAirObject.h tcCommandObject.h tcGameObject.h tcLauncher.h tcRadar.h tcSensorState.h tcStores.h Log Message: Mods to allow aircraft to load / unload with airbase stores, simplified flight model Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcGameObject.h 29 Apr 2005 18:52:02 -0000 1.37 --- tcGameObject.h 21 May 2005 02:00:28 -0000 1.38 *************** *** 121,124 **** --- 121,125 ---- float BearingToRad(tcGameObject& p) const; void AddChild(tcGameObject *child); + bool IsChild(const tcGameObject* child) const; void RemoveChild(tcGameObject *child); virtual void Clear(void); Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcLauncher.h 5 May 2005 02:14:19 -0000 1.14 --- tcLauncher.h 21 May 2005 02:00:28 -0000 1.15 *************** *** 73,77 **** }; ///< launcher status codes ! int mbActive; std::string displayName; --- 73,77 ---- }; ///< launcher status codes ! short int mbActive; std::string displayName; *************** *** 82,99 **** float mfTimeToReady; ! int mnCurrent; ! int mnUncommitted; ///< mnCurrent - mnUncommitted = # pending launch ! int errorCode; ///< used in multiplayer to pass error code to client bool isLoading; ///< true if launcher is offline to load/unload weapons ! GeoPoint msDatum; ///< datum to pass to weapon nav guidance tnPoolIndex mnTargetID; ///< track that seeker can acquire teWeaponLaunchMode meLaunchMode; ! int mnTargetFlags; ///< 0x01 - surface, 0x02 - air, 0x03 - land float pointingAngle; ///< boresight azimuth angle in radians relative nose/bow float pointingElevation; ///< elevation angle in radians relative (to horizon?) tcRadar *fireControlSensor; ///< sensor for fire control guidance ! unsigned fireControlSensorIdx; ///< index of sensor on parent platform // torpedo programming params --- 82,100 ---- float mfTimeToReady; ! short int mnCurrent; ! short int mnUncommitted; ///< mnCurrent - mnUncommitted = # pending launch ! short int errorCode; ///< used in multiplayer to pass error code to client bool isLoading; ///< true if launcher is offline to load/unload weapons ! unsigned short capacity; ///< max capacity for current child class ! GeoPoint msDatum; ///< datum to pass to weapon nav guidance tnPoolIndex mnTargetID; ///< track that seeker can acquire teWeaponLaunchMode meLaunchMode; ! short int mnTargetFlags; ///< 0x01 - surface, 0x02 - air, 0x03 - land float pointingAngle; ///< boresight azimuth angle in radians relative nose/bow float pointingElevation; ///< elevation angle in radians relative (to horizon?) tcRadar *fireControlSensor; ///< sensor for fire control guidance ! unsigned char fireControlSensorIdx; ///< index of sensor on parent platform // torpedo programming params *************** *** 119,123 **** const std::string& GetLauncherName() const; float GetCycleTime() const; ! int GetErrorCode() const {return errorCode;} int GetLauncherStatus(); float GetSectorCenter() const; ///< returns center of engagement sector in radians --- 120,124 ---- const std::string& GetLauncherName() const; float GetCycleTime() const; ! short int GetErrorCode() const {return errorCode;} int GetLauncherStatus(); float GetSectorCenter() const; ///< returns center of engagement sector in radians *************** *** 133,136 **** --- 134,139 ---- void SetLoadState(bool state); void SetParent(tcGameObject *obj); + /// @return max quantity of item that launcher can hold, 0 if not compatible + unsigned int GetCapacityForItem(const std::string& item) const; unsigned int GetCompatibleCount() const; std::string GetCompatibleName(unsigned int idx) const; *************** *** 139,145 **** unsigned char GetStatus() const; void UpdateStatus(); ! static std::string TranslateStatus(int statusCode); ! tcLauncher(); tcLauncher(tcLauncherDBObject* dbObj, tcGameObject* par); --- 142,149 ---- unsigned char GetStatus() const; void UpdateStatus(); ! ! static void AttachSimState(tcSimState* ss); static std::string TranslateStatus(int statusCode); ! tcLauncher(); tcLauncher(tcLauncherDBObject* dbObj, tcGameObject* par); Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcAeroAirObject.h 17 Apr 2005 22:35:00 -0000 1.10 --- tcAeroAirObject.h 21 May 2005 02:00:28 -0000 1.11 *************** *** 81,85 **** float throttleFraction; ///< throttle setting from 0 to 1 military, greater than 1 to use afterburners float angleOfAttack; ///< angle of attack in radians, solved assuming level flight - const float liftCoeffToAoa; ///< factor to convert Cl to AOA --- 81,84 ---- Index: tcCommandObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCommandObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcCommandObject.h 5 May 2005 02:14:19 -0000 1.3 --- tcCommandObject.h 21 May 2005 02:00:28 -0000 1.4 *************** *** 39,46 **** bool HasNewCommand() const; - /// implements rules for updating command params over multiplayer connection - void LoadCommandParam(tcCommandStream& stream, float& param, int flag); - void LoadCommandParam(tcCommandStream& stream, int& param, int flag); - void SetNewCommand(int flag); --- 39,42 ---- Index: tcRadar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcRadar.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcRadar.h 11 Dec 2004 01:09:05 -0000 1.13 --- tcRadar.h 21 May 2005 02:00:28 -0000 1.14 *************** *** 66,74 **** // fire-control vars ! unsigned int fireControlTrackCount; // semi-active and command mode vars long illuminatorID; ///< id of SA illuminating platform ! unsigned illuminatorSensorIdx; ///< sensor index of illum platform virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); --- 66,74 ---- // fire-control vars ! unsigned char fireControlTrackCount; // semi-active and command mode vars long illuminatorID; ///< id of SA illuminating platform ! unsigned char illuminatorSensorIdx; ///< sensor index of illum platform virtual bool CanDetectTarget(const tcGameObject* target, float& range_km); *************** *** 83,87 **** virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetIlluminator(long illum_id, unsigned sensor_idx); void Serialize(tcFile& file, bool mbLoad); --- 83,87 ---- virtual bool IsSemiactive() const {return isSemiactive;} virtual void SetCommandState(bool state); ! virtual void SetIlluminator(long illum_id, unsigned char sensor_idx); void Serialize(tcFile& file, bool mbLoad); Index: tcStores.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcStores.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcStores.h 29 Nov 2004 03:54:49 -0000 1.1 --- tcStores.h 21 May 2005 02:00:28 -0000 1.2 *************** *** 37,40 **** --- 37,41 ---- using namespace Database; + class tcGameObject; class tcPlatformObject; *************** *** 70,73 **** --- 71,75 ---- unsigned int launcherIdx; ///< launcher idx to transfer to/from int transferType; ///< UNLOAD or LOAD + tcGameObject* obj; ///< 0 for local platform, otherwise child obj }; *************** *** 77,83 **** bool IsCompatible(const std::string& item) const; bool IsFull() const; ! bool LoadLauncher(unsigned int idx, const std::string& item); void SetParent(tcPlatformObject* obj); ! bool UnloadLauncher(unsigned int idx); void Update(double t); --- 79,86 ---- bool IsCompatible(const std::string& item) const; bool IsFull() const; ! bool LoadLauncher(unsigned int idx, const std::string& item, ! tcGameObject* child = 0); void SetParent(tcPlatformObject* obj); ! bool UnloadLauncher(unsigned int idx, tcGameObject* child = 0); void Update(double t); *************** *** 105,108 **** --- 108,112 ---- void CompleteOperation(StoreOperation& op); + tcGameObject* GetChildOrParent(tcGameObject* child); }; #endif \ No newline at end of file Index: tcSensorState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorState.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcSensorState.h 29 Mar 2005 00:12:24 -0000 1.16 --- tcSensorState.h 21 May 2005 02:00:28 -0000 1.17 *************** *** 55,65 **** { public: ! int mbActive; ! tcGameObject *parent; ! tnPoolIndex mnDBKey; tcSensorDBObject* mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; ! int mnMode; tcTrack mcTrack; //GeoPoint msCurrentPos; ///< current true position of sensor --- 55,65 ---- { public: ! short int mbActive; ! tcGameObject* parent; ! long mnDBKey; tcSensorDBObject* mpDBObj; double mfLastScan; float mfCurrentScanPeriod_s; ! short int mnMode; tcTrack mcTrack; //GeoPoint msCurrentPos; ///< current true position of sensor |
|
From: Dewitt C. <ddc...@us...> - 2005-05-21 02:00:36
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19557/include/graphics Modified Files: tc3DModel.h Log Message: Mods to allow aircraft to load / unload with airbase stores, simplified flight model Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DModel.h 17 May 2005 00:20:39 -0000 1.15 --- tc3DModel.h 21 May 2005 02:00:27 -0000 1.16 *************** *** 72,76 **** osg::Vec3 axis; float omega; ///< radians per second ! int *switchVariable; ///< rotate if switchVariable is NULL or *switchVariable is non-zero float *controlVariable; osg::MatrixTransform* transform; ///< transform to rotate --- 72,76 ---- osg::Vec3 axis; float omega; ///< radians per second ! short int *switchVariable; ///< rotate if switchVariable is NULL or *switchVariable is non-zero float *controlVariable; osg::MatrixTransform* transform; ///< transform to rotate |
|
From: Dewitt C. <ddc...@us...> - 2005-05-21 02:00:35
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19557/include/database Modified Files: CsvTranslator.h tcAirDBObject.h tcLauncherDBObject.h Log Message: Mods to allow aircraft to load / unload with airbase stores, simplified flight model Index: tcLauncherDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcLauncherDBObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcLauncherDBObject.h 1 Feb 2005 02:28:08 -0000 1.11 --- tcLauncherDBObject.h 21 May 2005 02:00:27 -0000 1.12 *************** *** 45,52 **** bool isAutoPoint; ///< true to always point launcher toward target tcDBString mzChildClass; ///< class of platform to launch (simple model) ! UINT mnCapacity; ///< max number of launch objects held (simple model) tcDBString maChildClass[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for multiple options ! UINT maCapacity[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for mult configs ! UINT mnConfigurations; std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) --- 45,52 ---- bool isAutoPoint; ///< true to always point launcher toward target tcDBString mzChildClass; ///< class of platform to launch (simple model) ! unsigned short mnCapacity; ///< max number of launch objects held (simple model) tcDBString maChildClass[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for multiple options ! unsigned short maCapacity[MAX_LAUNCHER_CONFIGURATIONS]; ///< array for mult configs ! unsigned short mnConfigurations; std::string fireControlSensorClass; ///< class of sensor on platform for fire control ///< (track required to launch) Index: CsvTranslator.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/CsvTranslator.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CsvTranslator.h 8 Aug 2004 00:31:32 -0000 1.4 --- CsvTranslator.h 21 May 2005 02:00:26 -0000 1.5 *************** *** 61,65 **** --- 61,67 ---- CsvTranslator& operator>>(double& val); CsvTranslator& operator>>(int& val); + CsvTranslator& operator>>(short& val); CsvTranslator& operator>>(unsigned int& val); + CsvTranslator& operator>>(unsigned short& val); CsvTranslator& operator>>(long& val); CsvTranslator& operator>>(std::string& s); Index: tcAirDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcAirDBObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcAirDBObject.h 29 Nov 2004 03:54:48 -0000 1.9 --- tcAirDBObject.h 21 May 2005 02:00:27 -0000 1.10 *************** *** 61,66 **** float mfMsupm; ///< supersonic mach number float mfKdi; ///< constant for simplified induced drag model ! float mfMaxAoa_rad; ///< max angle of attack [rad] ! float mfMaxCl; ///< max lift coefficient float mfGmax; ///< max Gs --- 61,65 ---- float mfMsupm; ///< supersonic mach number float mfKdi; ///< constant for simplified induced drag model ! float stallSpeed_mps; ///< [m/s] stall speed at sea level float mfGmax; ///< max Gs |
|
From: Dewitt C. <ddc...@us...> - 2005-05-17 00:22:18
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32418/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp tc3DViewer.cpp tcSmoker.cpp Log Message: New feature to display 3D models for sensor tracks based on track position (only generic models for now) Index: tcSmoker.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcSmoker.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSmoker.cpp 31 Mar 2005 03:51:13 -0000 1.3 --- tcSmoker.cpp 17 May 2005 00:20:40 -0000 1.4 *************** *** 127,132 **** void tcSmoker::UpdateSmokePosition(float x, float y, float z) { - wxASSERT(gameObj); - // create rotation matrix (using euler angles for now) const osg::Vec3 xaxis(-1, 0, 0); --- 127,130 ---- *************** *** 139,146 **** osg::Matrixf rotation; ! rotation.makeRotate(gameObj->mcKin.mfHeading_rad, zaxis, gameObj->mcKin.mfPitch_rad, xaxis, gameObj->mcKin.mfRoll_rad, yaxis); ! size_t nSmoke = smokeTrails.size(); --- 137,150 ---- osg::Matrixf rotation; ! if (gameObj) ! { ! rotation.makeRotate(gameObj->mcKin.mfHeading_rad, zaxis, gameObj->mcKin.mfPitch_rad, xaxis, gameObj->mcKin.mfRoll_rad, yaxis); ! } ! else ! { ! rotation.makeRotate(0, zaxis, 0, xaxis, 0, yaxis); ! } size_t nSmoke = smokeTrails.size(); Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ObjectUpdater.cpp 29 Apr 2005 18:52:53 -0000 1.16 --- ObjectUpdater.cpp 17 May 2005 00:20:40 -0000 1.17 *************** *** 106,122 **** void ObjectUpdater::UpdateTrack(Node* node) { ! tcGameObject* gameObject = model->GetGameObj(); ! wxASSERT(gameObject); ! ! unsigned int ownAlliance = simState->mpUserInfo->GetOwnAlliance(); ! tcSensorMapTrack* track = sensorMap->GetSensorMapTrack(gameObject->mnID, ownAlliance); ! ! int n3DCheatMode = tcOptions::Get()->mn3DCheatMode; ! if ((n3DCheatMode == 0) || (track == 0) || (track->IsBearingOnly())) { ! model->SetGenericMode(tc3DModel::DISABLE_MODEL); return; } int genericMode = 0; --- 106,118 ---- void ObjectUpdater::UpdateTrack(Node* node) { ! tcSensorMapTrack* track = model->GetSensorTrack(); ! if (track == 0) { ! fprintf(stderr, "ObjectUpdater::UpdateTrack - null sensorTrack\n"); ! wxASSERT(false); return; } + int genericMode = 0; *************** *** 132,157 **** ! ! float yaw, pitch, roll; ! float x, y, z; ! yaw = track->mfHeading_rad; ! pitch = 0; ! roll = 0; ! ! // if object is close to camera, use predicted track for position ! if (distanceFromCamera < 10e3) ! { ! tcTrack predicted; ! track->GetPrediction(predicted, simState->GetTime()); ! x = viewer->LonToX(predicted.mfLon_rad); ! y = viewer->LatToY(predicted.mfLat_rad); ! z = predicted.GetOrGuessAltitude(); ! } ! else ! { ! x = viewer->LonToX(track->mfLon_rad); ! y = viewer->LatToY(track->mfLat_rad); ! z = track->GetOrGuessAltitude(); ! } --- 128,141 ---- ! tc3DModel::LocationParams p; ! model->GetLocationParams(p); ! ! float& x = p.x; ! float& y = p.y; ! float& z = p.z; ! float& yaw = p.yaw; ! float& pitch = p.pitch; ! float& roll = p.roll; ! bool& isVisible = p.isVisible; *************** *** 184,222 **** void ObjectUpdater::UpdateTrue(Node* node) { ! float yaw, pitch, roll; ! float x, y, z; ! bool isVisible = true; ! ! tcGameObject* gameObject = model->GetGameObj(); model->SetGenericMode(tc3DModel::USE_TRUE_MODEL); - if (!gameObject->parent) - { - tcKinematics* kin = &gameObject->mcKin; - yaw = kin->mfHeading_rad; - pitch = kin->mfPitch_rad; - roll = kin->mfRoll_rad; - x = viewer->LonToX(kin->mfLon_rad); - y = viewer->LatToY(kin->mfLat_rad); - z = kin->mfAlt_m; - - - } - else - { - tsRelativePosition *pos = &gameObject->rel_pos; - yaw = pos->yaw; - pitch = pos->pitch; - roll = pos->roll; - x = pos->dx; - y = pos->dy; - z = pos->dz; - isVisible = pos->isVisible; - if (!isVisible) - { - z = -50000.0f; - } - } // not correct for child objects --- 168,184 ---- void ObjectUpdater::UpdateTrue(Node* node) { ! tc3DModel::LocationParams p; ! model->GetLocationParams(p); ! ! float& x = p.x; ! float& y = p.y; ! float& z = p.z; ! float& yaw = p.yaw; ! float& pitch = p.pitch; ! float& roll = p.roll; ! bool& isVisible = p.isVisible; model->SetGenericMode(tc3DModel::USE_TRUE_MODEL); // not correct for child objects *************** *** 225,229 **** model->SetDistanceFromCamera(distanceFromCamera); ! if (model->IsSmokeEnabled()) { --- 187,192 ---- model->SetDistanceFromCamera(distanceFromCamera); ! if (!isVisible) return; ! if (model->IsSmokeEnabled()) { *************** *** 236,244 **** osg::Matrix::rotate(-osg::inRadians(yaw),0.0f,0.0f,1.0f)*osg::Matrix::translate(x,y,z) ; ! if (isVisible) ! { ! UpdaterCallbackVisitor cv(m); ! node->accept(cv); ! } } --- 199,207 ---- osg::Matrix::rotate(-osg::inRadians(yaw),0.0f,0.0f,1.0f)*osg::Matrix::translate(x,y,z) ; ! ! ! UpdaterCallbackVisitor cv(m); ! node->accept(cv); ! } *************** *** 253,256 **** --- 216,221 ---- { tcGameObject* gameObject = model->GetGameObj(); + tcSensorMapTrack* sensorTrack = model->GetSensorTrack(); + int displayMode = tcOptions::Get()->mn3DCheatMode; *************** *** 263,267 **** else { ! UpdateTrack(node); } --- 228,232 ---- else { ! wxASSERT(false); } *************** *** 271,274 **** --- 236,247 ---- NodeCallback::traverse(node,nv); } + else if (sensorTrack) + { + UpdateTrack(node); + UpdateAnimations(); + + // must call any nested node callbacks and continue subgraph traversal. + NodeCallback::traverse(node,nv); + } else // no game object available { Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tc3DModel.cpp 4 Mar 2005 00:46:16 -0000 1.24 --- tc3DModel.cpp 17 May 2005 00:20:40 -0000 1.25 *************** *** 35,38 **** --- 35,41 ---- #include "tcSound.h" #include "tcGenericDBObject.h" + #include "tcSensorMapTrack.h" + #include "tcSimState.h" + #include "tc3DViewer.h" #include "common/tinyxml.h" #include <osg/MatrixTransform> *************** *** 50,53 **** --- 53,58 ---- #endif + using Sensor::tcSensorMapTrack; + // started with CSP ModelProcessor class /** *************** *** 242,246 **** osg::ref_ptr<osg::Group> tc3DModel::world; ! osg::ref_ptr<osg::Node> tc3DModel::unknownAll; osg::ref_ptr<osg::Node> tc3DModel::unknownAir; --- 247,251 ---- osg::ref_ptr<osg::Group> tc3DModel::world; ! tc3DViewer* tc3DModel::viewer = 0; osg::ref_ptr<osg::Node> tc3DModel::unknownAll; osg::ref_ptr<osg::Node> tc3DModel::unknownAir; *************** *** 367,370 **** --- 372,437 ---- } + + void tc3DModel::GetLocationParams(LocationParams& p) + { + + if (gameObj) + { + if (!gameObj->parent) + { + tcKinematics* kin = &gameObj->mcKin; + p.yaw = kin->mfHeading_rad; + p.pitch = kin->mfPitch_rad; + p.roll = kin->mfRoll_rad; + p.x = viewer->LonToX(kin->mfLon_rad); + p.y = viewer->LatToY(kin->mfLat_rad); + p.z = kin->mfAlt_m; + p.isVisible = true; + } + else + { + tsRelativePosition *pos = &gameObj->rel_pos; + p.yaw = pos->yaw; + p.pitch = pos->pitch; + p.roll = pos->roll; + p.x = pos->dx; + p.y = pos->dy; + p.z = pos->dz; + p.isVisible = pos->isVisible; + if (!p.isVisible) + { + p.z = -50000.0f; + } + } + } + else if (sensorTrack) + { + // if object is close to camera, use predicted track for position + if (distanceFromCamera < 10e3) + { + tcTrack predicted; + sensorTrack->GetPrediction(predicted, tcSimState::Get()->GetTime()); + p.x = viewer->LonToX(predicted.mfLon_rad); + p.y = viewer->LatToY(predicted.mfLat_rad); + p.z = predicted.GetOrGuessAltitude(); + p.yaw = predicted.mfHeading_rad; + p.pitch = predicted.mfClimbAngle_rad; + p.roll = 0; + } + else + { + p.x = viewer->LonToX(sensorTrack->mfLon_rad); + p.y = viewer->LatToY(sensorTrack->mfLat_rad); + p.z = sensorTrack->GetOrGuessAltitude(); + p.yaw = sensorTrack->mfHeading_rad; + p.pitch = 0; + p.roll = 0; + } + + p.isVisible = true; + } + } + + osg::ref_ptr<osg::Node> tc3DModel::GetNode() { *************** *** 410,413 **** --- 477,485 ---- } + tcSensorMapTrack* tc3DModel::GetSensorTrack() const + { + return sensorTrack; + } + /** * @return true if smokeTrails object is active *************** *** 710,713 **** --- 782,786 ---- wxASSERT(modelTransform->getUpdateCallback() == NULL); gameObj = obj; + sensorTrack = 0; modelTransform->setUpdateCallback(new ObjectUpdater(this)); *************** *** 716,727 **** /** * Call outside of scene graph traversal */ void tc3DModel::UpdateEffects() { ! wxASSERT(gameObj); bool disableSmoke = ((smokeMode == tcParticleEffect::OFF) || ! (gameObj->parent) || (distanceFromCamera > 2000)); bool smokeDisabled = !IsSmokeEnabled(); --- 789,813 ---- /** + * Version to update using a sensor track + */ + void tc3DModel::SetupUpdate(tcSensorMapTrack* track) + { + wxASSERT(modelTransform->getUpdateCallback() == NULL); + gameObj = 0; + sensorTrack = track; + modelTransform->setUpdateCallback(new ObjectUpdater(this)); + + smokeTrails.SetGameObject(0); + } + + /** * Call outside of scene graph traversal */ void tc3DModel::UpdateEffects() { ! wxASSERT(gameObj || sensorTrack); bool disableSmoke = ((smokeMode == tcParticleEffect::OFF) || ! (gameObj && gameObj->parent) || (distanceFromCamera > 2000)); bool smokeDisabled = !IsSmokeEnabled(); *************** *** 750,753 **** --- 836,841 ---- */ tc3DModel::tc3DModel() + : gameObj(0), + sensorTrack(0) { } *************** *** 758,762 **** */ tc3DModel::tc3DModel(const tc3DModel* source) ! : distanceFromCamera(1e10) { static int addCount = 0; --- 846,852 ---- */ tc3DModel::tc3DModel(const tc3DModel* source) ! : distanceFromCamera(1e10), ! gameObj(source->gameObj), ! sensorTrack(source->sensorTrack) { static int addCount = 0; Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tc3DViewer.cpp 29 Apr 2005 18:52:53 -0000 1.15 --- tc3DViewer.cpp 17 May 2005 00:20:40 -0000 1.16 *************** *** 63,66 **** --- 63,68 ---- #include "tc3DModel.h" #include "tcParticleEffect.h" + #include "tcSensorTrackIterator.h" + *************** *** 1122,1126 **** tnPoolIndex nKey; unsigned int i = 0; ! while (i++ < nSize) { --- 1124,1130 ---- tnPoolIndex nKey; unsigned int i = 0; ! ! bool isServer = simState->IsMultiplayerServer(); ! while (i++ < nSize) { *************** *** 1128,1140 **** simState->maPlatformState.GetNextAssoc(poolpos,nKey,gameObj); wxASSERT(gameObj->model); // model should be created with gameObj ! if (gameObj->model->GetNumParents()==0) ! { ! worldObjects->addChild(gameObj->model->GetNode().get()); ! } ! UpdateChildModels(gameObj); } } /** * Calculate distance from camera to origin. If the --- 1132,1181 ---- simState->maPlatformState.GetNextAssoc(poolpos,nKey,gameObj); wxASSERT(gameObj->model); // model should be created with gameObj ! if (isServer || gameObj->IsOwnAlliance()) ! { ! if (gameObj->model->GetNumParents()==0) ! { ! worldObjects->addChild(gameObj->model->GetNode().get()); ! } ! UpdateChildModels(gameObj); ! } } } + + /** + * Load models for new sensor tracks + */ + void tc3DViewer::UpdateSensorModels(unsigned int alliance) + { + using Sensor::tcSensorTrackIterator; + tcSensorTrackIterator iter(alliance, 0xFFFF); + + for (iter.First();iter.NotDone();iter.Next()) + { + tcSensorMapTrack* track = iter.Get(); + + wxASSERT(track); + tc3DModel* model = track->GetModel(); + if (model) + { + if (model->GetNumParents() == 0) + { + worldObjects->addChild(model->GetNode().get()); + } + } + else + { + model = defaultSensorModel->Clone(); + track->SetModel(model); + model->SetupUpdate(track); + + worldObjects->addChild(model->GetNode().get()); + } + } + + } + /** * Calculate distance from camera to origin. If the *************** *** 1761,1764 **** --- 1802,1810 ---- UpdateModels(); + if (!simState->IsMultiplayerServer()) + { + UpdateSensorModels(tcUserInfo::Get()->GetOwnAlliance()); + } + UpdateCamera(); *************** *** 1849,1852 **** --- 1895,1899 ---- hookID = NULL_INDEX; ObjectUpdater::AttachViewer(this); + tc3DModel::AttachViewer(this); InitSceneView(pos, size); *************** *** 1898,1901 **** --- 1945,1952 ---- shakeAirCamera = tcOptions::Get()->OptionStringExists("ShakeAirCamera"); + defaultSensorModel = new tc3DModel(); + defaultSensorModel->LoadXml("unknown.xml"); + + // rootnode->addChild(tcSound::Get()->GetSoundRoot()); } *************** *** 1904,1906 **** --- 1955,1958 ---- { if (terrainManager) delete terrainManager; + if (defaultSensorModel) delete defaultSensorModel; } |
|
From: Dewitt C. <ddc...@us...> - 2005-05-17 00:22:08
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32418/include/sim Modified Files: tcSensorMap.h tcSensorTrackIterator.h Added Files: tcSensorMapTrack.h Log Message: New feature to display 3D models for sensor tracks based on track position (only generic models for now) Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSensorMap.h 5 May 2005 02:14:20 -0000 1.13 --- tcSensorMap.h 17 May 2005 00:20:39 -0000 1.14 *************** *** 33,36 **** --- 33,37 ---- #include "tcFile.h" #include <vector> + #include "tcSensorMapTrack.h" class tcSimState; *************** *** 50,191 **** { - /** - * stores all state information needed by sensor for surveillance tracks - */ - class tcSensorReport - { - public: - float mfLon_rad; - float mfLat_rad; - float mfAlt_m; - float mfSpeed_kts; - float mfHeading_rad; - double mfTimestamp; - double mfStartTime; ///< birth time of track from report - long mnTrackID; - long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown - long mnSensorPlatformID; ///< id of contributing sensor - UINT8 mnFlags; - std::vector<UINT32> maEmitter; - unsigned mbClassified : 1; - unsigned isIdentified : 1; - - void Clear() - { - mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; - mfSpeed_kts=0;mfHeading_rad=0; - mfTimestamp=0;mfStartTime=0; - mfStartTime = 0; - mnTrackID = -1; - mnSensorPlatformID = -1; - mnFlags=0; - mbClassified = 0; - isIdentified = 0; - } - bool IsIdentified() const {return isIdentified != 0;} - bool IsNew() {return (mfTimestamp == 0);} - }; - - struct tsEmitterInfo - { - tnPoolIndex mnEmitterID; ///< database ID of emitter - double mfTimestamp; - int mnMode; - }; - - /** - * State info for track stored in alliance sensor map. - * The targetedRating is used by the AI to avoid inefficient ganging up on track. - * engageRating controls how much ordance - */ - class tcSensorMapTrack : public tcTrack - { - enum {MAX_SENSOR_REPORTS = 2, MAX_EMITTERS = 4}; - - public: - tcSensorReport maSensorReport[MAX_SENSOR_REPORTS]; ///< most recent data from contributing sensors - int mnContributors; - tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; - int mnEmitters; - long mnDatabaseID; ///< database ID of track, -1 for unknown - float assessedDamage; - std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track - std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging - std::vector<long> ambiguityList; ///< vector of platform ids consistent with detected emitters - static unsigned int ambiguityListUpdates; - - /// called to indicate weapon launched at target - bool AddEngagement(long id); - - /// called to indicate platform intercepting target - bool AddIntercept(long id); - - bool AddReport(const tcSensorReport& report); - void RemoveReport(int n); - - ///< static method to set pointer to tcSimState object - static void AttachDatabase(tcDatabase* db) {database = db;} - static void AttachSimState(tcSimState* ss) {simState = ss;} - - virtual void Clear(); - - int GetEmitterCount() {return mnEmitters;} - const tsEmitterInfo* GetEmitter(int anIdx) - { - if ((anIdx < 0)||(anIdx >= mnEmitters)) {return NULL;} - return &maEmitterInfo[anIdx]; - } - - /// gets number of weapons engaging this track - unsigned GetEngagedCount() const; - - /// gets number of platforms intercepting this track - unsigned GetInterceptCount() const; - - unsigned GetContributorCount() const; - const char* GetContributorName(unsigned idx) const; - - const tcTrack* GetTrack() {return this;} - bool IsNew() {return mfTimestamp == 0;} - bool IsDestroyed() const; - bool IsStale() const; - void MarkDestroyed(); - void MarkStale(); - void ClearStale(); - - bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); - void UpdateAmbiguityList(); - void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, - tnPoolIndex databaseID); - bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); - - /// removes engagement ids for weapons no longer engaging this track - void UpdateEngagements(); - - /// removes intercept ids for platforms no longer intercepting this track - void UpdateIntercepts(); - - bool UpdatePassiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); - void UpdateTrack(); - - - tcUpdateStream& operator<<(tcUpdateStream& stream); - tcUpdateStream& operator>>(tcUpdateStream& stream); - - tcSensorMapTrack* operator= (tcSensorMapTrack *pa) {return pa;} - tcSensorMapTrack& operator= (const tcSensorMapTrack&); - tcSensorMapTrack(); - ~tcSensorMapTrack(); - - static void SetAutoKillAssess(bool state); - private: - static tcSimState* simState; - static tcDatabase* database; - static bool autoKillAssess; ///< set to true to automatically mark destroyed tracks - enum {TRACK_STALE = 1, TRACK_DESTROYED = 2}; - unsigned char sensorFlags; ///< 1 - stale, 2 - destroyed - - void KillAssess(); - }; --- 51,54 ---- Index: tcSensorTrackIterator.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorTrackIterator.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSensorTrackIterator.h 11 Dec 2004 01:09:05 -0000 1.1 --- tcSensorTrackIterator.h 17 May 2005 00:20:39 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- tcSensorTrackIterator(unsigned int alliance_, unsigned int classificationMask, const tcGeoRect& filterRegion); + tcSensorTrackIterator(unsigned int alliance_, unsigned int classificationMask = 0xFFFF); tcSensorTrackIterator(); virtual ~tcSensorTrackIterator(); --- NEW FILE: tcSensorMapTrack.h --- /** ** @file tcSensorMapTrack.h */ /* Copyright (C) 2003-2005 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 */ #ifndef _SENSORMAPTRACK_H_ #define _SENSORMAPTRACK_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "simmath.h" #include "tcFile.h" #include <vector> class tcSimState; class tcUpdateStream; namespace Database { class tcDatabase; } using Database::tcDatabase; /** * Sensor track management code. This is older code * that needs refactoring. */ namespace Sensor { /** * stores all state information needed by sensor for surveillance tracks */ class tcSensorReport { public: float mfLon_rad; float mfLat_rad; float mfAlt_m; float mfSpeed_kts; float mfHeading_rad; double mfTimestamp; double mfStartTime; ///< birth time of track from report long mnTrackID; long trackDatabaseID; ///< database id of track (usually from visual ident), -1 is unknown long mnSensorPlatformID; ///< id of contributing sensor UINT8 mnFlags; std::vector<UINT32> maEmitter; unsigned mbClassified : 1; unsigned isIdentified : 1; void Clear() { mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; mfSpeed_kts=0;mfHeading_rad=0; mfTimestamp=0;mfStartTime=0; mfStartTime = 0; mnTrackID = -1; mnSensorPlatformID = -1; mnFlags=0; mbClassified = 0; isIdentified = 0; } bool IsIdentified() const {return isIdentified != 0;} bool IsNew() {return (mfTimestamp == 0);} }; struct tsEmitterInfo { tnPoolIndex mnEmitterID; ///< database ID of emitter double mfTimestamp; int mnMode; }; /** * State info for track stored in alliance sensor map. * The targetedRating is used by the AI to avoid inefficient ganging up on track. * engageRating controls how much ordance */ class tcSensorMapTrack : public tcTrack { enum {MAX_SENSOR_REPORTS = 2, MAX_EMITTERS = 4}; public: tcSensorReport maSensorReport[MAX_SENSOR_REPORTS]; ///< most recent data from contributing sensors int mnContributors; tsEmitterInfo maEmitterInfo[MAX_EMITTERS]; int mnEmitters; long mnDatabaseID; ///< database ID of track, -1 for unknown float assessedDamage; std::vector<long> intercepts; ///< vector of platform ids that are intercepting this track std::vector<long> engaged; ///< vector of weapon ids that are tracking / engaging std::vector<long> ambiguityList; ///< vector of platform ids consistent with detected emitters static unsigned int ambiguityListUpdates; /// called to indicate weapon launched at target bool AddEngagement(long id); /// called to indicate platform intercepting target bool AddIntercept(long id); bool AddReport(const tcSensorReport& report); void RemoveReport(int n); ///< static method to set pointer to tcSimState object static void AttachDatabase(tcDatabase* db) {database = db;} static void AttachSimState(tcSimState* ss) {simState = ss;} virtual void Clear(); int GetEmitterCount() {return mnEmitters;} const tsEmitterInfo* GetEmitter(int anIdx) { if ((anIdx < 0)||(anIdx >= mnEmitters)) {return NULL;} return &maEmitterInfo[anIdx]; } /// gets number of weapons engaging this track unsigned GetEngagedCount() const; /// gets number of platforms intercepting this track unsigned GetInterceptCount() const; unsigned GetContributorCount() const; const char* GetContributorName(unsigned idx) const; tc3DModel* GetModel() const; void SetModel(tc3DModel* model_); const tcTrack* GetTrack() {return this;} bool IsNew() {return mfTimestamp == 0;} bool IsDestroyed() const; bool IsStale() const; void MarkDestroyed(); void MarkStale(); void ClearStale(); bool UpdateActiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); void UpdateAmbiguityList(); void UpdateClassification(UINT16 mnClassification, teAffiliation meAffiliation, tnPoolIndex databaseID); bool UpdateEmitter(tsEmitterInfo*& rpEmitterInfo, tnPoolIndex anEmitterID); /// removes engagement ids for weapons no longer engaging this track void UpdateEngagements(); /// removes intercept ids for platforms no longer intercepting this track void UpdateIntercepts(); bool UpdatePassiveReport(tcSensorReport*& rpReport, tnPoolIndex anSensorID); void UpdateTrack(); tcUpdateStream& operator<<(tcUpdateStream& stream); tcUpdateStream& operator>>(tcUpdateStream& stream); tcSensorMapTrack* operator= (tcSensorMapTrack *pa) {return pa;} tcSensorMapTrack& operator= (const tcSensorMapTrack&); tcSensorMapTrack(const tcSensorMapTrack& src); tcSensorMapTrack(); ~tcSensorMapTrack(); static void SetAutoKillAssess(bool state); private: static tcSimState* simState; static tcDatabase* database; static bool autoKillAssess; ///< set to true to automatically mark destroyed tracks enum {TRACK_STALE = 1, TRACK_DESTROYED = 2}; unsigned char sensorFlags; ///< 1 - stale, 2 - destroyed tc3DModel* model; void KillAssess(); }; } #endif |