gcblue-commits Mailing List for Global Conflict Blue (Page 49)
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) |
|
From: Dewitt C. <ddc...@us...> - 2004-07-26 01:44:48
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5274/include/graphics Modified Files: tc3DTerrain.h tcTerrainTextureFactory.h Log Message: Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tc3DTerrain.h 19 Jul 2004 00:52:26 -0000 1.11 --- tc3DTerrain.h 26 Jul 2004 01:44:40 -0000 1.12 *************** *** 1,6 **** /* ! ** tc3DTerrain.h ! ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- /* ! ** @file tc3DTerrain.h ! */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 60,76 **** ~tc3DTerrain(); private: ! tcMapData *mapData; ///< pointer to tcMapData object enum { GRID_DIM = 256, ! TEX_CELL_DIM = 8 ///< number of texture cells on side of grid }; float gridSpacing; ///< distance between neighbors in terrain grid [world coord units=m] float gridOffset; ///< offset for x and y for (0,0) grid element float elevationArray[GRID_DIM*GRID_DIM]; ! Uint8 mapTexture[GRID_DIM*GRID_DIM*3]; ///< texture to drape over terrain, RGB bytes osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph ! tcTerrainTextureFactory *texFactory; // these members are the same as in tc3DViewer (copied for simplicity for now) --- 60,78 ---- ~tc3DTerrain(); private: ! tcMapData* mapData; ///< pointer to tcMapData object enum { GRID_DIM = 256, ! TEX_CELL_DIM = 1, ///< number of texture cells on side of grid ! BASE_TEX_DIM = 515 }; float gridSpacing; ///< distance between neighbors in terrain grid [world coord units=m] float gridOffset; ///< offset for x and y for (0,0) grid element float elevationArray[GRID_DIM*GRID_DIM]; ! Demeter::Texture* baseTexture; ///< texture to drape over terrain, RGB bytes ! osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph ! tcTerrainTextureFactory* texFactory; // these members are the same as in tc3DViewer (copied for simplicity for now) Index: tcTerrainTextureFactory.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainTextureFactory.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcTerrainTextureFactory.h 19 Jul 2004 00:52:26 -0000 1.4 --- tcTerrainTextureFactory.h 26 Jul 2004 01:44:40 -0000 1.5 *************** *** 37,46 **** * Class to do procedural texture generation for Demeter terrain * Modify this to use iterator for std::map */ ! class tcTerrainTextureFactory : public Demeter::TextureFactory { public: void BuildTextures(); ///< rebuilds procedural textures, called when origin changes void Update(); ///< called every frame to distribute texture loading over multiple frames tcTerrainTextureFactory(Demeter::Terrain* pTerrain, tc3DTerrain *tm, int griddimension); --- 37,57 ---- * Class to do procedural texture generation for Demeter terrain * Modify this to use iterator for std::map + * 25JUL DDC - This was reworked to use a single procedural texture. + * There was no way to display terrain without seams with the old + * code derived from Demeter::TextureFactory */ ! class tcTerrainTextureFactory //: public Demeter::TextureFactory { public: void BuildTextures(); ///< rebuilds procedural textures, called when origin changes + static Demeter::Texture* CreateEmptyTexture(int texSize); + + void UpdateCommonTexture(); + void UpdateBaseTexture(Demeter::Texture* texture); + void Update(); ///< called every frame to distribute texture loading over multiple frames + void UpdateTexture(Demeter::Texture* pTexture, float originX, float originY, + float width, float height); + tcTerrainTextureFactory(Demeter::Terrain* pTerrain, tc3DTerrain *tm, int griddimension); *************** *** 68,72 **** bool doGradualUpdate; ///< true to calculate procedural textures over multiple frames - Demeter::Terrain *terrain; tc3DTerrain *terrainManager; --- 79,82 ---- *************** *** 78,81 **** --- 88,93 ---- osg::ref_ptr<osg::Image> grassTexture; osg::ref_ptr<osg::Image> mountainTexture; + osg::ref_ptr<osg::Image> groundDetailTexture; + Demeter::Texture *defaultTexture; Demeter::Texture *defaultTextureLand; // workaround to show land texture for default over land *************** *** 95,100 **** void InitTextureCache(); void LoadTerrainTextures(); ! void UpdateTexture(Demeter::Texture* pTexture, float originX, float originY, ! float width, float height); }; --- 107,111 ---- void InitTextureCache(); void LoadTerrainTextures(); ! }; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-26 01:44:48
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5274 Modified Files: ReleaseInstallScript.nsi Log Message: Index: ReleaseInstallScript.nsi =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/ReleaseInstallScript.nsi,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReleaseInstallScript.nsi 25 Jun 2004 01:40:27 -0000 1.3 --- ReleaseInstallScript.nsi 26 Jul 2004 01:44:40 -0000 1.4 *************** *** 12,16 **** ; The file to write ! OutFile "gcb_06x2_.exe" ; The default installation directory --- 12,16 ---- ; The file to write ! OutFile "gcb_06x23JUL_.exe" ; The default installation directory |
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:47:10
|
Update of /cvsroot/gcblue/gcb_data/scenario In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3609/scenarios Added Files: AirfieldTest.py Log Message: --- NEW FILE: AirfieldTest.py --- # SM is ScenarioManager object def CreateScenario(SM): SM.CreateAlliance(1, 'Friendly') SM.CreateAlliance(2, 'OPFOR') SM.SetUserAlliance(1) SM.SetScenarioDescription('Test scenario, airstrip vs. ragtag forces') SM.SetScenarioLoaded(1) SM.SetScenarioName('Airfield Test') SM.SetDateTime(2004, 6, 15, 16, 0, 0) unit = SM.GetDefaultUnit() order = SM.GetDefaultOrder() order.SetOrderName('Patrol') unit.AddOrder(order) ### Alliance 2 (enemy) units unit.className = 'Airstrip' unit.unitName = 'FT001' unit.SetPosition(-5.0, 50.5, 0) unit.heading = 90 unit.speed = 0.0 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 72' unit.SetPosition(-5.5, 49.6, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 73' unit.SetPosition(-5.5, 49.7, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 74' unit.SetPosition(-5.7, 49.4, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Mig25' unit.unitName = 'Bear 75' unit.SetPosition(-5.7, 49.5, 1500) # lon, lat, alt unit.heading = 90 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 2) unit.className = 'Cruiser' unit.unitName = 'Bigfish 1' unit.SetPosition(-5.6, 49.8, 0) unit.heading = 95 unit.speed = 1.0 SM.AddUnitToAlliance(unit, 2) unit.className = 'Destroyer' unit.unitName = 'Bigfish 2' unit.SetPosition(-5.6, 49.65, 0) unit.heading = 95 unit.speed = 1.0 SM.AddUnitToAlliance(unit, 2) ### Alliance 1 units (friendly) unit.ClearOrders() unit.className = 'Mig25' unit.unitName = 'Laser 1' unit.SetPosition(-4.4, 49.8, 1500) unit.heading = 270 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 1) unit.className = 'Harrier GR3a' unit.unitName = 'Striker 1' unit.SetPosition(-4.25, 49.7, 1200) unit.heading = 340 unit.speed = 0.5 SM.AddUnitToAlliance(unit, 1) unit.className = 'Patrol Boat' unit.unitName = 'Picket 1' unit.SetPosition(-4.25, 49.65, 0) unit.heading = 270 unit.speed = 0.7 SM.AddUnitToAlliance(unit, 1) unit.className = 'Airstrip' unit.unitName = 'FT000' unit.SetPosition(-4.3, 50.5, 0) unit.heading = 270 unit.speed = 0.0 SM.AddUnitToAlliance(unit, 1) nAir = 7 for n in range(0, nAir): unitName = 'Hammer %d' % (n + 1) # AddUnitToFlightDeck(<carrier name>,<unit class>,<name>, <location>) # <location>: 1 = HANGAR, 2 = DECK, 3 = CATAPULT SM.AddUnitToFlightDeck('FT000','Harrier GR3a-STK',unitName, 3) SM.AddUnitToFlightDeck('FT000','AEW aircraft','Goose 1', 3) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 2', 1) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 3', 1) SM.AddUnitToFlightDeck('FT000','Mig25','Laser 4', 1) AddGoals(SM) def AddGoals(SM): # alliance 1 goals goal_1a = SM.DestroyGoal('Bigfish 1') goal_1b = SM.DestroyGoal('Bigfish 2') goal_1 = SM.CompoundGoal(0) # 0 - AND, 1 - OR goal_1.AddGoal(goal_1a) goal_1.AddGoal(goal_1b) SM.SetAllianceGoal(1, goal_1) # alliance 2 goals goal_2 = SM.DestroyGoal('FT000') SM.SetAllianceGoal(2, goal_2) # BM is BriefingManager (same as ScenarioManager for now) object def CreateBriefing(BM): BM.SetEventTime(0) BM.Pause() BM.PauseAudio() BM.SetBriefingMode(1) # 0 - normal tactical display, 1 - briefing disp BM.Set3DMode(0) # 0 - off, 1 - small, 2 - med, 3 - full screen BM.ConsoleText('Briefing follows...') BM.SetEventTime(4) BM.ConsoleText('') # a blank line BM.ConsoleText('Destroy the forces to the West') BM.ConsoleText('Protect your forces') BM.ConsoleText('') BM.SetEventTime(7) BM.ChangeMapView(-5.5, 50.1, 4.0) # (lon, lat, lon span) in degrees BM.SetEventTime(8) BM.ConsoleText('') BM.ConsoleText('Enemy consists of ragtag rebel forces') BM.ConsoleText('') BM.ConsoleText('Destroy at will.') BM.ConsoleText('The two enemy surface ships are your high priority targets') BM.SetEventTime(9) # text, lon, lat, duration in seconds, 0 - no effect, 1 - blend effect BM.MapText('Approx location of OPFOR', -5.5, 49.9, 12, 1) BM.SetEventTime(12) BM.Set3DMode(2) # large 3D, console still visible # unit, duration, az1, az2, el1, el2, range1, range2 BM.ConsoleText('You have command of airbase FT000 ') BM.ConsoleText(' to assist you in your mission') BM.ConsoleText('') BM.ConsoleText('Hit the "F" key after hooking your carrier to'); BM.ConsoleText(' raise the flight deck control panel'); BM.TrackCamera('FT000', 10.0, 100.0, -100.0, 1500.0, -50.0, 150.0, 100.0) BM.Text3D('FT000', 10.0, 0.5, 0.2, 24.0, 1) BM.SetEventTime(22) BM.Set3DMode(1) BM.ConsoleText('') BM.ConsoleText('On to the mission, Good hunting.') BM.SetEventTime(28) BM.Set3DMode(1) BM.SetBriefingMode(0) # leave briefing mode BM.PlayAudio('tension1',0) # name, seek time from beginning of song BM.Resume() # resumes game |
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:46:34
|
Update of /cvsroot/gcblue/gcb_data/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3564/database Modified Files: air.csv flightport.csv generic.csv launcher.csv missile.csv radar.csv Log Message: Index: launcher.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/launcher.csv,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** launcher.csv 23 Mar 2004 22:26:22 -0000 1.4 --- launcher.csv 23 Jul 2004 00:46:24 -0000 1.5 *************** *** 8,9 **** --- 8,10 ---- Harpoon SSM-I,0,0,NONE,,No description is available.,8,RGM-84,,,,,,,,,,,,,,,,, Sea Wolf (VLS) SAM,0,0,NONE,,No description is available.,16,Seawolf-SAM,Bae-911 fire control,16,Seawolf-SAM,,,,,,,,,,,,,, + AGM Launcher,0,0,NONE,,Generic launcher for AGM-I,10,AGM-I,,10,AGM-I,,,,,,,,,,,,,, Index: flightport.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/flightport.csv,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** flightport.csv 5 Jan 2004 02:50:33 -0000 1.1 --- flightport.csv 23 Jul 2004 00:46:24 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- Database class,Model class id,Functional class id,ImageFileName,3DModelFileName,Description,Helo only?,Hangar capacity,S1-Launch,S1-x[m],S1-z,S1-y,S1-orientation[deg],S1-length[m],S2-Launch,S2-x[m],S2-z,S2-y,S2-orientation[deg],S2-length[m],S3-Launch,S3-x[m],S3-z,S3-y,S3-orientation[deg],S3-length[m],S4-Launch,S4-x[m],S4-z,S4-y,S4-orientation[deg],S4-length[m],S5-Launch,S5-x[m],S5-z,S5-y,S5-orientation[deg],S5-length[m],S6-Launch,S6-x[m],S6-z,S6-y,S6-orientation[deg],S6-length[m],S7-Launch,S7-x[m],S7-z,S7-y,S7-orientation[deg],S7-length[m],S8-Launch,S8-x[m],S8-z,S8-y,S8-orientation[deg],S8-length[m],S9-Launch,S9-x[m],S9-z,S9-y,S9-orientation[deg],S9-length[m],S10-Launch,S10-x[m],S10-z,S10-y,S10-orientation[deg],S10-length[m],S11-Launch,S11-x[m],S11-z,S11-y,S11-orientation[deg],S11-length[m],S12-Launch,S12-x[m],S12-z,S12-y,S12-orientation[deg],S12-length[m],S13-Launch,S13-x[m],S13-z,S13-y,S13-orientation[deg],S13-length[m],S14-Launch,S14-x[m],S14-z,S14-y,S14-orientation[deg],S14-length[m],S15-Launch,S15-x[m],S15-z,S15-y,S15-orientation[deg],S15-length[m],S16-Launch,S16-x[m],S16-z,S16-y,S16-orientation[deg],S16-length[m] HermesFlightDeck,0,0,NONE,NONE,Hermes test flight deck,0,16,1,-12.5,16,18.799999,2.5,0,1,-2.5,16,18.799999,-2,0,0,5,16,36.25,-30,0,0,1.25,16,45,-30,0,0,7.5,16,60,25,0,0,7.5,16,72.5,25,0,0,7.5,16,85,25,0,0,7.5,16,97.5,25,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, + Airstrip-1,0,0,NONE,NONE,Airstrip test flight info,0,20,1,-70,11,500,0,0,1,-98,11,500,0,0,0,5,11,390,10,0,0,5,11,440,0,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Index: generic.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/generic.csv,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** generic.csv 22 Apr 2004 23:40:01 -0000 1.6 --- generic.csv 23 Jul 2004 00:46:24 -0000 1.7 *************** *** 11,12 **** --- 11,13 ---- Type 23 FFG,1,18,NONE,t22b1,No description is available.,30,28,1,2,10000,0,0,0,0,200,0,5200000,500000,7800,,Harpoon SSM-I,180,Sea Wolf (VLS) SAM,90,Sea Wolf (VLS) SAM,270,,,,,,,,,,,Bae-996 AS/SS,0,Bae-911 fire control,180,Thales-UAT,0,,,,,,,,,,,,,,,,,,,,,, E2-C,4,33,NONE,e2c,No description is available.,15,300,10,8,1000,0,10000,0,0,2,0,1,0,0,,,,,,,,,,,,,,,,,,AEW radar,0,ESM-A,0,,,,,,,,,,,,,helice_der,propeller,0,helice_izq,propeller,0,,,,,, + Airstrip,13,256,NONE,stanley,Simple airstrip,50,0,0,0,0,0,0,0,0,500,0,0,0,0,Airstrip-1,SAM Launcher,0,,,,,,,,,,,,,,,Air search radar,0,Generic radar,0,,,,,,,,,,,,,,,,,,,,,,,, Index: radar.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/radar.csv,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** radar.csv 23 Mar 2004 22:26:22 -0000 1.3 --- radar.csv 23 Jul 2004 00:46:24 -0000 1.4 *************** *** 1,15 **** ! Database class,Model class id,Functional class id,ImageFileName,3DModelFileName,Description,MaxRange_km,RefRange_km,FieldOfView_deg,ScanPeriod_s,MinRange_km,ERP_dBW,MinRangeRate_mps,MaxFireControlTracks,IsSemiactive,IsCommandReceiver,DetectsSurface,DetectsAir ! SSM Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0 ! SAM Seeker,0,0,NONE,,No description is available.,70,70,360,3,0.1,70,0,0,0,0,0,1 ! AAM Seeker,0,0,NONE,,No description is available.,80,80,90,3,0.1,70,0,0,0,0,0,1 ! ASM Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0 ! Fighter radar,0,0,NONE,,No description is available.,130,100,90,4,0.1,80,0,2,0,0,1,1 ! Generic radar,0,0,NONE,,No description is available.,100,50,360,8,0.1,80,0,2,0,0,1,1 ! AEW radar,0,0,NONE,,No description is available.,200,150,360,12,0.1,100,0,0,0,0,1,1 ! Air search radar,0,0,NONE,,No description is available.,200,100,360,9,0.1,100,0,0,0,0,0,1 ! SA-SAM Seeker,0,0,NONE,,No description is available.,70,70,90,3,0.1,70,0,0,1,0,0,1 ! SAM fire control radar,0,0,NONE,,No description is available.,120,80,360,8,0.1,80,0,2,0,0,1,1 ! Bae-996 AS/SS,0,0,NONE,,No description is available.,100,85,360,8,0.1,80,0,0,0,0,1,1 ! Bae-911 fire control,0,0,NONE,,Director for Sea Wolf VLS SAM,70,70,360,3,0.1,70,0,2,0,0,0,1 ! Seawolf-SAM Seeker,0,0,NONE,,No description is available.,70,70,90,3,0.1,70,0,0,1,0,0,1 ! RGM-84 Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0 --- 1,15 ---- ! Database class,Model class id,Functional class id,ImageFileName,3DModelFileName,Description,MaxRange_km,RefRange_km,FieldOfView_deg,ScanPeriod_s,MinRange_km,ERP_dBW,MinRangeRate_mps,MaxFireControlTracks,IsSemiactive,IsCommandReceiver,DetectsSurface,DetectsAir,DetectsGround ! SSM Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0,0 ! SAM Seeker,0,0,NONE,,No description is available.,70,70,360,3,0.1,70,0,0,0,0,0,1,0 ! AAM Seeker,0,0,NONE,,No description is available.,80,80,90,3,0.1,70,0,0,0,0,0,1,0 ! ASM Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0,0 ! Fighter radar,0,0,NONE,,No description is available.,130,100,90,4,0.1,80,0,2,0,0,1,1,1 ! Generic radar,0,0,NONE,,No description is available.,100,50,360,8,0.1,80,0,2,0,0,1,1,1 ! AEW radar,0,0,NONE,,No description is available.,200,150,360,12,0.1,100,0,0,0,0,1,1,0 ! Air search radar,0,0,NONE,,No description is available.,200,100,360,9,0.1,100,0,0,0,0,0,1,0 ! SA-SAM Seeker,0,0,NONE,,No description is available.,70,70,90,3,0.1,70,0,0,1,0,0,1,0 ! SAM fire control radar,0,0,NONE,,No description is available.,120,80,360,8,0.1,80,0,2,0,0,1,1,0 ! Bae-996 AS/SS,0,0,NONE,,No description is available.,100,85,360,8,0.1,80,0,0,0,0,1,1,0 ! Bae-911 fire control,0,0,NONE,,Director for Sea Wolf VLS SAM,70,70,360,3,0.1,70,0,2,0,0,0,1,0 ! Seawolf-SAM Seeker,0,0,NONE,,No description is available.,70,70,90,3,0.1,70,0,0,1,0,0,1,0 ! RGM-84 Seeker,0,0,NONE,,No description is available.,50,50,60,4,0.1,70,0,0,0,0,1,0,0 Index: missile.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/missile.csv,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** missile.csv 23 Mar 2004 22:26:22 -0000 1.4 --- missile.csv 23 Jul 2004 00:46:24 -0000 1.5 *************** *** 8,9 **** --- 8,10 ---- Seawolf-SAM,5,64,NONE,roland_sam,No description is available.,80,0.003,20,15,0.15,0.2,0.15,0.9,1.1,0.1,100000,10,80000,50,3,0,10,100,400,Seawolf-SAM Seeker,none,0,10000,2,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10 RGM-84,5,64,NONE,mm38,No description is available.,80,0.01,20,15,0.1,0.18,0.13,0.9,1.1,0.1,45000,300,10000,20,50,0,0,200,150,RGM-84 Seeker,none,20,300,0,1,5,100,2,2,,,,,,,,,,,,,,,,,,,,,,,,,1 + AGM-I,5,64,NONE,am39,Test air to ground missile for land targets,100,0.01,20,15,0.2,0.4,0.3,0.9,1.1,0.1,50000,20,20000,120,50,0,10,180,200,none,none,20,15000,0,1,0.75,250,1,1,0,750,3,1,,,,,,,,,,,,,,,,,,,,,4 Index: air.csv =================================================================== RCS file: /cvsroot/gcblue/gcb_data/database/air.csv,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** air.csv 5 Jun 2004 19:31:42 -0000 1.5 --- air.csv 23 Jul 2004 00:46:24 -0000 1.6 *************** *** 2,3 **** --- 2,4 ---- Mig25,12,33,NONE,m50_co,Mig25 aero model test,10,2000,20,20,13500,6,20000,0,0,2,0,15000,150000,0,,AAM Launcher,0,,,,,,,,,,,,,,,Fighter radar,0,,,,,,,,,,,,,,,,,,,,,,,,,,,0.00004,20,220000,1,90,1,2,1.5,0.9,1.1,6,0.1,0.2,5 Harrier GR3a,12,33,NONE,gr3uk,"Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.ÍÍ",0,639,20,20,1000,1,15600,0,0,2,0,15000,60000,0,,AAM-SR Launcher,0,ASM Launcher,0,,,,,,,,,,,,,Fighter radar,0,,,,,,,,,,,,,,,,,,,,,,,,,,,0.00001,8,85000,1,100,0.7,5,20,0.9,1.1,2,0.1,0.5,5 + Harrier GR3a-STK,12,33,NONE,gr3uk,"Single-engine; ""jump-jet"" fighter-bomber designed to fly from combat areas and aircraft carriers and to support ground forces. It was made by Hawker Siddeley Aviation and first flew on Aug. 31; 1966; after a long period of development.Powered by a vectored-thrust turbofan engine; the plane diverted its engine thrust downward for vertical takeoff using rotatable engine exhaust ports. It could carry a combination of armaments; including air-to-air missiles; air-to-surface antiship missiles; rockets; bombs.ÍÍ",0,639,20,20,1000,1,15600,0,0,2,0,15000,60000,0,,AAM-SR Launcher,0,AGM Launcher,0,,,,,,,,,,,,,Fighter radar,0,,,,,,,,,,,,,,,,,,,,,,,,,,,0.00001,8,85000,1,100,0.7,5,20,0.9,1.1,2,0.1,0.5,5 |
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:45:56
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3451/scripts Modified Files: AI.py UnitCommands.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** AI.py 18 Jul 2004 03:18:00 -0000 1.10 --- AI.py 23 Jul 2004 00:45:47 -0000 1.11 *************** *** 322,327 **** lat = target_info.Lat lon = target_info.Lon UI.HandoffTargetToLauncher(launcher) # to store intended target ! UI.SendDatumToLauncher(lon,lat,launcher) UI.Launch(launcher, launch_qty) UI.SetVar(0,1) --- 322,328 ---- lat = target_info.Lat lon = target_info.Lon + alt = target_info.Alt UI.HandoffTargetToLauncher(launcher) # to store intended target ! UI.SendDatumToLauncher(lon,lat,alt,launcher) UI.Launch(launcher, launch_qty) UI.SetVar(0,1) Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UnitCommands.py 15 Feb 2004 19:47:22 -0000 1.6 --- UnitCommands.py 23 Jul 2004 00:45:47 -0000 1.7 *************** *** 27,31 **** def LaunchDatum(UI, lon, lat, launcher_num): ! UI.SendDatumToLauncher(lon,lat,launcher_num) UI.Launch(launcher_num, 1) --- 27,34 ---- def LaunchDatum(UI, lon, lat, launcher_num): ! datum_alt = UI.GetMapTerrainElevation(lon, lat) ! if (datum_alt < 5.0): ! datum_alt = 0.0 ! UI.SendDatumToLauncher(lon,lat,datum_alt + 5.0,launcher_num) UI.Launch(launcher_num, 1) *************** *** 47,52 **** lon = track_info.Lon UI.HandoffTargetToLauncher(launcher) # so that intended target is set ! UI.SendDatumToLauncher(lon,lat,launcher) ! UI.Launch(launcher,1) else: # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) --- 50,54 ---- lon = track_info.Lon UI.HandoffTargetToLauncher(launcher) # so that intended target is set ! LaunchDatum(UI, lon, lat, launcher) else: # handoff to active seeker target_accepted = UI.HandoffTargetToLauncher(launcher) |
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:45:56
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3451/src/sim Modified Files: tcMissileObject.cpp tcSimState.cpp tcWeaponObject.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** tcSimState.cpp 19 Jul 2004 00:53:01 -0000 1.46 --- tcSimState.cpp 23 Jul 2004 00:45:47 -0000 1.47 *************** *** 390,393 **** --- 390,395 ---- wxASSERT(missile); + + #if 0 float terrainHeight_m = missile->mcTerrain.mfHeight_m; if (missile->mcKin.mfAlt_m > terrainHeight_m + 25.0) return; *************** *** 396,399 **** --- 398,402 ---- double lon_rad; double lat_rad; + float tImpact = missile->mcKin.CalculateGroundImpactPoint( terrainHeight_m + blastHeight_m, lon_rad, lat_rad); *************** *** 404,408 **** missile->mcKin.mfLon_rad = lon_rad; missile->mcKin.mfLat_rad = lat_rad; ! --- 407,412 ---- missile->mcKin.mfLon_rad = lon_rad; missile->mcKin.mfLat_rad = lat_rad; ! #endif ! if (!missile->IsDetonated()) return; *************** *** 413,420 **** tcRect blastRegion; ! float west = lon_rad - rLon; ! float east = lon_rad + rLon; ! float north = lat_rad + rLat; ! float south = lat_rad - rLat; if (west < -C_PI) west += C_TWOPI; if (east >= C_PI) east -= C_TWOPI; --- 417,424 ---- tcRect blastRegion; ! float west = missile->mcKin.mfLon_rad - rLon; ! float east = missile->mcKin.mfLon_rad + rLon; ! float north = missile->mcKin.mfLat_rad + rLat; ! float south = missile->mcKin.mfLat_rad - rLat; if (west < -C_PI) west += C_TWOPI; if (east >= C_PI) east -= C_TWOPI; *************** *** 451,454 **** --- 455,466 ---- } } + else + { + tcString s; + s.Format("weapon (DUD) %d target %d, range: %3.1f m, time %.1f s", + missile->mnID, target->mnID, range_m, mfSimTime); + WTL(s.GetBuffer()); + } + } else *************** *** 526,529 **** --- 538,542 ---- return afDamage / pPlatformObj->mpDBObject->mfToughness; } + wxASSERT(false); return afDamage; } Index: tcWeaponObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcWeaponObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcWeaponObject.cpp 1 May 2004 21:49:06 -0000 1.4 --- tcWeaponObject.cpp 23 Jul 2004 00:45:47 -0000 1.5 *************** *** 52,55 **** --- 52,71 ---- } + /** + * Called when weapon detonates + */ + void tcWeaponObject::Detonate() + { + fuseHasTriggered = true; + } + + /** + * @return true if weapon has detonated + */ + bool tcWeaponObject::IsDetonated() + { + return fuseHasTriggered; + } + bool tcWeaponObject::IsIntendedTarget(long id) { *************** *** 80,85 **** */ tcWeaponObject::tcWeaponObject() { ! intendedTarget = -1; } --- 96,102 ---- */ tcWeaponObject::tcWeaponObject() + : fuseHasTriggered(false),intendedTarget(-1) { ! } *************** *** 96,100 **** */ tcWeaponObject::tcWeaponObject(tcDatabaseObject *obj) ! : tcGameObject(obj) { wxASSERT(simState); --- 113,117 ---- */ tcWeaponObject::tcWeaponObject(tcDatabaseObject *obj) ! : tcGameObject(obj), fuseHasTriggered(false) { wxASSERT(simState); Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcMissileObject.cpp 19 Jul 2004 00:53:01 -0000 1.13 --- tcMissileObject.cpp 23 Jul 2004 00:45:47 -0000 1.14 *************** *** 273,278 **** if (pSegmentInfo->meAltitudeMode == AM_DATUM) { ! interceptPitch_rad = atanf(0.001f*(msWaypoint.mfAlt_m - mcKin.mfAlt_m)/ ! mfRangeToObjective_km); useInterceptPitch = true; } --- 273,300 ---- if (pSegmentInfo->meAltitudeMode == AM_DATUM) { ! tcTrack groundTrack; ! ! groundTrack.mfAlt_m = msWaypoint.mfAlt_m; ! groundTrack.mfLon_rad = msWaypoint.mfLon_rad; ! groundTrack.mfLat_rad = msWaypoint.mfLat_rad; ! groundTrack.mfSpeed_kts = 0; ! ! float tti_s; ! float range_rad; ! ! mcKin.GetInterceptData3D(groundTrack, mfGoalHeading_rad, ! interceptPitch_rad, tti_s, range_rad); ! ! mfRangeToObjective_km = C_RADTOKM * range_rad; ! ! if (mfRangeToObjective_km <= 0.050) ! { ! Detonate(); ! } ! ! mfInterceptTime = tti_s; ! ! //interceptPitch_rad = atanf(0.001f*(msWaypoint.mfAlt_m - mcKin.mfAlt_m)/ ! // mfRangeToObjective_km); useInterceptPitch = true; } *************** *** 295,309 **** mfRangeToObjective_km *= C_RADTOKM; // convert to km - if (tti_s <= 5.0f) - { - mfGuidanceUpdateInterval = 0.2f; - mcSensorState.mfCurrentScanPeriod_s = 0.2f; - } - else if (tti_s <= 2.0f) - { - mfGuidanceUpdateInterval = 0.1f; - mcSensorState.mfCurrentScanPeriod_s = 0.1f; - } - if (msKState.mfAltitude_m <= 4.0) --- 317,320 ---- *************** *** 331,341 **** } //************ update altitude control ************** switch (pSegmentInfo->meAltitudeMode) { case AM_ASL: - case AM_AGL: fGoalAltitude_m = pSegmentInfo->mfAltitude_m; break; case AM_INTERCEPT: // use seeker data or maintain altitude break; --- 342,368 ---- } + // update guidance update rate and seeker scan rate based on time to intercept + if (mfInterceptTime <= 5.0) + { + mfGuidanceUpdateInterval = 0.2f; + mcSensorState.mfCurrentScanPeriod_s = 0.2f; + } + else if (mfInterceptTime <= 2.0) + { + mfGuidanceUpdateInterval = 0.1f; + mcSensorState.mfCurrentScanPeriod_s = 0.1f; + } + + //************ update altitude control ************** switch (pSegmentInfo->meAltitudeMode) { case AM_ASL: fGoalAltitude_m = pSegmentInfo->mfAltitude_m; break; + case AM_AGL: + fGoalAltitude_m = pSegmentInfo->mfAltitude_m + + mcTerrain.mfHeight_m; + break; case AM_INTERCEPT: // use seeker data or maintain altitude break; *************** *** 402,405 **** --- 429,433 ---- mfGuidanceUpdateInterval = 1.0f; // 1 second default mfLastGuidanceUpdate = 0.0f; + mfInterceptTime = 9999.0f; } *************** *** 541,545 **** // tsMissileKState for detailed missile modeling using tcAero memset(&msKState,0x00,sizeof(msKState)); ! mfLastGuidanceUpdate = 0; guidanceStatusTime = 0; mfGuidanceUpdateInterval = 0.5f; --- 569,573 ---- // tsMissileKState for detailed missile modeling using tcAero memset(&msKState,0x00,sizeof(msKState)); ! guidanceStatusTime = 0; mfGuidanceUpdateInterval = 0.5f; *************** *** 580,583 **** --- 608,612 ---- mfLastGuidanceUpdate = 0.0f; guidanceStatusTime = 0; + mfInterceptTime = 9999.0f; // if these inits are missing, causes a crash with time accel after missile launch *************** *** 589,594 **** // init sensors, only one sensor (primary) supported in this version tnPoolIndex nSensorKey = database->GetKey(obj->maSensorClass[0]); ! mcSensorState.InitFromDB(database,nSensorKey, 0); // missile seeker always points forward ! mcSensorState.SetParent(this); } --- 618,627 ---- // init sensors, only one sensor (primary) supported in this version tnPoolIndex nSensorKey = database->GetKey(obj->maSensorClass[0]); ! ! if (nSensorKey != -1) ! { ! mcSensorState.InitFromDB(database,nSensorKey, 0); // missile seeker always points forward ! mcSensorState.SetParent(this); ! } } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-23 00:45:55
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3451/include/sim Modified Files: tcWeaponObject.h Log Message: Index: tcWeaponObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcWeaponObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcWeaponObject.h 1 May 2004 21:49:24 -0000 1.3 --- tcWeaponObject.h 23 Jul 2004 00:45:46 -0000 1.4 *************** *** 42,45 **** --- 42,46 ---- { public: + bool IsDetonated(); /// returns true if id is intended target of this weapon bool IsIntendedTarget(long id); *************** *** 49,56 **** --- 50,60 ---- protected: long intendedTarget; + bool fuseHasTriggered; ///< set true when weapon detonates virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); + void Detonate(); + tcWeaponObject(); tcWeaponObject(tcWeaponObject&); |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:53:12
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28653/src/graphics Modified Files: tc3DTerrain.cpp tcTerrainTextureFactory.cpp Log Message: Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DTerrain.cpp 14 May 2004 23:37:07 -0000 1.12 --- tc3DTerrain.cpp 19 Jul 2004 00:53:01 -0000 1.13 *************** *** 152,155 **** --- 152,163 ---- /** + * @return elevation at origin + */ + float tc3DTerrain::GetOriginElevation() + { + return mapData->GetTerrainHeight(lonOrigin_rad, latOrigin_rad, gameTime); + } + + /** * This function and other similar ones were copied from tc3DViewer. * @param lon longitude in radians Index: tcTerrainTextureFactory.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainTextureFactory.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcTerrainTextureFactory.cpp 14 May 2004 23:37:07 -0000 1.8 --- tcTerrainTextureFactory.cpp 19 Jul 2004 00:53:01 -0000 1.9 *************** *** 363,366 **** --- 363,371 ---- defaultTexture = new Demeter::Texture(seaTexture->data(),texSize,texSize, texSize,0,true,false,false); + + wxASSERT(mountainTexture->s()==mountainTexture->t()); + texSize = mountainTexture->s(); + defaultTextureLand = new Demeter::Texture(mountainTexture->data(),texSize,texSize, + texSize,0,true,false,false); } *************** *** 373,381 **** int cacheIdx = GetTextureIndex(originX, originY); //fprintf(stdout, "originX,Y: %.0f, %.0f, cacheIdx:%d\n",originX,originY,cacheIdx); ! Demeter::Texture *tex = m_Textures[cacheIdx]; ! if (tex == NULL) ! { ! return defaultTexture; ! } else { --- 378,398 ---- int cacheIdx = GetTextureIndex(originX, originY); //fprintf(stdout, "originX,Y: %.0f, %.0f, cacheIdx:%d\n",originX,originY,cacheIdx); ! Demeter::Texture *tex = m_Textures[cacheIdx]; ! if (tex == NULL) ! { ! float originHeight = terrainManager->GetOriginElevation(); ! // terrainManager->GetElevation(originX + 0.5*width, originY + 0.5*height); ! if (originHeight < 0) ! { ! return defaultTexture; ! } ! else ! { ! /* This is part of a workaround to show a land texture when loading ! ** textures over land. ! */ ! return defaultTextureLand; ! } ! } else { *************** *** 474,476 **** --- 491,494 ---- FreeTextureCache(); if (defaultTexture) delete defaultTexture; + if (defaultTextureLand) delete defaultTextureLand; } |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28653/src/sim Modified Files: tcGameView.cpp tcLauncherState.cpp tcMapView.cpp tcMissileObject.cpp tcPlatformObject.cpp tcRadar.cpp tcSimState.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** tcSimState.cpp 18 Jul 2004 03:18:01 -0000 1.45 --- tcSimState.cpp 19 Jul 2004 00:53:01 -0000 1.46 *************** *** 193,197 **** } /********************************************************************/ ! void tcSimState::DesignateLauncherDatum(tnPoolIndex anKey, tcPoint p, unsigned anLauncher) { int bFound; --- 193,197 ---- } /********************************************************************/ ! void tcSimState::DesignateLauncherDatum(tnPoolIndex anKey, tsGeoPoint p, unsigned anLauncher) { int bFound; *************** *** 331,336 **** } /********************************************************************/ /** ! * break this up, too many nested conditionals */ void tcSimState::UpdateWeaponHits() --- 331,473 ---- } /********************************************************************/ + /** ! * Used for a missile that is guided with a sensor to a target. The ! * assumption is that the intended target is the only possible target ! * that can be hit. This saves time by not looking for nearby accidental ! * targets. ! */ ! void tcSimState::EvaluateGuidedMissileHit(tcMissileObject* missile, tcGameObject* target) ! { ! float range_m = 1000.0f*missile->mcKin.RangeToKmAlt(target->mcKin); ! float fFactor = 0.01f*(missile->mcKin.mfSpeed_kts + target->mcKin.mfSpeed_kts + 2000.0f); ! ! if (range_m >= fFactor) return; // too far away, no damage ! ! float dx, dy, dz, tclosest; ! tclosest = target->mcKin.CalculateCollisionPoint(missile->mcKin, dx, dy, dz); ! ! if (tclosest > 0.03) return; // defer until future time step ! ! float trueRange2 = dx*dx + dy*dy + dz*dz; ! if (trueRange2 < 64.0f) // 8.0 m range ! { ! tcString s; ! s.Format("weapon %d hit target %d, range^2: %3.1f m, time %.1f s", ! missile->mnID, target->mnID, trueRange2, mfSimTime); ! WTL(s.GetBuffer()); ! std::cout << s.GetBuffer(); ! fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", ! tclosest, dx, dy, dz); ! ! float fDamage = missile->mpDBObject->mfDamage; ! float fDamageFract = GetFractionalDamage(fDamage, target); ! target->mfDamageLevel += fDamageFract; ! missile->mfDamageLevel += 1.0f; // missile destroys itself on impact ! ! if (fDamageFract > 0) ! { ! if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) ! { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); ! } ! else ! { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); ! } ! } ! } ! ! } ! ! /** ! * Used for a missile used against fixed land targets. The region near ! * the collision point is searched for nearby targets. Damage is applied ! * to all targets that are close enough. ! */ ! void tcSimState::EvaluateImpactMissileHit(tcMissileObject* missile) ! { ! wxASSERT(missile); ! ! float terrainHeight_m = missile->mcTerrain.mfHeight_m; ! if (missile->mcKin.mfAlt_m > terrainHeight_m + 25.0) return; ! ! const float blastHeight_m = 3.0f; // height above ground for detonation ! double lon_rad; ! double lat_rad; ! float tImpact = missile->mcKin.CalculateGroundImpactPoint( ! terrainHeight_m + blastHeight_m, lon_rad, lat_rad); ! ! if (tImpact > 0.03) return; // defer until future time step ! ! missile->mcKin.mfAlt_m = terrainHeight_m; ! missile->mcKin.mfLon_rad = lon_rad; ! missile->mcKin.mfLat_rad = lat_rad; ! ! ! ! float rLat = 500.0 * C_MTORAD; ! float rLon = rLat / cosf(missile->mcKin.mfLat_rad); ! ! long blastPlats[16]; ! ! tcRect blastRegion; ! float west = lon_rad - rLon; ! float east = lon_rad + rLon; ! float north = lat_rad + rLat; ! float south = lat_rad - rLat; ! if (west < -C_PI) west += C_TWOPI; ! if (east >= C_PI) east -= C_TWOPI; ! blastRegion.Set(west, east, south, north); ! ! int nPlats = GetPlatformsWithinRegion(blastPlats, 16, &blastRegion); ! float fDamage = missile->mpDBObject->mfDamage; ! ! for (int idx = 0; idx < nPlats; idx++) ! { ! tcGameObject* target = GetObject(blastPlats[idx]); ! if (target && (target->mnID != missile->mnID)) ! { ! float range_m = 1000.0f * target->mcKin.RangeToKmAlt(missile->mcKin); ! if (range_m <= 80.0) ! { ! float fDamageFract = GetFractionalDamage(fDamage, target); ! target->mfDamageLevel += fDamageFract; ! ! if (fDamageFract > 0) ! { ! tcString s; ! s.Format("weapon (impact) %d hit target %d, range: %3.1f m, time %.1f s", ! missile->mnID, target->mnID, range_m, mfSimTime); ! WTL(s.GetBuffer()); ! ! if (mpUserInfo->IsOwnAlliance(target->mnAlliance)) ! { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); ! } ! else ! { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); ! } ! } ! } ! else ! { ! tcString s; ! s.Format("weapon (impact) %d missed target %d, range: %3.1f m, time %.1f s", ! missile->mnID, target->mnID, range_m, mfSimTime); ! WTL(s.GetBuffer()); ! } ! } ! } ! ! missile->mfDamageLevel += 1.0f; ! ! } ! ! ! /** ! * JUL2004 This was modified to use EvaluateGuidedMissileHit and ! * EvaluateImpactMissileHit. */ void tcSimState::UpdateWeaponHits() *************** *** 338,400 **** long aKeyList[512]; int nCount; - tcGameObject *pobj, *ptarget; tsGuidanceParameters gp; - int bFound; - float fRange_m; nCount = GetAllWeaponObjects(aKeyList,512); for(int k=0;k<nCount;k++) { ! bFound = maPlatformState.Lookup(aKeyList[k],pobj); ! tcMissileObject *pMissileObj = dynamic_cast<tcMissileObject*>(pobj); ! if (bFound&&(pMissileObj != NULL)) ! { ! bool bTarget = (pMissileObj->GetGuidanceParameters(gp) == 1); ! bFound = (bTarget) ? maPlatformState.Lookup(gp.mnTargetID,ptarget) : false; ! if (bFound) ! { ! fRange_m = 1000.0f*pobj->mcKin.RangeToKmAlt(ptarget->mcKin); ! float fFactor = 0.01f*(pobj->mcKin.mfSpeed_kts + ptarget->mcKin.mfSpeed_kts + 2000.0f); ! if (fRange_m < fFactor) ! { ! float dx,dy,dz,tclosest; ! tclosest = ptarget->mcKin.CalculateCollisionPoint(pMissileObj->mcKin, ! dx,dy,dz); ! if (tclosest <= 0.03) ! { ! float trueRange2 = dx*dx + dy*dy + dz*dz; ! if (trueRange2 < 64.0f) // 8.0 m range ! { ! tcString s; ! s.Format("weapon %d hit target %d, range^2: %3.1f m, time %.1f s", ! aKeyList[k],gp.mnTargetID,trueRange2,mfSimTime); ! WTL(s.GetBuffer()); ! std::cout << s.GetBuffer(); ! fprintf(stdout," collision relative time: %f, dx:%f dy:%f dz:%f\n", ! tclosest,dx,dy,dz); ! ! float fDamage = pMissileObj->mpDBObject->mfDamage; ! float fDamageFract = GetFractionalDamage(fDamage, ptarget); ! ptarget->mfDamageLevel += fDamageFract; ! pobj->mfDamageLevel += 1.0f; // missile destroys itself on impact ! ! if (fDamageFract > 0) ! { ! if (mpUserInfo->IsOwnAlliance(ptarget->mnAlliance)) ! { ! tcSound::Get()->PlayEffect(SEFFECT_IMPLOSION); ! } ! else ! { ! tcSound::Get()->PlayEffect(SEFFECT_EXPLOSION2); ! } ! } ! } ! } ! - } - } } } --- 475,507 ---- long aKeyList[512]; int nCount; tsGuidanceParameters gp; nCount = GetAllWeaponObjects(aKeyList,512); for(int k=0;k<nCount;k++) { ! tcGameObject* obj = GetObject(aKeyList[k]); + if (tcMissileObject* missileObj = dynamic_cast<tcMissileObject*>(obj)) + { + bool bTerminal = (missileObj->GetGuidanceParameters(gp) != 0); + if (gp.mnTargetID != -1) + { + if ((gp.mfInterceptTime < 10.0)) + { + if (tcGameObject* target = GetObject(gp.mnTargetID)) + { + EvaluateGuidedMissileHit(missileObj, target); + } + } + } + else + { + if (missileObj->mcKin.mfAlt_m < missileObj->mcTerrain.mfHeight_m + 200.0) + { + EvaluateImpactMissileHit(missileObj); + } + } + } } *************** *** 1181,1254 **** } /********************************************************************/ ! void tcSimState::AddLaunchedPlatform(long anNewKey, tcGameObject *plaunchingplatform, unsigned anLauncher) { ! tcGameObject *pnew; tcDatabaseObject *pDBObject; ! pDBObject = mpDatabase->GetObject(anNewKey); if (pDBObject == NULL) {return;} - // only missiles are supported with this (and not for long) - tcMissileDBObject *pMissileData = dynamic_cast<tcMissileDBObject*>(pDBObject); - wxASSERT(pMissileData); - - tcMissileObject* pMissileObj = dynamic_cast<tcMissileObject*>(CreateGameObject(pMissileData)); - if (pMissileObj == NULL) {return;} ! pMissileObj->msKState.mfAltitude_m = plaunchingplatform->mcKin.mfAlt_m; ! if (pMissileObj->msKState.mfAltitude_m < 5.0f) ! { ! pMissileObj->msKState.mfAltitude_m = 5.0f; ! } ! pMissileObj->msKState.mfSpeed_mps = plaunchingplatform->mcKin.mfSpeed_kts* ! (float)C_KTSTOMPS; ! tcLauncherState* pLauncherState; ! plaunchingplatform->GetLauncherState(pLauncherState); ! wxASSERT(pLauncherState); - const tcLauncher* pLauncher = pLauncherState->GetLauncher(anLauncher); ! pMissileObj->mfGoalHeading_rad = ! plaunchingplatform->mcKin.mfHeading_rad + pLauncher->pointingAngle; ! ! if (pLauncher->meLaunchMode == DATUM_ONLY) ! { ! pMissileObj->msWaypoint = pLauncher->msDatum; ! } ! else if ((pLauncher->meLaunchMode == SEEKER_TRACK) ! || (pLauncher->meLaunchMode == FC_TRACK)) ! { ! pMissileObj->msWaypoint = pLauncher->msDatum; ! pMissileObj->mcSensorState.SetActive(true); ! pMissileObj->mcSensorState.mnMode = SSMODE_SEEKERACQUIRE; ! pMissileObj->mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; ! if (pMissileObj->mcSensorState.IsSemiactive()) ! { ! pMissileObj->mcSensorState.SetIlluminator( ! plaunchingplatform->mnID, pLauncher->fireControlSensorIdx); ! pLauncher->fireControlSensor->RequestTrack(); ! } ! } ! ! ! // add heading and pitch initializers eventually, have to deal with launcher angle ! pnew = static_cast<tcGameObject*>(pMissileObj); ! ! pnew->mfStatusTime = plaunchingplatform->mfStatusTime; ! pnew->mcKin = plaunchingplatform->mcKin; ! pnew->mcKin.mfHeading_rad += pLauncher->pointingAngle; ! ! // pnew->mcKin.mfHeading_rad += p ! tcString s; ! s.Format("From %s",plaunchingplatform->mzUnit.mz); ! pnew->mzUnit = s.GetBuffer(); ! pnew->mnAlliance = plaunchingplatform->mnAlliance; ! ! AddPlatform(pnew); ! ! // set intended target (has to be done after alliance and id is set) ! pMissileObj->SetIntendedTarget(pLauncher->mnTargetID); ! ! if (mpUserInfo->IsOwnAlliance(plaunchingplatform->mnAlliance)) { tcSound::Get()->PlayEffect(SEFFECT_MISSILELAUNCH); --- 1288,1316 ---- } /********************************************************************/ ! void tcSimState::AddLaunchedPlatform(long newKey, tcGameObject* launchingPlatform, ! unsigned nLauncher) ! { tcDatabaseObject *pDBObject; ! pDBObject = mpDatabase->GetObject(newKey); if (pDBObject == NULL) {return;} ! tcGameObject* launched = CreateGameObject(pDBObject); ! if (tcMissileObject* missile = dynamic_cast<tcMissileObject*>(launched)) ! { ! missile->LaunchFrom(launchingPlatform, nLauncher); ! } ! else ! { ! fprintf(stderr, ! "AddLaunchedPlatform - Unrecognized or NULL obj from CreateGameObject"); ! return; ! } ! ! if (mpUserInfo->IsOwnAlliance(launchingPlatform->mnAlliance)) { tcSound::Get()->PlayEffect(SEFFECT_MISSILELAUNCH); Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMissileObject.cpp 4 Jun 2004 21:39:23 -0000 1.12 --- tcMissileObject.cpp 19 Jul 2004 00:53:01 -0000 1.13 *************** *** 1,20 **** ! /* ! * Copyright (C) 2003 Dewitt "Cole" 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, [...1051 lines suppressed...] ! mfLastGuidanceUpdate = 0.0f; ! guidanceStatusTime = 0; ! // if these inits are missing, causes a crash with time accel after missile launch ! memset(&msKState,0x00,sizeof(msKState)); ! mfLastGuidanceUpdate = 0; ! mnCurrentSegment = 0; ! mfGoalPitch_rad = 0.01f; ! // init sensors, only one sensor (primary) supported in this version ! tnPoolIndex nSensorKey = database->GetKey(obj->maSensorClass[0]); ! mcSensorState.InitFromDB(database,nSensorKey, 0); // missile seeker always points forward ! mcSensorState.SetParent(this); } /** ! * ! */ tcMissileObject::~tcMissileObject() {} Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcLauncherState.cpp 4 Jun 2004 21:39:23 -0000 1.11 --- tcLauncherState.cpp 19 Jul 2004 00:53:01 -0000 1.12 *************** *** 120,123 **** --- 120,130 ---- } + tcLauncher* tcLauncherState::GetLauncher(unsigned int nLauncher) + { + if ((int)nLauncher >= mnCount) return 0; + + return &launchers[nLauncher]; + } + const tcLauncher* tcLauncherState::GetLauncher(unsigned nLauncher) const { *************** *** 386,390 **** * @return true if success */ ! bool tcLauncherState::SetLauncherDatum(unsigned nLauncher, double lon_rad, double lat_rad) { if (nLauncher > launchers.size()) --- 393,398 ---- * @return true if success */ ! bool tcLauncherState::SetLauncherDatum(unsigned nLauncher, ! double lon_rad, double lat_rad, float alt_m) { if (nLauncher > launchers.size()) *************** *** 393,397 **** return false; } ! launchers[nLauncher].msDatum.Set(lon_rad, lat_rad); commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); return true; --- 401,405 ---- return false; } ! launchers[nLauncher].msDatum.Set(lon_rad, lat_rad, alt_m); commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); return true; *************** *** 410,413 **** --- 418,423 ---- } launchers[nLauncher].mnTargetID = targetID; + launchers[nLauncher].msDatum.Set(0, 0, 0); // clear datum + commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); return true; Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcMapView.cpp 25 Jun 2004 01:40:27 -0000 1.27 --- tcMapView.cpp 19 Jul 2004 00:53:01 -0000 1.28 *************** *** 724,728 **** } ! void tcTacticalMapView::DrawNTDSSurface(Graphics *apGraphics, teAffiliation affil) { float symbsize=15.0f; float x = 12.0f; --- 724,729 ---- } ! void tcTacticalMapView::DrawNTDSSurface(Graphics *apGraphics, teAffiliation affil) ! { float symbsize=15.0f; float x = 12.0f; *************** *** 757,760 **** --- 758,807 ---- } + + /** + * NTDS ground is drawn as slightly smaller surface with horizontal bar + * underneath. This isn't a "real" NTDS symbol, but will stand-in until + * some more symbology work is done. + */ + void tcTacticalMapView::DrawNTDSGround(Graphics* graphics, teAffiliation affil) + { + float w = 10.0f; // symbol size + + // x and y normally set to center of image (image size / 2) + float x = 12.0f; + float y = 12.0f; + + switch (affil) + { + case FRIENDLY: + case NEUTRAL: + { + RectF rect(x-w/2.0f, y-w/2.0f, w, w); + graphics->DrawArc(mpPen,rect,0,360); + break; + } + case UNKNOWN: + { + float w = 9.0f; // make unknown box a little smaller to see bar underneath + graphics->DrawLine(mpPen, x-w/2, y+w/2, x-w/2, y-w/2); + graphics->DrawLine(mpPen, x+w/2, y+w/2, x+w/2, y-w/2); + graphics->DrawLine(mpPen, x-w/2, y-w/2, x+w/2, y-w/2); + graphics->DrawLine(mpPen, x-w/2, y+w/2, x+w/2, y+w/2); + + break; + } + case HOSTILE: + { + graphics->DrawLine(mpPen, x-w/2, y, x, y-w/2); + graphics->DrawLine(mpPen, x, y-w/2, x+w/2, y); + graphics->DrawLine(mpPen, x-w/2, y, x, y+w/2); + graphics->DrawLine(mpPen, x, y+w/2, x+w/2, y); + break; + } + } + graphics->DrawLine(mpPen, x-w/2, y+w/2+1, x+w/2, y+w/2+1); + } + + void tcTacticalMapView::DrawNTDSUnknown(Graphics *apGraphics, teAffiliation affil) { float symbsize=8.0f; *************** *** 852,856 **** Graphics *pGraphics; ! for (int nAffiliation=0;nAffiliation<4;nAffiliation++) { mpPen->SetColor(Color(GetAffiliationColor((teAffiliation)nAffiliation))); --- 899,904 ---- Graphics *pGraphics; ! for (int nAffiliation=0;nAffiliation<4;nAffiliation++) ! { mpPen->SetColor(Color(GetAffiliationColor((teAffiliation)nAffiliation))); *************** *** 861,864 **** --- 909,918 ---- delete pGraphics; + // fixed ground symbol + Image* pGround = pNull->Clone(); + pGraphics = GetGraphicsFromImage(pGround); + DrawNTDSGround(pGraphics, (teAffiliation)nAffiliation); + delete pGraphics; + // missile Image *pMissile = pNull->Clone(); *************** *** 911,914 **** --- 965,971 ---- pSymbol = pSurface; break; + case SYMBOL_FIXED: + pSymbol = pGround; + break; default: pSymbol = pUnknown; *************** *** 990,997 **** } ! Image* tcTacticalMapView::GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol) { int nAffilIdx = (int)aeAffiliation; int nSymbolIdx = (int)aeSymbol; ! if (meSymbology == NTDS) { return maSymbolA[nAffilIdx][nSymbolIdx]; } --- 1047,1059 ---- } ! /** ! * @returns symbol image pointer based on symbology mode ! */ ! Image* tcTacticalMapView::GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol) ! { int nAffilIdx = (int)aeAffiliation; int nSymbolIdx = (int)aeSymbol; ! if (meSymbology == NTDS) ! { return maSymbolA[nAffilIdx][nSymbolIdx]; } *************** *** 1182,1187 **** } ! /***********************************************************************************/ ! int tcTacticalMapView::DrawSymbol2(Graphics *apGraphics, MapView::tcMapObj *pMO) { float symbsize=15.0f; float vectsize=18.0f; // heading vector length --- 1244,1252 ---- } ! /** ! * Version that uses pre-drawn images to draw symbols ! */ ! int tcTacticalMapView::DrawSymbol2(Graphics *graphics, MapView::tcMapObj *pMO) ! { float symbsize=15.0f; float vectsize=18.0f; // heading vector length *************** *** 1207,1223 **** } ! if (apGraphics==NULL) ShowAndAbort("tcTacticalMapView::DrawSymbol failed to get Graphics object\n"); ! apGraphics->GetClipBounds(&rclipbounds); ! if (type == SYMBOL_SENSOR) { symbsize = 8.0f; vectsize = 10.0f; } ! else if (type == SYMBOL_TARGET) { symbsize = 30.0f; } unsigned int mnPenColor; ! switch (pMO->meAffiliation) { case UNKNOWN: mnPenColor = 0xFFFFFF5F; --- 1272,1291 ---- } ! if (graphics==NULL) ShowAndAbort("tcTacticalMapView::DrawSymbol failed to get Graphics object\n"); ! graphics->GetClipBounds(&rclipbounds); ! if (type == SYMBOL_SENSOR) ! { symbsize = 8.0f; vectsize = 10.0f; } ! else if (type == SYMBOL_TARGET) ! { symbsize = 30.0f; } unsigned int mnPenColor; ! switch (pMO->meAffiliation) ! { case UNKNOWN: mnPenColor = 0xFFFFFF5F; *************** *** 1236,1243 **** break; } ! if (type == SYMBOL_TARGET) { mnPenColor = 0xFFFF0000; } ! if (bBearingOnly) { // use faded (half alpha) color for bearing line tracks // symbol is drawn ahead of time so its color remains the same --- 1304,1313 ---- break; } ! if (type == SYMBOL_TARGET) ! { mnPenColor = 0xFFFF0000; } ! if (bBearingOnly) ! { // use faded (half alpha) color for bearing line tracks // symbol is drawn ahead of time so its color remains the same *************** *** 1259,1263 **** // yet ANOTHER exception to the rule, this needs to be cleaned up!! float xv_passive, yv_passive; ! if (bBearingOnly) { h = atan2f(sinf(h),cosf(h)*cosf(pMO->mfLat)); float dx = passive_vect_size*sinf(h); --- 1329,1334 ---- // yet ANOTHER exception to the rule, this needs to be cleaned up!! float xv_passive, yv_passive; ! if (bBearingOnly) ! { h = atan2f(sinf(h),cosf(h)*cosf(pMO->mfLat)); float dx = passive_vect_size*sinf(h); *************** *** 1283,1287 **** } RectF rect(x-2.0f,y-2.0f,4.0f,4.0f); ! apGraphics->DrawPie(mpPen,rect,0,360); return 0; } --- 1354,1358 ---- } RectF rect(x-2.0f,y-2.0f,4.0f,4.0f); ! graphics->DrawPie(mpPen,rect,0,360); return 0; } *************** *** 1298,1305 **** if (type == SYMBOL_TARGET) { ! apGraphics->DrawLine(mpPen,x,y-8,x,p1y); ! apGraphics->DrawLine(mpPen,x,y+8,x,p2y); ! apGraphics->DrawLine(mpPen,x-8,y,p1x,y); ! apGraphics->DrawLine(mpPen,x+8,y,p2x,y); h = HEADING_UNKNOWN; } --- 1369,1376 ---- if (type == SYMBOL_TARGET) { ! graphics->DrawLine(mpPen,x,y-8,x,p1y); ! graphics->DrawLine(mpPen,x,y+8,x,p2y); ! graphics->DrawLine(mpPen,x-8,y,p1x,y); ! graphics->DrawLine(mpPen,x+8,y,p2x,y); h = HEADING_UNKNOWN; } *************** *** 1312,1325 **** mpPen->SetColor(pMO->mnColor); if (mpOptions->mbFillRangeCircles) { ! apGraphics->FillPie(mpBrush,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) } else { if (pMO->mfArc_deg >= 360.0f) { ! apGraphics->DrawEllipse(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height); } else { ! apGraphics->DrawPie(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) } --- 1383,1396 ---- mpPen->SetColor(pMO->mnColor); if (mpOptions->mbFillRangeCircles) { ! graphics->FillPie(mpBrush,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) } else { if (pMO->mfArc_deg >= 360.0f) { ! graphics->DrawEllipse(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height); } else { ! graphics->DrawPie(mpPen,pscreen.x-0.5f*width,pscreen.y-0.5f*height, width,height,h-0.5f*pMO->mfArc_deg-90.0f,pMO->mfArc_deg); // h is in degrees (fix this) } *************** *** 1328,1332 **** else { Image *pSymbol = GetSymbol(pMO->meAffiliation, pMO->meSymbol); ! apGraphics->DrawImage(pSymbol, x + mfSymbolXOffset, y + mfSymbolYOffset); } --- 1399,1403 ---- else { Image *pSymbol = GetSymbol(pMO->meAffiliation, pMO->meSymbol); ! graphics->DrawImage(pSymbol, x + mfSymbolXOffset, y + mfSymbolYOffset); } *************** *** 1334,1365 **** // draw heading vector (unless == HEADING_UNKNOWN) if (bHeadingValid && (!bBearingOnly)) { ! apGraphics->DrawLine(mpPen,x,y,xv,yv); } ! if ((mbShowTrackID)&&(pMO->mnID!=NULL_INDEX)&&(type != SYMBOL_UNKNOWN)) { char zBuff[16]; mpBrush->SetColor(0xFEFFFFFF); sprintf(zBuff,"%04d",pMO->mnID); ! DrawText(apGraphics,mpFontSmall,mpBrush,zBuff,x-9.0f,y+15.0f); } // draw focus box if applicable ! if ((pMO->mbFocus)&&(pMO->mnID!=NULL_INDEX)) { mpPen->SetColor(Color(0xFFFFFFFF)); const float fFocus = 6.5f; ! apGraphics->DrawLine(mpPen,p1x,p1y-fFocus,p1x-fFocus,p1y-fFocus); ! apGraphics->DrawLine(mpPen,p1x-fFocus,p1y-fFocus,p1x-fFocus,p1y); ! apGraphics->DrawLine(mpPen,p1x-fFocus,p2y,p1x-fFocus,p2y+fFocus); ! apGraphics->DrawLine(mpPen,p1x-fFocus,p2y+fFocus,p1x,p2y+fFocus); ! apGraphics->DrawLine(mpPen,p2x,p2y+fFocus,p2x+fFocus,p2y+fFocus); ! apGraphics->DrawLine(mpPen,p2x+fFocus,p2y+fFocus,p2x+fFocus,p2y); ! apGraphics->DrawLine(mpPen,p2x+fFocus,p1y,p2x+fFocus,p1y-fFocus); ! apGraphics->DrawLine(mpPen,p2x+fFocus,p1y-fFocus,p2x,p1y-fFocus); } // draw bearing line if applicable ! if (bBearingOnly) { ! apGraphics->DrawLine(mpPen,xv,yv,xv_passive,yv_passive); } --- 1405,1439 ---- // draw heading vector (unless == HEADING_UNKNOWN) if (bHeadingValid && (!bBearingOnly)) { ! graphics->DrawLine(mpPen,x,y,xv,yv); } ! if ((mbShowTrackID)&&(pMO->mnID!=NULL_INDEX)&&(type != SYMBOL_UNKNOWN)) ! { char zBuff[16]; mpBrush->SetColor(0xFEFFFFFF); sprintf(zBuff,"%04d",pMO->mnID); ! DrawText(graphics,mpFontSmall,mpBrush,zBuff,x-9.0f,y+15.0f); } // draw focus box if applicable ! if ((pMO->mbFocus)&&(pMO->mnID!=NULL_INDEX)) ! { mpPen->SetColor(Color(0xFFFFFFFF)); const float fFocus = 6.5f; ! graphics->DrawLine(mpPen,p1x,p1y-fFocus,p1x-fFocus,p1y-fFocus); ! graphics->DrawLine(mpPen,p1x-fFocus,p1y-fFocus,p1x-fFocus,p1y); ! graphics->DrawLine(mpPen,p1x-fFocus,p2y,p1x-fFocus,p2y+fFocus); ! graphics->DrawLine(mpPen,p1x-fFocus,p2y+fFocus,p1x,p2y+fFocus); ! graphics->DrawLine(mpPen,p2x,p2y+fFocus,p2x+fFocus,p2y+fFocus); ! graphics->DrawLine(mpPen,p2x+fFocus,p2y+fFocus,p2x+fFocus,p2y); ! graphics->DrawLine(mpPen,p2x+fFocus,p1y,p2x+fFocus,p1y-fFocus); ! graphics->DrawLine(mpPen,p2x+fFocus,p1y-fFocus,p2x,p1y-fFocus); } // draw bearing line if applicable ! if (bBearingOnly) ! { ! graphics->DrawLine(mpPen,xv,yv,xv_passive,yv_passive); } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameView.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcGameView.cpp 21 Jun 2004 22:22:00 -0000 1.10 --- tcGameView.cpp 19 Jul 2004 00:53:01 -0000 1.11 *************** *** 565,569 **** unsigned int nColor; ! switch (aeAffiliation) { case UNKNOWN: nColor = 0xFFFFFF7F; --- 565,570 ---- unsigned int nColor; ! switch (aeAffiliation) ! { case UNKNOWN: nColor = 0xFFFFFF7F; *************** *** 582,586 **** // loop through all game objects and display those matching anAlliance ! while (i++<nSize) { mpSS->maPlatformState.GetNextAssoc(poolpos,nKey,po); point.x = (float)po->mcKin.mfLon_rad; --- 583,588 ---- // loop through all game objects and display those matching anAlliance ! while (i++<nSize) ! { mpSS->maPlatformState.GetNextAssoc(poolpos,nKey,po); point.x = (float)po->mcKin.mfLon_rad; *************** *** 593,603 **** mpMapView->maMapObj[rnIndex].mbExists = 1; mpMapView->maMapObj[rnIndex].mbFocus = 0; ! mpMapView->maMapObj[rnIndex].mfHeading = po->mcKin.mfHeading_rad; ! mpMapView->maMapObj[rnIndex].mnFlags = TRACK_HEADING_VALID; ! mpMapView->maMapObj[rnIndex].meSymbol = GetMapSymbolByClassification(pdata->mnType); ! mpMapView->maMapObj[rnIndex].meAffiliation = aeAffiliation; ! mpMapView->maMapObj[rnIndex].mfLon = (float)po->mcKin.mfLon_rad; ! mpMapView->maMapObj[rnIndex].mfLat = (float)po->mcKin.mfLat_rad; ! mpMapView->maMapObj[rnIndex].mnID = po->mnID; rnIndex++; } --- 595,614 ---- mpMapView->maMapObj[rnIndex].mbExists = 1; mpMapView->maMapObj[rnIndex].mbFocus = 0; ! mpMapView->maMapObj[rnIndex].meSymbol = GetMapSymbolByClassification(pdata->mnType); ! mpMapView->maMapObj[rnIndex].meAffiliation = aeAffiliation; ! mpMapView->maMapObj[rnIndex].mfLon = (float)po->mcKin.mfLon_rad; ! mpMapView->maMapObj[rnIndex].mfLat = (float)po->mcKin.mfLat_rad; ! mpMapView->maMapObj[rnIndex].mnID = po->mnID; ! ! if (mpMapView->maMapObj[rnIndex].meSymbol != SYMBOL_FIXED) ! { ! mpMapView->maMapObj[rnIndex].mfHeading = po->mcKin.mfHeading_rad; ! mpMapView->maMapObj[rnIndex].mnFlags = TRACK_HEADING_VALID; ! } ! else ! { ! mpMapView->maMapObj[rnIndex].mnFlags = 0; ! } ! rnIndex++; } *************** *** 619,624 **** } ! /******************************************************************************/ ! // add mnAlliance's sensor data to view void tcGameView::AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime) --- 630,637 ---- } ! ! /** ! * add mnAlliance's sensor data to view ! */ void tcGameView::AddSensorTracks(unsigned int anAlliance, int& rnIndex, int& rnWorldIdx, double afStatusTime) *************** *** 657,662 **** mpMapView->maMapObj[rnIndex].meSymbol = GetMapSymbolByClassification(track.mnClassification); - //mpMapView->maMapObj[rnIndex].meSymbol = (teSymbol)pTrack->mnClassification; teAffiliation affil = GetMapSymbolAffiliation(track.mnAffiliation); --- 670,679 ---- mpMapView->maMapObj[rnIndex].meSymbol = GetMapSymbolByClassification(track.mnClassification); + // don't show heading for tracks with zero speed (e.g. fixed ground) + if (track.mfSpeed_kts == 0) + { + mpMapView->maMapObj[rnIndex].mnFlags &= ~TRACK_HEADING_VALID; + } teAffiliation affil = GetMapSymbolAffiliation(track.mnAffiliation); *************** *** 697,711 **** } - - /* - tcGameObject *ptemp; - tnPoolIndex nTrackKey = track.mnID; - if (mpSS->maPlatformState.Lookup(nTrackKey, ptemp)) { - mpMapView->maMapObj[rnIndex].mnID = nTrackKey; - } - else { - mpMapView->maMapObj[rnIndex].mnID = NULL_INDEX; - } - */ rnIndex++; } --- 714,717 ---- Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcPlatformObject.cpp 18 Jul 2004 03:18:01 -0000 1.26 --- tcPlatformObject.cpp 19 Jul 2004 00:53:01 -0000 1.27 *************** *** 52,58 **** } ! void tcPlatformObject::DesignateLauncherDatum(tcPoint p, unsigned int anLauncher) { ! mcLauncherState.SetLauncherDatum(anLauncher, p.x, p.y); } --- 52,58 ---- } ! void tcPlatformObject::DesignateLauncherDatum(tsGeoPoint p, unsigned int anLauncher) { ! mcLauncherState.SetLauncherDatum(anLauncher, p.mfLon_rad, p.mfLat_rad, p.mfAlt_m); } *************** *** 271,274 **** --- 271,283 ---- } + + /** + * @return pointer to launcher with index of <idx> or NULL (0) for error + */ + tcLauncher* tcPlatformObject::GetLauncher(unsigned idx) + { + return mcLauncherState.GetLauncher(idx); + } + /** * Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcRadar.cpp 29 May 2004 00:11:54 -0000 1.8 --- tcRadar.cpp 19 Jul 2004 00:53:01 -0000 1.9 *************** *** 25,28 **** --- 25,30 ---- #include "tcAirObject.h" #include "tcMissileObject.h" + #include "tcAirfieldObject.h" + #include "tcGenericDBObject.h" #include "tcMissileDBObject.h" *************** *** 116,120 **** --- 118,124 ---- bool isSurface = false; bool isAir = false; + bool isGround = false; float rcs_dBsm; + if (const tcSurfaceObject* surfaceObj = dynamic_cast<const tcSurfaceObject*>(target)) { *************** *** 132,135 **** --- 136,144 ---- isAir = true; } + else if (const tcAirfieldObject* fieldObj = dynamic_cast<const tcAirfieldObject*>(target)) + { + rcs_dBsm = fieldObj->mpDBObject->mfRcs_dbsm; + isGround = true; + } else { *************** *** 166,170 **** bool bTargetTypeMatch = (mpDBObj->mbDetectsAir && isAir) || ! (mpDBObj->mbDetectsSurface && isSurface); bool bDetectable; --- 175,180 ---- bool bTargetTypeMatch = (mpDBObj->mbDetectsAir && isAir) || ! (mpDBObj->mbDetectsSurface && isSurface) || ! (mpDBObj->mbDetectsGround && isGround); bool bDetectable; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:53:12
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28653/src/database Modified Files: tcRadarDBObject.cpp Log Message: Index: tcRadarDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcRadarDBObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcRadarDBObject.cpp 30 Mar 2004 01:15:21 -0000 1.9 --- tcRadarDBObject.cpp 19 Jul 2004 00:53:01 -0000 1.10 *************** *** 1,6 **** ! /* ! ** tcRadarDBObject.cpp ! ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** @file tcRadarDBObject.cpp ! */ ! /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 51,57 **** int tcRadarDBObject::Serialize(tcFile& file, bool mbLoad, UINT32 anVersion) { ! if (anVersion <= VERSION_1_0_3) { tcDatabaseObject::Serialize(file,mbLoad,anVersion); ! if (mbLoad) { file.Read(&mfMaxRange_km,sizeof(mfMaxRange_km)); file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); --- 51,59 ---- int tcRadarDBObject::Serialize(tcFile& file, bool mbLoad, UINT32 anVersion) { ! if (anVersion <= VERSION_1_0_3) ! { tcDatabaseObject::Serialize(file,mbLoad,anVersion); ! if (mbLoad) ! { file.Read(&mfMaxRange_km,sizeof(mfMaxRange_km)); file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); *************** *** 63,71 **** file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); ! for(int i=0;i<8;i++) { ! file.Read(&mfGrowth[i],sizeof(float)); // growth fields ! } } ! else { file.Write(&mfMaxRange_km,sizeof(mfMaxRange_km)); file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); --- 65,73 ---- file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); ! file.Read(&mbDetectsGround,sizeof(mbDetectsGround)); ! } ! else ! { file.Write(&mfMaxRange_km,sizeof(mfMaxRange_km)); file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); *************** *** 77,89 **** file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); ! for(int i=0;i<8;i++) { ! file.Write(&mfGrowth[i],sizeof(float)); // growth fields ! } } return true; } ! else { tcSensorDBObject::Serialize(file,mbLoad,anVersion); ! if (mbLoad) { file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); file.Read(&mfERP_dBW,sizeof(mfERP_dBW)); --- 79,92 ---- file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); ! file.Write(&mbDetectsGround,sizeof(mbDetectsGround)); ! } return true; } ! else ! { tcSensorDBObject::Serialize(file,mbLoad,anVersion); ! if (mbLoad) ! { file.Read(&mfMinRange_km,sizeof(mfMinRange_km)); file.Read(&mfERP_dBW,sizeof(mfERP_dBW)); *************** *** 91,96 **** file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); } ! else { file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); file.Write(&mfERP_dBW,sizeof(mfERP_dBW)); --- 94,101 ---- file.Read(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Read(&mbDetectsAir,sizeof(mbDetectsAir)); + file.Read(&mbDetectsGround,sizeof(mbDetectsGround)); } ! else ! { file.Write(&mfMinRange_km,sizeof(mfMinRange_km)); file.Write(&mfERP_dBW,sizeof(mfERP_dBW)); *************** *** 98,101 **** --- 103,107 ---- file.Write(&mbDetectsSurface,sizeof(mbDetectsSurface)); file.Write(&mbDetectsAir,sizeof(mbDetectsAir)); + file.Write(&mbDetectsGround,sizeof(mbDetectsGround)); } return true; *************** *** 118,121 **** --- 124,128 ---- *csv >> val; mbDetectsSurface = val != 0; *csv >> val; mbDetectsAir = val != 0; + *csv >> val; mbDetectsGround = val != 0; } else *************** *** 129,132 **** --- 136,140 ---- *csv << (long)mbDetectsSurface; *csv << (long)mbDetectsAir; + *csv << (long)mbDetectsGround; csv->WriteLine(); } *************** *** 153,156 **** --- 161,165 ---- localNode->SetAttribute("detectsSurface", (int)mbDetectsSurface); localNode->SetAttribute("detectsAir", (int)mbDetectsAir); + localNode->SetAttribute("detectsGround", (int)mbDetectsGround); tcSensorDBObject::SerializeXml(node, load); *************** *** 169,172 **** --- 178,182 ---- *csv << "DetectsSurface"; *csv << "DetectsAir"; + *csv << "DetectsGround"; csv->WriteLine(); *************** *** 187,190 **** --- 197,201 ---- mbDetectsSurface = true; mbDetectsAir = true; + mbDetectsGround = true; isSemiactive = false; isCommandReceiver = false; *************** *** 199,203 **** mfMinRangeRate_mps = obj.mfMinRangeRate_mps; mbDetectsSurface = obj.mbDetectsSurface; ! mbDetectsAir = obj.mbDetectsAir; isSemiactive = obj.isSemiactive; isCommandReceiver = obj.isCommandReceiver; --- 210,215 ---- mfMinRangeRate_mps = obj.mfMinRangeRate_mps; mbDetectsSurface = obj.mbDetectsSurface; ! mbDetectsAir = obj.mbDetectsAir; ! mbDetectsGround = obj.mbDetectsGround; isSemiactive = obj.isSemiactive; isCommandReceiver = obj.isCommandReceiver; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:53:12
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28653/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtensionB.cpp tcSimPythonInterface.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcPlatformInterface.cpp 18 Jul 2004 03:18:01 -0000 1.24 --- tcPlatformInterface.cpp 19 Jul 2004 00:53:01 -0000 1.25 *************** *** 120,123 **** --- 120,136 ---- } + /** + * Get terrain elevation for (lon_rad, lat_rad). Over water this + * returns a negative number for water depth. + * @return terrain elevation in meters + */ + float tcPlatformInterface::GetMapTerrainElevation(float lon_rad, float lat_rad) + { + wxASSERT(mapData); + + return mapData->GetTerrainHeight(lon_rad * C_180OVERPI, lat_rad * C_180OVERPI, + mpSimState->GetTime()); + } + /** * Get terrain elevation for current position. Over water this *************** *** 268,280 **** return false; } ! if ((track.mnClassification & PTYPE_SURFACE)&&(info.mnTargetFlags & SURFACE_TARGET)) { return true; } ! if ((track.mnClassification & PTYPE_AIR)&&(info.mnTargetFlags & AIR_TARGET)) { return true; } ! if ((track.mnClassification & PTYPE_MISSILE)&&(info.mnTargetFlags & MISSILE_TARGET)) { return true; } return false; } --- 281,300 ---- return false; } ! if ((track.mnClassification & PTYPE_SURFACE)&&(info.mnTargetFlags & SURFACE_TARGET)) ! { return true; } ! if ((track.mnClassification & PTYPE_AIR)&&(info.mnTargetFlags & AIR_TARGET)) ! { return true; } ! if ((track.mnClassification & PTYPE_MISSILE)&&(info.mnTargetFlags & MISSILE_TARGET)) ! { return true; } + if ((track.mnClassification & PTYPE_FIXED)&&(info.mnTargetFlags & LAND_TARGET)) + { + return true; + } return false; } *************** *** 453,461 **** } ! void tcPlatformInterface::SendDatumToLauncher(float afLon_rad, float afLat_rad, int anLauncher) { ! tcPoint p; ! p.x = afLon_rad; ! p.y = afLat_rad; mpPlatformObj->DesignateLauncherDatum(p, anLauncher); } --- 473,483 ---- } ! void tcPlatformInterface::SendDatumToLauncher(float afLon_rad, float afLat_rad, ! float alt_m, int anLauncher) { ! tsGeoPoint p; ! p.mfLon_rad = afLon_rad; ! p.mfLat_rad = afLat_rad; ! p.mfAlt_m = alt_m; mpPlatformObj->DesignateLauncherDatum(p, anLauncher); } *************** *** 914,918 **** tcSoundConsole* tcPlatformInterface::mpConsole = NULL; tcCommandQueue* tcPlatformInterface::mpCommandQueue = NULL; ! } --- 936,940 ---- tcSoundConsole* tcPlatformInterface::mpConsole = NULL; tcCommandQueue* tcPlatformInterface::mpCommandQueue = NULL; ! tcMapData* tcPlatformInterface::mapData = NULL; } Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcSimPythonInterface.cpp 18 Jul 2004 03:18:01 -0000 1.14 --- tcSimPythonInterface.cpp 19 Jul 2004 00:53:01 -0000 1.15 *************** *** 177,180 **** --- 177,181 ---- void tcSimPythonInterface::AttachMapData(tcMapData *md) { + tcPlatformInterface::AttachMapData(md); tcScenarioInterface::AttachMapData(md); } Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcPlatformInterfaceExtensionB.cpp 18 Jul 2004 03:18:01 -0000 1.11 --- tcPlatformInterfaceExtensionB.cpp 19 Jul 2004 00:53:01 -0000 1.12 *************** *** 60,63 **** --- 60,64 ---- .def("GetRangeToDatum",&tcPlatformInterface::GetRangeToDatum) .def("GetTerrainElevation",&tcPlatformInterface::GetTerrainElevation) + .def("GetMapTerrainElevation",&tcPlatformInterface::GetMapTerrainElevation) .def("HasThrottle",&tcPlatformInterface::HasThrottle) .def("SetAlt", &tcPlatformInterface::SetAltitude) |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:53:11
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28653/src/common Modified Files: simmath.cpp Log Message: Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** simmath.cpp 8 May 2004 21:25:25 -0000 1.11 --- simmath.cpp 19 Jul 2004 00:53:00 -0000 1.12 *************** *** 422,425 **** --- 422,457 ---- return tclosest; } + + /** + * Calculates the ground impact point (lon_rad, lat_rad) + * assuming constant velocity motion to impact. + * This has not been tested. + * + * @param terrainHeight_m assumed terrain height in meters + * @param lon_rad longitude in radians of impact point + * @param lat_rad latitude in radians of impact point + * @return time of impact in seconds, negative indicates past + */ + float tcKinematics::CalculateGroundImpactPoint(float terrainHeight_m, + double& lon_rad, double& lat_rad) + { + + float dz = terrainHeight_m - mfAlt_m; + float v = C_KTSTOMPS*mfSpeed_kts; + float vz = v*sinf(mfPitch_rad); + + float timpact = dz / vz; + + float cospitch = cosf(mfPitch_rad); + float k = C_MTORAD * timpact * v * cospitch; + float dlon = k * sinf(mfHeading_rad) / cosf(mfLat_rad); + float dlat = k * cosf(mfHeading_rad); + + lon_rad = mfLon_rad + dlon; + lat_rad = mfLat_rad + dlat; + + return timpact; + } + // returns radian heading to track float tcKinematics::HeadingToTrack(const tcTrack& track) { |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:52:39
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28586/include/scriptinterface Modified Files: tcPlatformInterface.h Log Message: Index: tcPlatformInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcPlatformInterface.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcPlatformInterface.h 18 Jul 2004 03:18:00 -0000 1.21 --- tcPlatformInterface.h 19 Jul 2004 00:52:26 -0000 1.22 *************** *** 109,112 **** --- 109,114 ---- /// gets current heading in radians float GetHeadingRad(); + /// gets height of terrain in meters at (lon, lat) + float GetMapTerrainElevation(float lon_rad, float lat_rad); /// gets height of terrain under platform in meters float GetTerrainElevation(); *************** *** 183,187 **** int GetLauncherCount(void); /// sets datum for launcher ! void SendDatumToLauncher(float afLon_rad, float afLat_rad, int anLauncher); /// hands off platform target to launcher bool HandoffTargetToLauncher(int anLauncher); --- 185,189 ---- int GetLauncherCount(void); /// sets datum for launcher ! void SendDatumToLauncher(float afLon_rad, float afLat_rad, float alt_m, int anLauncher); /// hands off platform target to launcher bool HandoffTargetToLauncher(int anLauncher); *************** *** 281,284 **** --- 283,287 ---- static void AttachSimState(tcSimState *apSS) {mpSimState = apSS;} static void AttachConsole(tcSoundConsole *apConsole) {mpConsole = apConsole;} + static void AttachMapData(tcMapData* md) {mapData = md;} void GetSensorMap(void); private: *************** *** 290,293 **** --- 293,297 ---- static tcSoundConsole *mpConsole; static tcCommandQueue *mpCommandQueue; // for requesting GUI commands + static tcMapData* mapData; ///< for getting terrain elevation }; } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:52:38
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28586/include/database Modified Files: tcMissileDBObject.h tcRadarDBObject.h Log Message: Index: tcRadarDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcRadarDBObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcRadarDBObject.h 28 Mar 2004 23:12:27 -0000 1.7 --- tcRadarDBObject.h 19 Jul 2004 00:52:26 -0000 1.8 *************** *** 45,49 **** bool mbDetectsSurface; ///< set true if detects surface targets bool mbDetectsAir; ///< set true if detects airborne targets ! float mfGrowth[8]; ///< growth fields (TODO delete, but make sure nothing breaks!) virtual const char* GetClassName() {return "Radar";} ///< returns class name of database object --- 45,49 ---- bool mbDetectsSurface; ///< set true if detects surface targets bool mbDetectsAir; ///< set true if detects airborne targets ! bool mbDetectsGround; ///< set true if detects ground targets virtual const char* GetClassName() {return "Radar";} ///< returns class name of database object Index: tcMissileDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcMissileDBObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcMissileDBObject.h 28 Mar 2004 23:12:27 -0000 1.8 --- tcMissileDBObject.h 19 Jul 2004 00:52:26 -0000 1.9 *************** *** 33,50 **** namespace Database { ! ! typedef enum _damagetype { DT_GENERIC ! } teDamageType; ! typedef enum _altitudemode { ! AM_ASL, ///< sea level reference ! AM_AGL, ///< terrain reference (altimeter) ! AM_INTERCEPT ///< set altitude to intercept if locked on ! } teAltitudeMode; ! typedef enum _guidancemode { GM_COMMAND = 0, ///< command guidance --- 33,65 ---- namespace Database { ! /** ! * This isn't used currently. Notionally there will be different ! * damage types that have varying effectiveness vs. different ! * target types. ! */ ! enum teDamageType { DT_GENERIC ! }; ! /** ! * teAltitudeMode determines how altitude is controlled for flight segment. ! */ ! enum teAltitudeMode { ! /// sea level reference ! AM_ASL = 0, ! /// terrain reference (altimeter) ! AM_AGL = 1, ! /// set altitude to intercept if seeker has track, otherwise maintain altitude ! AM_INTERCEPT = 2, ! /// set altitude to impact datum ! AM_DATUM = 3 ! }; ! /** ! * teGuidanceMode determines guidance type that is used flight segment. ! */ ! enum teGuidanceMode { GM_COMMAND = 0, ///< command guidance *************** *** 53,59 **** GM_SENSOR2 = 3, ///< use secondary sensor GM_SENSORALL = 4 ///< use all sensors, not supported ! } teGuidanceMode; ! typedef struct _missileflightsegment { float mfRange_km; ///< min range for this segment --- 68,77 ---- GM_SENSOR2 = 3, ///< use secondary sensor GM_SENSORALL = 4 ///< use all sensors, not supported ! }; ! /** ! * Info that controls missile behavior for flight segment. ! */ ! struct tsMissileFlightSegment { float mfRange_km; ///< min range for this segment *************** *** 61,68 **** teAltitudeMode meAltitudeMode; ///< altitude mode teGuidanceMode meGuidanceMode; ///< guidance mode ! } tsMissileFlightSegment; #define MAX_MISSILE_FLIGHT_SEGMENTS 8 enum teWeaponLaunchMode { --- 79,89 ---- teAltitudeMode meAltitudeMode; ///< altitude mode teGuidanceMode meGuidanceMode; ///< guidance mode ! }; #define MAX_MISSILE_FLIGHT_SEGMENTS 8 + /** + * Requirements for weapon launch + */ enum teWeaponLaunchMode { |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:52:38
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28586/include/graphics Modified Files: tc3DTerrain.h tcTerrainTextureFactory.h Log Message: Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DTerrain.h 14 May 2004 23:37:06 -0000 1.10 --- tc3DTerrain.h 19 Jul 2004 00:52:26 -0000 1.11 *************** *** 51,54 **** --- 51,55 ---- void AttachMapData(tcMapData *pMapData) {mapData=pMapData;} float GetElevation(float x, float y); + float GetOriginElevation(); osg::ref_ptr<osg::Node> GetTerrainNode(); void SetGameTime(double t) {gameTime = t;} Index: tcTerrainTextureFactory.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcTerrainTextureFactory.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcTerrainTextureFactory.h 14 May 2004 23:37:06 -0000 1.3 --- tcTerrainTextureFactory.h 19 Jul 2004 00:52:26 -0000 1.4 *************** *** 79,82 **** --- 79,83 ---- osg::ref_ptr<osg::Image> mountainTexture; Demeter::Texture *defaultTexture; + Demeter::Texture *defaultTextureLand; // workaround to show land texture for default over land struct { |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:52:38
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28586/include/common Modified Files: simmath.h Log Message: Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** simmath.h 18 Jul 2004 03:17:59 -0000 1.14 --- simmath.h 19 Jul 2004 00:52:26 -0000 1.15 *************** *** 169,172 **** --- 169,173 ---- float CalculateCollisionPoint(const tcKinematics& collider, float& dxi, float& dyi, float& dzi); + float CalculateGroundImpactPoint(float terrainHeight_m, double& lon_rad, double& lat_rad); void Clear() {mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; mfHeading_rad=0;mfClimbAngle_rad=0;mfSpeed_kts=0; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-19 00:52:38
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28586/include/sim Modified Files: tcGameObject.h tcLauncherState.h tcMapView.h tcMissileObject.h tcPlatformObject.h tcSimState.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcGameObject.h 18 Jul 2004 03:18:00 -0000 1.21 --- tcGameObject.h 19 Jul 2004 00:52:27 -0000 1.22 *************** *** 46,49 **** --- 46,50 ---- class tcCreateStream; class tcUpdateStream; + class tcLauncher; /** *************** *** 137,145 **** virtual void UpdateEffects(); virtual void DesignateDatum(tcPoint p) {} ! virtual void DesignateLauncherDatum(tcPoint p, unsigned int anLauncher) {} virtual bool DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher) {return false;} virtual void DesignateTarget(long anID) {} virtual void GetDatum(tsGeoPoint& p) {} ! virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=NULL;} float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} --- 138,147 ---- virtual void UpdateEffects(); virtual void DesignateDatum(tcPoint p) {} ! virtual void DesignateLauncherDatum(tsGeoPoint p, unsigned int anLauncher) {} virtual bool DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher) {return false;} virtual void DesignateTarget(long anID) {} virtual void GetDatum(tsGeoPoint& p) {} ! virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState = NULL;} ! virtual tcLauncher* GetLauncher(unsigned idx) {return 0;} float GetTerrainElevation() {return mcTerrain.mfHeight_m;} virtual void Launch(tnPoolIndex& rnKey, unsigned& rnLauncher) {} Index: tcMissileObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMissileObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcMissileObject.h 4 Jun 2004 21:39:22 -0000 1.9 --- tcMissileObject.h 19 Jul 2004 00:52:27 -0000 1.10 *************** *** 44,49 **** --- 44,53 ---- float mfGoalSpeed_kts; double mfInterceptTime; + + // are all 3 of these necessary? needs refactoring float mfLastGuidanceUpdate; + double guidanceStatusTime; float mfGuidanceUpdateInterval; + tsGeoPoint msWaypoint; // nav datum float mfRangeToObjective_km; // for segment determination *************** *** 54,57 **** --- 58,62 ---- void Clear(void); + void LaunchFrom(tcGameObject* obj, unsigned nLauncher); void RandInitNear(float afLon_deg, float afLat_deg); virtual void Update(double afStatusTime); *************** *** 74,77 **** --- 79,87 ---- tcMissileObject(tcMissileDBObject *obj); ~tcMissileObject(); + + private: + teAltitudeMode GetCurrentAltitudeMode(); + teGuidanceMode GetCurrentGuidanceMode(); + }; #endif \ No newline at end of file Index: tcLauncherState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncherState.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcLauncherState.h 24 May 2004 00:14:46 -0000 1.7 --- tcLauncherState.h 19 Jul 2004 00:52:27 -0000 1.8 *************** *** 84,87 **** --- 84,88 ---- void AddFullLauncher(tnPoolIndex anKey, float azimuth_rad); const char* GetFireControlSensorClass(unsigned nLauncher) const; + tcLauncher* GetLauncher(unsigned int nLauncher); const tcLauncher* GetLauncher(unsigned nLauncher) const; const char* GetLauncherChildClass(unsigned nLauncher) const; *************** *** 108,112 **** void SetFireControlSensor(unsigned nLauncher, tcRadar* radar, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); ! bool SetLauncherDatum(unsigned nLauncher, double lon_rad, double lat_rad); bool SetLauncherTarget(unsigned nLauncher, long targetID); void SetParent(tcGameObject *obj) {parent = obj;} --- 109,114 ---- void SetFireControlSensor(unsigned nLauncher, tcRadar* radar, unsigned sensorIdx); int SetLaunch(int nLauncher, int quantity); ! bool SetLauncherDatum(unsigned nLauncher, ! double lon_rad, double lat_rad, float alt_m); bool SetLauncherTarget(unsigned nLauncher, long targetID); void SetParent(tcGameObject *obj) {parent = obj;} Index: tcPlatformObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPlatformObject.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcPlatformObject.h 24 May 2004 00:14:46 -0000 1.17 --- tcPlatformObject.h 19 Jul 2004 00:52:27 -0000 1.18 *************** *** 85,94 **** virtual void Clear(); virtual void DesignateDatum(tcPoint p); ! virtual void DesignateLauncherDatum(tcPoint p, unsigned int anLauncher); virtual bool DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher); virtual void DesignateTarget(long anID); virtual void GetDatum(tsGeoPoint& p) {p=msTargetDatum;} virtual int GetLauncherQuantity(unsigned anLauncher); virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} unsigned GetSensorCount() const; // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); --- 85,96 ---- virtual void Clear(); virtual void DesignateDatum(tcPoint p); ! virtual void DesignateLauncherDatum(tsGeoPoint p, unsigned int anLauncher); virtual bool DesignateLauncherTarget(tnPoolIndex anID, unsigned anLauncher); virtual void DesignateTarget(long anID); virtual void GetDatum(tsGeoPoint& p) {p=msTargetDatum;} + virtual tcLauncher* GetLauncher(unsigned idx); virtual int GetLauncherQuantity(unsigned anLauncher); virtual void GetLauncherState(tcLauncherState*& pLauncherState) {pLauncherState=&mcLauncherState;} + unsigned GetSensorCount() const; // virtual void GetSensorState(tcSensorState** aapSensorState, int& rnCount); Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tcSimState.h 24 May 2004 00:14:46 -0000 1.24 --- tcSimState.h 19 Jul 2004 00:52:27 -0000 1.25 *************** *** 62,65 **** --- 62,66 ---- class tcGoalTracker; class tcStream; + class tcMissileObject; #define N_GAME_OBJECTS 1024 *************** *** 103,107 **** static tcSimState* Get(); ///< accessor for singleton instance ! void AddLaunchedPlatform(long anNewKey, tcGameObject *plaunchingplatform, unsigned anLauncher); void AddPlatform(tcGameObject *pplat); void AddPlatformWithKey(tcGameObject *pplat, tnPoolIndex key); --- 104,108 ---- static tcSimState* Get(); ///< accessor for singleton instance ! void AddLaunchedPlatform(long newKey, tcGameObject* launchingPlatform, unsigned nLauncher); void AddPlatform(tcGameObject *pplat); void AddPlatformWithKey(tcGameObject *pplat, tnPoolIndex key); *************** *** 126,130 **** void DesignateTarget(long anKey, long anTargetKey); void DesignateDatum(long anKey, tcPoint p); ! void DesignateLauncherDatum(tnPoolIndex anKey, tcPoint p, unsigned anLauncher); bool DesignateLauncherTarget(tnPoolIndex anKey, tnPoolIndex anTargetKey, unsigned anLauncher); void GenerateRandomGoals(); --- 127,131 ---- void DesignateTarget(long anKey, long anTargetKey); void DesignateDatum(long anKey, tcPoint p); ! void DesignateLauncherDatum(tnPoolIndex anKey, tsGeoPoint p, unsigned anLauncher); bool DesignateLauncherTarget(tnPoolIndex anKey, tnPoolIndex anTargetKey, unsigned anLauncher); void GenerateRandomGoals(); *************** *** 189,194 **** DateZulu dateZulu; MultiplayerMode multiplayerMode; ///< multiplayer mode, default = MM_OFF ! long timeAcceleration; ///< 0 - paused, 1 - normal, N - Nx accelerated time float GetFractionalDamage(float afDamage, tcGameObject *apGameObj); bool IsDetectedESM(tcESMSensor* apESM, const tcRadar* apEmitterRadar, float& rfAz_rad); --- 190,197 ---- DateZulu dateZulu; MultiplayerMode multiplayerMode; ///< multiplayer mode, default = MM_OFF ! long timeAcceleration; ///< 0 - paused, 1 - normal, N - Nx accelerated time + void EvaluateGuidedMissileHit(tcMissileObject* missile, tcGameObject* target); + void EvaluateImpactMissileHit(tcMissileObject* missile); float GetFractionalDamage(float afDamage, tcGameObject *apGameObj); bool IsDetectedESM(tcESMSensor* apESM, const tcRadar* apEmitterRadar, float& rfAz_rad); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcMapView.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcMapView.h 24 Jun 2004 21:35:40 -0000 1.21 --- tcMapView.h 19 Jul 2004 00:52:27 -0000 1.22 *************** *** 330,340 **** Gdiplus::Image* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); Gdiplus::Image* LoadSymbolImage(char *azSymbolName); void DrawNTDSSurface(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSAirFW(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSAirRW(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSMissile(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSUnknown(Gdiplus::Graphics *apGraphics, teAffiliation affil); int DrawSymbol(Gdiplus::Graphics *apGraphics, tcMapObj *pMO); ! int DrawSymbol2(Gdiplus::Graphics *apGraphics, tcMapObj *pMO); --- 330,343 ---- Gdiplus::Image* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); Gdiplus::Image* LoadSymbolImage(char *azSymbolName); + void DrawNTDSSurface(Gdiplus::Graphics *apGraphics, teAffiliation affil); + void DrawNTDSGround(Gdiplus::Graphics* graphics, teAffiliation affil); void DrawNTDSAirFW(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSAirRW(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSMissile(Gdiplus::Graphics *apGraphics, teAffiliation affil); void DrawNTDSUnknown(Gdiplus::Graphics *apGraphics, teAffiliation affil); + int DrawSymbol(Gdiplus::Graphics *apGraphics, tcMapObj *pMO); ! int DrawSymbol2(Gdiplus::Graphics* graphics, tcMapObj* pMO); |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:38
|
Update of /cvsroot/gcblue/gcb_wx/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/docs Modified Files: CHANGES.txt Log Message: Index: CHANGES.txt =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/docs/CHANGES.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** CHANGES.txt 10 Jul 2004 01:51:15 -0000 1.25 --- CHANGES.txt 18 Jul 2004 03:17:59 -0000 1.26 *************** *** 3,6 **** --- 3,15 ---- 0.6 --------------------------------------------------------------------- + *** 2004-07-17 Dewitt Colclough *** + - Made more detailed landing data available through script interface. + This allows aircraft to land at precise runway location (vs. landing + in the middle of the airfield somewhere). + - Added airfield simulation obj, extracted flight operations code into + tcFlightOpsObject base class + - Fixed graphics glitch that sometimes occurred during activation of + flight panel display. + *** 2004-07-09 Dewitt Colclough *** - Added display frequency to display mode code. Before the game would |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:38
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** GCblue.vcproj 24 Jun 2004 01:43:43 -0000 1.56 --- GCblue.vcproj 18 Jul 2004 03:17:58 -0000 1.57 *************** *** 344,347 **** --- 344,350 ---- </File> <File + RelativePath=".\src\sim\tcAirfieldObject.cpp"> + </File> + <File RelativePath="src\sim\tcAirObject.cpp"> </File> *************** *** 380,383 **** --- 383,389 ---- </File> <File + RelativePath=".\src\sim\tcFlightOpsObject.cpp"> + </File> + <File RelativePath="src\sim\tcFlightPort.cpp"> </File> *************** *** 744,747 **** --- 750,756 ---- </File> <File + RelativePath=".\include\sim\tcAirfieldObject.h"> + </File> + <File RelativePath="include\sim\tcAirObject.h"> </File> *************** *** 780,783 **** --- 789,795 ---- </File> <File + RelativePath=".\include\sim\tcFlightOpsObject.h"> + </File> + <File RelativePath="include\sim\tcFlightPort.h"> </File> |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:12
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/src/sim Modified Files: Game.cpp tc3DViewer.cpp tcCarrierObject.cpp tcFlightOpsObject.cpp tcFlightPort.cpp tcGameObject.cpp tcPlatformObject.cpp tcSimState.cpp Added Files: tcAirfieldObject.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** tcSimState.cpp 24 May 2004 00:14:47 -0000 1.44 --- tcSimState.cpp 18 Jul 2004 03:18:01 -0000 1.45 *************** *** 35,38 **** --- 35,39 ---- #include "tcMissileObject.h" #include "tcAirObject.h" + #include "tcAirfieldObject.h" #include "tcAeroAirObject.h" #include "tcLauncher.h" *************** *** 1008,1012 **** tnPoolIndex nKey; maPlatformState.GetNextAssoc(pos,nKey,gameObj); ! if (dynamic_cast<tcCarrierObject*>(gameObj)) { flightportPlatforms.push_back(gameObj->mnID); --- 1009,1013 ---- tnPoolIndex nKey; maPlatformState.GetNextAssoc(pos,nKey,gameObj); ! if (dynamic_cast<tcFlightOpsObject*>(gameObj)) { flightportPlatforms.push_back(gameObj->mnID); *************** *** 1257,1260 **** --- 1258,1262 ---- /** + * Factory method to create new objects from a database object. * Recently reworked this so that game objects initialize themselves. */ *************** *** 1282,1285 **** --- 1284,1291 ---- return new tcCarrierObject(pGenericData); } + else if (apDBObject->mnModelType == MTYPE_AIRFIELD) + { + return new tcAirfieldObject(pGenericData); + } else { *************** *** 1512,1522 **** float range = landing_unit->mcKin.RangeToKmAlt(receiver->mcKin); bool notClimbing = landing_unit->mcKin.mfClimbAngle_rad < 0.01f; ! if ((range < 0.3f)&&(notClimbing)&&(air->readyForLanding)) { ! if (tcCarrierObject *carrier = dynamic_cast<tcCarrierObject*>(receiver)) { // save key since AddChild can be called from CheckLanding, replaces mnID tnPoolIndex key = landing_unit->mnID; ! if (carrier->CheckLanding(landing_unit)==1) // if landing is successful { // remove child model from parent to allow repositioning in scenegraph --- 1518,1529 ---- float range = landing_unit->mcKin.RangeToKmAlt(receiver->mcKin); bool notClimbing = landing_unit->mcKin.mfClimbAngle_rad < 0.01f; ! ! if ((range < 0.8f)&&(notClimbing)&&(air->readyForLanding)) { ! if (tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(receiver)) { // save key since AddChild can be called from CheckLanding, replaces mnID tnPoolIndex key = landing_unit->mnID; ! if (flightOps->CheckLanding(landing_unit) == 1) // if landing is successful { // remove child model from parent to allow repositioning in scenegraph Index: tcFlightOpsObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightOpsObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightOpsObject.cpp 13 Jul 2004 23:28:02 -0000 1.1 --- tcFlightOpsObject.cpp 18 Jul 2004 03:18:01 -0000 1.2 *************** *** 23,26 **** --- 23,27 ---- #include "tcFlightOpsObject.h" + #include "tcGameObject.h" #include "tcAirObject.h" #include "tcAeroAirObject.h" *************** *** 28,34 **** #include "tcFlightportDBObject.h" ! /******************************************************************************/ ! /****************************** tcFlightOpsObject *******************************/ ! /******************************************************************************/ /** --- 29,33 ---- #include "tcFlightportDBObject.h" ! Database::tcDatabase* tcFlightOpsObject::database = 0; /** *************** *** 42,50 **** int tcFlightOpsObject::CheckLanding(tcGameObject *obj) { ! GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate int result = flight_deck.CheckLanding(obj); if (result == 1) { ! AddChild(obj); } return result; --- 41,49 ---- int tcFlightOpsObject::CheckLanding(tcGameObject *obj) { ! gameObj->GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate int result = flight_deck.CheckLanding(obj); if (result == 1) { ! gameObj->AddChild(obj); } return result; *************** *** 53,61 **** void tcFlightOpsObject::Clear() { - tcSurfaceObject::Clear(); flight_deck.Clear(); } /** * Supports aero air model and air generic models. Adding other * model types will fail. --- 52,75 ---- void tcFlightOpsObject::Clear() { flight_deck.Clear(); } /** + * @return pointer to flight_deck + */ + tcFlightPort* tcFlightOpsObject::GetFlightPort() + { + return &flight_deck; + } + + /** + * @return track with landing point coord and heading with orientation + */ + tcTrack tcFlightOpsObject::GetLandingData() + { + return flight_deck.GetLandingData(gameObj); + } + + /** * Supports aero air model and air generic models. Adding other * model types will fail. *************** *** 67,85 **** tcGameObject *child = NULL; // object to add to flight_deck ! tcDatabaseObject *dbObj = database->GetObject(className); ! if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj)) ! { ! child = new tcAeroAirObject(airDBObj); ! } ! else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(dbObj)) ! { ! if (genericDBObj->mnModelType == MTYPE_FIXEDWING) ! { ! child = new tcAirObject(genericDBObj); } else { ! std::cerr << "Attempted to add non-air generic object type to carrier: " << className << "\n"; return false; --- 81,99 ---- tcGameObject *child = NULL; // object to add to flight_deck ! tcDatabaseObject *dbObj = database->GetObject(className); ! if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj)) ! { ! child = new tcAeroAirObject(airDBObj); ! } ! else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(dbObj)) ! { ! if (genericDBObj->mnModelType == MTYPE_FIXEDWING) ! { ! child = new tcAirObject(genericDBObj); } else { ! std::cerr << "Attempted to add non-air generic object type to FO obj: " << className << "\n"; return false; *************** *** 88,92 **** else { ! std::cerr << "Attempted to add non-air object type to carrier: " << className << "\n"; return false; --- 102,106 ---- else { ! std::cerr << "Attempted to add non-air object type to FO obj: " << className << "\n"; return false; *************** *** 94,122 **** child->mzUnit = unitName.c_str(); ! child->mnAlliance = mnAlliance; child->SetRelativePosition(0,0,0); child->SetRelativeOrientation(0,0,0); ! AddChild(child); // add child to carrier object flight_deck.AddObject(child, loc); // add child to flight_deck return true; } ! /******************************************************************************/ ! void tcFlightOpsObject::RandInitNear(float afLon_deg, float afLat_deg) { // tcGameObject::RandInitNear(afLon,afLat); // why can't we call base here ? virtual issue? ! if (mpDBObject == NULL) {return;} ! strcpy(mzClass.mz,mpDBObject->mzClass.mz); ! mzUnit = "CV_"; ! mzUnit.AssignRandomSuffix(); ! mnAlliance = 0; ! mfStatusTime = 0; ! mcKin.mfLon_rad = C_PIOVER180*(afLon_deg + randfc(1.1f)); ! mcKin.mfLat_rad = C_PIOVER180*(afLat_deg + randfc(1.1f)); ! mcKin.mfAlt_m = 0.0f; ! mcKin.mfHeading_rad = C_TWOPI*randf(); ! mcKin.mfSpeed_kts = mpDBObject->mfMaxSpeed_kts; ! mfDamageLevel = 0; ! mcGS.SetHeading(mcKin.mfHeading_rad); ! mcGS.SetSpeed(mcKin.mfSpeed_kts); ! mcGS.SetAltitude(mcKin.mfAlt_m); int nAircraft = flight_deck.GetHangarCapacity(); --- 108,126 ---- child->mzUnit = unitName.c_str(); ! child->mnAlliance = gameObj->mnAlliance; child->SetRelativePosition(0,0,0); child->SetRelativeOrientation(0,0,0); ! gameObj->AddChild(child); // add child to flight ops object flight_deck.AddObject(child, loc); // add child to flight_deck return true; } ! ! /** ! * Randomly initializes object ! */ ! void tcFlightOpsObject::RandInitNear(float afLon_deg, float afLat_deg) ! { // tcGameObject::RandInitNear(afLon,afLat); // why can't we call base here ? virtual issue? ! if (gameObj->mpDBObject == NULL) {return;} int nAircraft = flight_deck.GetHangarCapacity(); *************** *** 136,140 **** child->SetRelativePosition(7.5,12.0,z); child->SetRelativeOrientation(0,0,0); ! AddChild(child); flight_deck.AddObject(child, LAUNCH); } --- 140,144 ---- child->SetRelativePosition(7.5,12.0,z); child->SetRelativeOrientation(0,0,0); ! gameObj->AddChild(child); flight_deck.AddObject(child, LAUNCH); } *************** *** 143,167 **** } ! /******************************************************************************/ ! void tcFlightOpsObject::PrintToFile(tcFile& file) { ! tcSurfaceObject::PrintToFile(file); ! } ! /******************************************************************************/ ! void tcFlightOpsObject::SaveToFile(tcFile& file) { ! tcSurfaceObject::SaveToFile(file); ! } ! /******************************************************************************/ ! void tcFlightOpsObject::LoadFromFile(tcFile& file) { ! tcSurfaceObject::LoadFromFile(file); ! } ! /******************************************************************************/ ! void tcFlightOpsObject::Serialize(tcFile& file, bool mbLoad) { ! if (mbLoad) { ! LoadFromFile(file); ! } ! else { ! SaveToFile(file); ! } } /** * Set up default spots and capacities for carrier flightport. --- 147,159 ---- } ! /** ! * Print state info to text file for debug ! */ ! void tcFlightOpsObject::PrintToFile(tcFile& file) ! { ! } + + /** * Set up default spots and capacities for carrier flightport. *************** *** 170,174 **** { flight_deck.Clear(); ! flight_deck.SetParent(this); flight_deck.AddSpot(LAUNCH, -7.5, 16.0f, 18.8f, 0.03f); --- 162,166 ---- { flight_deck.Clear(); ! flight_deck.SetParent(gameObj); flight_deck.AddSpot(LAUNCH, -7.5, 16.0f, 18.8f, 0.03f); *************** *** 186,190 **** void tcFlightOpsObject::Update(double afStatusTime) { - tcSurfaceObject::Update(afStatusTime); flight_deck.Update(afStatusTime); UpdateLaunch(); --- 178,181 ---- *************** *** 200,208 **** int nLaunch = (int)flight_deck.toLaunch.size(); if (nLaunch==0) return; ! for(int n=0;n<nLaunch;n++) { tcGameObject *object_to_launch = flight_deck.toLaunch[n]; ! toLaunch.push_back(object_to_launch); ! RemoveChild(object_to_launch); } flight_deck.toLaunch.clear(); --- 191,199 ---- int nLaunch = (int)flight_deck.toLaunch.size(); if (nLaunch==0) return; ! for(int n=0; n < nLaunch; n++) { tcGameObject *object_to_launch = flight_deck.toLaunch[n]; ! gameObj->toLaunch.push_back(object_to_launch); ! gameObj->RemoveChild(object_to_launch); } flight_deck.toLaunch.clear(); *************** *** 215,221 **** //SetFlightportDefaults(); - - mpDBObject = NULL; - mnModelType = MTYPE_CARRIER; } /******************************************************************************/ --- 206,209 ---- *************** *** 233,256 **** * can hold. */ ! tcFlightOpsObject::tcFlightOpsObject(tcGenericDBObject *obj) ! : tcSurfaceObject(obj) { wxASSERT(database); ! mpDBObject = obj; ! ! tcFlightportDBObject* flightportDBObj = dynamic_cast<tcFlightportDBObject*> ! (database->GetObject(obj->flightportClass.mz)); ! wxASSERT(flightportDBObj); ! if (flightportDBObj == NULL) { ! std::cerr << "Flightport database obj not found for carrier obj: "; ! std::cerr << mzUnit.mz << "\n"; return; } ! flight_deck.InitFromDatabase(flightportDBObj); } /******************************************************************************/ ! tcFlightOpsObject::~tcFlightOpsObject() { } \ No newline at end of file --- 221,245 ---- * can hold. */ ! tcFlightOpsObject::tcFlightOpsObject(tcFlightportDBObject* dbObject, tcGameObject* gameObject) ! : gameObj(gameObject) { + wxASSERT(gameObj); + if (database == 0) + { + database = tcDatabase::Get(); + } wxASSERT(database); ! if (dbObject == NULL) { ! std::cerr << "Flightport database obj not found for flight ops obj: "; ! std::cerr << gameObj->mzUnit.mz << "\n"; return; } ! flight_deck.InitFromDatabase(dbObject); } /******************************************************************************/ ! tcFlightOpsObject::~tcFlightOpsObject() ! { } \ No newline at end of file Index: tcFlightPort.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcFlightPort.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcFlightPort.cpp 24 May 2004 00:14:47 -0000 1.7 --- tcFlightPort.cpp 18 Jul 2004 03:18:01 -0000 1.8 *************** *** 146,150 **** float dx = obj->rel_pos.dx - spot->x; float dy = obj->rel_pos.dy - spot->y; ! float dz = obj->rel_pos.dy - spot->z; if ((dx*dx + dz*dz <= 1600.0f)&&(dy < 25.0f)&&(dy > -25.0f)) { --- 146,150 ---- float dx = obj->rel_pos.dx - spot->x; float dy = obj->rel_pos.dy - spot->y; ! float dz = obj->rel_pos.dz - spot->z; if ((dx*dx + dz*dz <= 1600.0f)&&(dy < 25.0f)&&(dy > -25.0f)) { *************** *** 326,329 **** --- 326,367 ---- return &loc_vect->at(spot_idx); } + + /** + * This version returns info for the first runway spot only + * + * @return track with landing point coord and heading with orientation + */ + tcTrack tcFlightPort::GetLandingData(const tcGameObject* obj) + { + tcTrack data; + + int nRunways = (int)launch_spots.size(); + + if (nRunways > 0) + { + tsSpotInfo *spot = &launch_spots.at(0); + + wxASSERT(obj); + tsGeoPoint p = obj->RelPosToLatLonAlt(spot->x, spot->y, spot->z); + + data.mfLat_rad = p.mfLat_rad; + data.mfLon_rad = p.mfLon_rad; + data.mfAlt_m = p.mfAlt_m; + data.mfHeading_rad = spot->orientation + obj->mcKin.mfHeading_rad; + if (data.mfHeading_rad >= C_PI) data.mfHeading_rad -= C_TWOPI; + else if (data.mfHeading_rad < -C_PI) data.mfHeading_rad += C_TWOPI; + + data.mnID = obj->mnID; + + return data; + } + else + { + data.mnID = -1; + return data; + } + + } + //---------------------------------------------------------------------------- /** Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Game.cpp 24 Jun 2004 21:35:41 -0000 1.86 --- Game.cpp 18 Jul 2004 03:18:01 -0000 1.87 *************** *** 1,5 **** /** @file Game.cpp main application class ** ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. ** --- 1,5 ---- /** @file Game.cpp main application class ** ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 98,104 **** /** ! * The tcGame object constructor. ! * ! */ tcGame::tcGame(const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, "Global Conflict", pos, size, wxNO_FULL_REPAINT_ON_RESIZE), // | wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN --- 98,104 ---- /** ! * The tcGame object constructor. ! * ! */ tcGame::tcGame(const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, "Global Conflict", pos, size, wxNO_FULL_REPAINT_ON_RESIZE), // | wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN *************** *** 124,127 **** --- 124,128 ---- simState = tcSimState::Get(); + database = tcDatabase::Get(); glCanvas = new wxGLCanvas(this, -1, wxPoint(0,0), size, 0, "GLCanvas", 0, wxNullPalette); *************** *** 424,437 **** chatBox->MoveToTop(); ! mcDatabase.LoadDBCSV(); // uncomment the SaveDBCSV line to save copy of database to _out suffix, // warning, this erroneously puts a copy of air DB objects into the generic file // need to fix DB obj structure so that only leaf classes are used by game objects ! mcDatabase.SaveDBCSV("_out"); ! mcDatabase.SaveDBXml(""); ! tcGameObject::SetGameObjectDatabase(&mcDatabase); // added to allow objects to init themselves ! simState->AttachDB(&mcDatabase); simState->AttachMapData(&mcMapData); simState->AttachPythonInterface(pythonInterface); --- 425,438 ---- chatBox->MoveToTop(); ! database->LoadDBCSV(); // uncomment the SaveDBCSV line to save copy of database to _out suffix, // warning, this erroneously puts a copy of air DB objects into the generic file // need to fix DB obj structure so that only leaf classes are used by game objects ! database->SaveDBCSV("_out"); ! database->SaveDBXml(""); ! tcGameObject::SetGameObjectDatabase(database); // added to allow objects to init themselves ! simState->AttachDB(database); simState->AttachMapData(&mcMapData); simState->AttachPythonInterface(pythonInterface); *************** *** 441,445 **** pythonInterface->AttachSimState(simState); ! tcLauncherState::mpDatabase = &mcDatabase; /* ** Initialize mcMapData * **/ --- 442,446 ---- pythonInterface->AttachSimState(simState); ! tcLauncherState::mpDatabase = database; /* ** Initialize mcMapData * **/ *************** *** 2013,2018 **** if (s == "ShowFlightPanel") { ! popupControl->Track(wxPoint(mrectMap.left+20,mrectMap.top+70)); popupControl->SetMenu(MENUMODE_FLIGHTPANEL); } } --- 2014,2021 ---- if (s == "ShowFlightPanel") { ! // Freeze() to prevent flicker, not sure why this works ! popupControl->Freeze(); popupControl->SetMenu(MENUMODE_FLIGHTPANEL); + popupControl->Track(wxPoint(mrectMap.left+20,mrectMap.top+70)); } } Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcPlatformObject.cpp 4 Jun 2004 21:39:23 -0000 1.25 --- tcPlatformObject.cpp 18 Jul 2004 03:18:01 -0000 1.26 *************** *** 1,4 **** /** @file tcPlatformObject.cpp ! ** ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,5 ---- /** @file tcPlatformObject.cpp ! */ ! /* ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tc3DViewer.cpp 4 Jun 2004 21:39:22 -0000 1.31 --- tc3DViewer.cpp 18 Jul 2004 03:18:01 -0000 1.32 *************** *** 86,90 **** void tc3DViewer::OnChar(wxKeyEvent& event) { ! event.Skip(); } --- 86,121 ---- void tc3DViewer::OnChar(wxKeyEvent& event) { ! int nChar = event.GetKeyCode(); ! ! ! switch(nChar) ! { ! case 'l': ! if (moveWithTarget) ! { ! SetCameraMode(false, false); ! cameraLookAz = cameraAz + C_PI; ! cameraLookEl = -cameraEl; ! } ! else ! { ! SetCameraMode(true, true); ! } ! break; ! case WXK_UP: ! cameraTargetOffset._v[1] += 1.0f; ! break; ! case WXK_DOWN: ! cameraTargetOffset._v[1] -= 1.0f; ! break; ! case WXK_RIGHT: ! cameraTargetOffset._v[0] += 1.0f; ! break; ! case WXK_LEFT: ! cameraTargetOffset._v[0] -= 1.0f; ! break; ! default: ! event.Skip(); ! } } *************** *** 115,118 **** --- 146,152 ---- azStart = cameraAz; elStart = cameraEl; + + lookAzStart = cameraLookAz; + lookElStart = cameraLookEl; usePolarOffset = true; } *************** *** 139,142 **** --- 173,186 ---- if (cameraEl < -MAX_EL) {cameraEl = -MAX_EL;} else if (cameraEl > MAX_EL) {cameraEl = MAX_EL;} + + + // update mouselook scene panning + cameraLookAz = dAz + lookAzStart; + cameraLookEl = -dEl + lookElStart; + if ( cameraLookAz < 0) { cameraLookAz += C_TWOPI;} + else if ( cameraLookAz > C_TWOPI) {cameraLookAz -= C_TWOPI;} + if (cameraLookEl < -MAX_EL) {cameraLookEl = -MAX_EL;} + else if (cameraLookEl > MAX_EL) {cameraLookEl = MAX_EL;} + } } *************** *** 698,702 **** if (lookAtTarget) { ! cameraTarget = targetPosition; } else --- 742,746 ---- if (lookAtTarget) { ! cameraTarget = targetPosition + cameraTargetOffset; } else *************** *** 1034,1037 **** --- 1078,1084 ---- if (lastHook != hookID) { + SetCameraMode(true, true); + cameraTargetOffset.set(0, 0, 0); + lastHook = hookID; tcGameObject *obj = simState->GetObject(hookID); Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcGameObject.cpp 4 Jun 2004 21:39:23 -0000 1.16 --- tcGameObject.cpp 18 Jul 2004 03:18:01 -0000 1.17 *************** *** 151,154 **** --- 151,180 ---- } + tsGeoPoint tcGameObject::RelPosToLatLonAlt(const tsRelativePosition& rel_pos) const + { + return RelPosToLatLonAlt(rel_pos.dx, rel_pos.dy, rel_pos.dz); + } + + /** + * Looking forward from the object, dx is right, and dz is back + * TODO fix this system to use dx right, dy forward, dz up + */ + tsGeoPoint tcGameObject::RelPosToLatLonAlt(const float& dx, + const float& dy, const float& dz) const + { + tsGeoPoint p; + + float hdg = mcKin.mfHeading_rad; + float cos_hdg = cosf(hdg); + float sin_hdg = sinf(hdg); + + p.mfAlt_m = mcKin.mfAlt_m + dy; + p.mfLon_rad = (C_MTORAD / cosf((float)mcKin.mfLat_rad)) * + (cos_hdg * dx - sin_hdg * dz) + mcKin.mfLon_rad; + p.mfLat_rad = C_MTORAD * (-cos_hdg * dz - sin_hdg * dx) + mcKin.mfLat_rad; + + return p; + } + /** * Index: tcCarrierObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCarrierObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcCarrierObject.cpp 13 Feb 2004 01:31:33 -0000 1.7 --- tcCarrierObject.cpp 18 Jul 2004 03:18:01 -0000 1.8 *************** *** 1,4 **** /* ! ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. --- 1,4 ---- /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 22,102 **** #include "tcAeroAirObject.h" #include "tcAirDBObject.h" ! #include "tcFlightportDBObject.h" - /******************************************************************************/ - /****************************** tcCarrierObject *******************************/ - /******************************************************************************/ - /** - * Determines if obj has landed on runway or crashed into flightport. - * Calls tcFlightPort method. - * If object successfully lands, it is added as a child. - * @param obj Object to attempt landing - * @return -1 if crash, 0 if not close enough for landing, 1 if landed - * @see tcFlightPort::CheckLanding - */ - int tcCarrierObject::CheckLanding(tcGameObject *obj) - { - GetRelPosOf(obj, obj->rel_pos); // set update rel_pos field of landing candidate - int result = flight_deck.CheckLanding(obj); - if (result == 1) - { - AddChild(obj); - } - return result; - } void tcCarrierObject::Clear() { tcSurfaceObject::Clear(); ! flight_deck.Clear(); } /** ! * Supports aero air model and air generic models. Adding other ! * model types will fail. ! * @return true if successful, false otherwise */ ! bool tcCarrierObject::AddChildToFlightDeck(std::string className, std::string unitName, ! teLocation loc) { - tcGameObject *child = NULL; // object to add to flight_deck - - tcDatabaseObject *dbObj = database->GetObject(className); - if (tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj)) - { - - child = new tcAeroAirObject(airDBObj); - } - else if (tcGenericDBObject *genericDBObj = dynamic_cast<tcGenericDBObject*>(dbObj)) - { - if (genericDBObj->mnModelType == MTYPE_FIXEDWING) - { - child = new tcAirObject(genericDBObj); - } - else - { - std::cerr << "Attempted to add non-air generic object type to carrier: " << - className << "\n"; - return false; - } - } - else - { - std::cerr << "Attempted to add non-air object type to carrier: " << - className << "\n"; - return false; - } - - child->mzUnit = unitName.c_str(); - child->mnAlliance = mnAlliance; - child->SetRelativePosition(0,0,0); - child->SetRelativeOrientation(0,0,0); - AddChild(child); // add child to carrier object - flight_deck.AddObject(child, loc); // add child to flight_deck - return true; - } - /******************************************************************************/ - void tcCarrierObject::RandInitNear(float afLon_deg, float afLat_deg) { // tcGameObject::RandInitNear(afLon,afLat); // why can't we call base here ? virtual issue? if (mpDBObject == NULL) {return;} --- 22,40 ---- #include "tcAeroAirObject.h" #include "tcAirDBObject.h" ! #include "tcFlightOpsObject.h" void tcCarrierObject::Clear() { tcSurfaceObject::Clear(); ! tcFlightOpsObject::Clear(); } /** ! * Randomly initializes object */ ! void tcCarrierObject::RandInitNear(float afLon_deg, float afLat_deg) { // tcGameObject::RandInitNear(afLon,afLat); // why can't we call base here ? virtual issue? if (mpDBObject == NULL) {return;} *************** *** 116,218 **** mcGS.SetAltitude(mcKin.mfAlt_m); ! int nAircraft = flight_deck.GetHangarCapacity(); ! for(int i=0;i<nAircraft;i++) ! { ! // add FW air child for test ! tcDatabaseObject *dbObj = database->GetRandomOfType(MTYPE_FIXEDWINGX); ! tcAirDBObject *airDBObj = dynamic_cast<tcAirDBObject*>(dbObj); ! tcAeroAirObject *child = NULL; ! if (airDBObj) child = new tcAeroAirObject(airDBObj); ! wxASSERT(child); ! if (child != NULL) ! { ! child->mzUnit = "AIRX_"; ! child->mzUnit.AssignRandomSuffix(); ! float z = -20.0f + (float)i * 18.0f; ! child->SetRelativePosition(7.5,12.0,z); ! child->SetRelativeOrientation(0,0,0); ! AddChild(child); ! flight_deck.AddObject(child, LAUNCH); ! } ! } } /******************************************************************************/ ! void tcCarrierObject::PrintToFile(tcFile& file) { tcSurfaceObject::PrintToFile(file); } /******************************************************************************/ ! void tcCarrierObject::SaveToFile(tcFile& file) { tcSurfaceObject::SaveToFile(file); } /******************************************************************************/ ! void tcCarrierObject::LoadFromFile(tcFile& file) { tcSurfaceObject::LoadFromFile(file); } /******************************************************************************/ ! void tcCarrierObject::Serialize(tcFile& file, bool mbLoad) { ! if (mbLoad) { LoadFromFile(file); } ! else { SaveToFile(file); } } /** ! * Set up default spots and capacities for carrier flightport. */ - void tcCarrierObject::SetFlightportDefaults() - { - flight_deck.Clear(); - flight_deck.SetParent(this); - - flight_deck.AddSpot(LAUNCH, -7.5, 16.0f, 18.8f, 0.03f); - - flight_deck.AddSpot(READY, 5.0f, 16.0f, 36.25f, -0.5f); - flight_deck.AddSpot(READY, 1.25f, 16.0f, 45.0f, -0.5f); - flight_deck.AddSpot(READY, 7.5f, 16.0f, 60.0f, 0.4f); - flight_deck.AddSpot(READY, 7.5f, 16.0f, 72.5f, 0.4f); - flight_deck.AddSpot(READY, 7.5f, 16.0f, 85.0f, 0.4f); - flight_deck.AddSpot(READY, 7.5f, 16.0f, 97.5f, 0.4f); - - flight_deck.SetHangarCapacity(16); - } - /******************************************************************************/ void tcCarrierObject::Update(double afStatusTime) { tcSurfaceObject::Update(afStatusTime); ! flight_deck.Update(afStatusTime); ! UpdateLaunch(); ! } ! /******************************************************************************/ ! /* Check if flight_deck has an objects in the toLaunch vector. If so, move them ! ** to the tcGameObject::toLaunch vector and delete the matching pointer in the ! ** child list. This is a bit awkward because tcGameObject is holding an object ! ** in its child list that functionally belongs to the flight deck. ! */ ! void tcCarrierObject::UpdateLaunch() ! { ! int nLaunch = (int)flight_deck.toLaunch.size(); ! if (nLaunch==0) return; ! for(int n=0;n<nLaunch;n++) ! { ! tcGameObject *object_to_launch = flight_deck.toLaunch[n]; ! toLaunch.push_back(object_to_launch); ! RemoveChild(object_to_launch); ! } ! flight_deck.toLaunch.clear(); } ! /******************************************************************************/ tcCarrierObject::tcCarrierObject() { Clear(); - //SetFlightportDefaults(); - mpDBObject = NULL; mnModelType = MTYPE_CARRIER; } /******************************************************************************/ /* --- 54,113 ---- mcGS.SetAltitude(mcKin.mfAlt_m); ! tcFlightOpsObject::RandInitNear(afLon_deg, afLat_deg); } /******************************************************************************/ ! void tcCarrierObject::PrintToFile(tcFile& file) ! { tcSurfaceObject::PrintToFile(file); + tcFlightOpsObject::PrintToFile(file); } /******************************************************************************/ ! void tcCarrierObject::SaveToFile(tcFile& file) ! { tcSurfaceObject::SaveToFile(file); } /******************************************************************************/ ! void tcCarrierObject::LoadFromFile(tcFile& file) ! { tcSurfaceObject::LoadFromFile(file); } /******************************************************************************/ ! void tcCarrierObject::Serialize(tcFile& file, bool mbLoad) ! { ! if (mbLoad) ! { LoadFromFile(file); } ! else ! { SaveToFile(file); } } + /** ! * */ void tcCarrierObject::Update(double afStatusTime) { tcSurfaceObject::Update(afStatusTime); ! tcFlightOpsObject::Update(afStatusTime); } ! #pragma warning (disable : 4355) ! /** ! * ! */ tcCarrierObject::tcCarrierObject() + : tcFlightOpsObject(0, this) { Clear(); mpDBObject = NULL; mnModelType = MTYPE_CARRIER; } + + /******************************************************************************/ /* *************** *** 230,252 **** */ tcCarrierObject::tcCarrierObject(tcGenericDBObject *obj) ! : tcSurfaceObject(obj) { - wxASSERT(database); - mpDBObject = obj; - - tcFlightportDBObject* flightportDBObj = dynamic_cast<tcFlightportDBObject*> - (database->GetObject(obj->flightportClass.mz)); - wxASSERT(flightportDBObj); - if (flightportDBObj == NULL) - { - std::cerr << "Flightport database obj not found for carrier obj: "; - std::cerr << mzUnit.mz << "\n"; - return; - } - - flight_deck.InitFromDatabase(flightportDBObj); } ! /******************************************************************************/ ! tcCarrierObject::~tcCarrierObject() { } \ No newline at end of file --- 125,134 ---- */ tcCarrierObject::tcCarrierObject(tcGenericDBObject *obj) ! : tcSurfaceObject(obj), tcFlightOpsObject(obj->GetFlightport(), this) { mpDBObject = obj; } ! ! tcCarrierObject::~tcCarrierObject() ! { } \ No newline at end of file --- NEW FILE: tcAirfieldObject.cpp --- /* @file tcAirfieldObject.cpp */ /* ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "tcAirfieldObject.h" #include "tcFlightOpsObject.h" #include "tcGenericDBObject.h" void tcAirfieldObject::Clear() { tcPlatformObject::Clear(); tcFlightOpsObject::Clear(); } /** * Randomly initializes object */ void tcAirfieldObject::RandInitNear(float afLon_deg, float afLat_deg) { if (mpDBObject == NULL) {return;} strcpy(mzClass.mz, mpDBObject->mzClass.mz); mzUnit = "AF_"; mzUnit.AssignRandomSuffix(); mnAlliance = 0; mfStatusTime = 0; mcKin.mfLon_rad = C_PIOVER180*(afLon_deg + randfc(1.1f)); mcKin.mfLat_rad = C_PIOVER180*(afLat_deg + randfc(1.1f)); mcKin.mfAlt_m = 0.0f; mcKin.mfHeading_rad = C_TWOPI*randf(); mcKin.mfSpeed_kts = 0; mfDamageLevel = 0; tcFlightOpsObject::RandInitNear(afLon_deg, afLat_deg); } /******************************************************************************/ void tcAirfieldObject::PrintToFile(tcFile& file) { tcPlatformObject::PrintToFile(file); tcFlightOpsObject::PrintToFile(file); } /******************************************************************************/ void tcAirfieldObject::SaveToFile(tcFile& file) { tcPlatformObject::SaveToFile(file); } /******************************************************************************/ void tcAirfieldObject::LoadFromFile(tcFile& file) { tcPlatformObject::LoadFromFile(file); } /******************************************************************************/ void tcAirfieldObject::Serialize(tcFile& file, bool mbLoad) { if (mbLoad) { LoadFromFile(file); } else { SaveToFile(file); } } /** * Update method calls flightops update and updates that are not * related to motion from tcPlatformObject. (tcAirfieldObject does * ot move. ) * TODO: extract sensor and launcher functionality from * tcPlatformObject and use as parent classes instead. Then any * class that needs sensors or launchers can derive from the * appropriate parent class. */ void tcAirfieldObject::Update(double afStatusTime) { const float min_update_s = 0.0f; float dt_s = (float)(afStatusTime - mfStatusTime); if (dt_s <= min_update_s) {return;} // added for pause case tcFlightOpsObject::Update(afStatusTime); UpdateEffects(); wxASSERT(mpDBObject); UpdateLauncherState(dt_s); UpdateSensors(afStatusTime); mfStatusTime = afStatusTime; } #pragma warning (disable : 4355) /** * */ tcAirfieldObject::tcAirfieldObject() : tcFlightOpsObject(0, this) { Clear(); mpDBObject = NULL; mnModelType = MTYPE_AIRFIELD; } /******************************************************************************/ /* tcAirfieldObject::tcAirfieldObject(tcAirfieldObject& o) : tcSurfaceObject(o) { } */ /** * Constructor that initializes using info from database entry. * This object will have its own database object eventually. The * DB object will have info on number and types of aircraft the carrier * can hold. */ tcAirfieldObject::tcAirfieldObject(tcGenericDBObject *obj) : tcPlatformObject(obj), tcFlightOpsObject(obj->GetFlightport(), this) { mpDBObject = obj; mcKin.mfSpeed_kts = 0; // make sure this doesn't move (shouldn't be necessary) } tcAirfieldObject::~tcAirfieldObject() { } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:11
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/src/graphics Modified Files: tcWindow.cpp Log Message: Index: tcWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcWindow.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcWindow.cpp 24 Jun 2004 21:35:40 -0000 1.5 --- tcWindow.cpp 18 Jul 2004 03:18:01 -0000 1.6 *************** *** 369,372 **** --- 369,373 ---- mp2DSurface->GetActive(mbActive); + return true; } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:11
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/include/sim Modified Files: Game.h tc3DViewer.h tcAeroAirObject.h tcAirObject.h tcCarrierObject.h tcFlightOpsObject.h tcFlightPort.h tcGameObject.h Added Files: tcAirfieldObject.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcGameObject.h 4 Jun 2004 21:39:22 -0000 1.20 --- tcGameObject.h 18 Jul 2004 03:18:00 -0000 1.21 *************** *** 71,74 **** --- 71,78 ---- bool isVisible; + tsRelativePosition(float _dx, float _dy, float _dz) + : dx(_dx), dy(_dy), dz(_dz) {} + tsRelativePosition() + : dx(0), dy(0), dz(0), yaw(0), pitch(0), roll(0), isVisible(false) {} tcStream& operator<<(tcStream& stream); tcStream& operator>>(tcStream& stream); *************** *** 110,113 **** --- 114,119 ---- void GetRelPosOf(tcGameObject *obj, tsRelativePosition& rel_pos); virtual void RandInitNear(float afLon_deg, float afLat_deg); + tsGeoPoint RelPosToLatLonAlt(const tsRelativePosition& rel_pos) const; + tsGeoPoint RelPosToLatLonAlt(const float& dx, const float& dy, const float& dz) const; virtual void PrintToFile(tcFile&); virtual void SaveToFile(tcFile& file); Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcAeroAirObject.h 13 Feb 2004 01:31:32 -0000 1.3 --- tcAeroAirObject.h 18 Jul 2004 03:18:00 -0000 1.4 *************** *** 30,33 **** --- 30,38 ---- } + /** + * Aerodynamic air object model. + * A cross between a basic constant-velocity model + * and a flight-sim style model + */ class tcAeroAirObject : public tcAirObject { Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcAirObject.h 24 May 2004 00:14:46 -0000 1.8 --- tcAirObject.h 18 Jul 2004 03:18:00 -0000 1.9 *************** *** 31,34 **** --- 31,37 ---- #define MAX_PITCH_RAD 0.875f + /** + * Models air object that can land + */ class tcAirObject : public tcPlatformObject { Index: tcFlightOpsObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightOpsObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcFlightOpsObject.h 13 Jul 2004 23:28:02 -0000 1.1 --- tcFlightOpsObject.h 18 Jul 2004 03:18:00 -0000 1.2 *************** *** 28,35 **** --- 28,45 ---- class tcGameObject; + namespace Database + { + class tcDatabase; + } + class tcTrack; + /** * Models a sim object with a flightport for air ops. * tcFlightOpsObjects can launch, land, and reposition aircraft. * + * This code started as part of tcCarrierObject and was extracted + * in an attempt to generalize application to airstrips, helo decks + * etc. + * * @see tcFlightPort */ *************** *** 37,58 **** { public: - tcFlightPort flight_deck; ! bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); ! int CheckLanding(tcGameObject* obj); virtual void Clear(); ! virtual void RandInitNear(float afLon_deg, float afLat_deg); void PrintToFile(tcFile& file); ! void SaveToFile(tcFile& file); ! void LoadFromFile(tcFile& file); ! virtual void Serialize(tcFile& file, bool mbLoad); ! void SetFlightportDefaults(); virtual void Update(double afStatusTime); virtual void UpdateLaunch(); ! tcFlightOpsObject(); ! tcFlightOpsObject(tcGenericDBObject *obj); virtual ~tcFlightOpsObject(); private: tcGameObject* gameObj; ///< to avoid (some) virtual inheritance inefficiency }; \ No newline at end of file --- 47,71 ---- { public: ! ! virtual bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); ! virtual int CheckLanding(tcGameObject* obj); virtual void Clear(); ! tcFlightPort* GetFlightPort(); ! tcTrack GetLandingData(); void PrintToFile(tcFile& file); ! void RandInitNear(float afLon_deg, float afLat_deg); ! ! virtual void SetFlightportDefaults(); virtual void Update(double afStatusTime); virtual void UpdateLaunch(); ! tcFlightOpsObject(tcFlightportDBObject* dbObject, tcGameObject* gameObject); virtual ~tcFlightOpsObject(); private: + static Database::tcDatabase* database; + tcFlightPort flight_deck; tcGameObject* gameObj; ///< to avoid (some) virtual inheritance inefficiency + + tcFlightOpsObject(); }; \ No newline at end of file Index: tcFlightPort.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcFlightPort.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcFlightPort.h 4 Jan 2004 22:24:52 -0000 1.4 --- tcFlightPort.h 18 Jul 2004 03:18:00 -0000 1.5 *************** *** 107,110 **** --- 107,112 ---- tsSpotInfo* GetCurrentSpotInfo(tcAirState *airstate); unsigned GetHangarCapacity() const {return hangarCapacity;} + tcTrack GetLandingData(const tcGameObject* obj); + std::vector<tsSpotInfo>* GetLocVector(teLocation loc); void InitFromDatabase(Database::tcFlightportDBObject *dbObj); --- NEW FILE: tcAirfieldObject.h --- /* @file tcAirfieldObject.h */ /* ** Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #pragma once #include "tcFile.h" #include "tcPlatformObject.h" #include "tcFlightOpsObject.h" /** * Models an airfield * * @see tcFlightOpsObject */ class tcAirfieldObject : public tcPlatformObject, public tcFlightOpsObject { public: virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); void PrintToFile(tcFile& file); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); virtual void Update(double afStatusTime); tcAirfieldObject(); tcAirfieldObject(tcAirfieldObject&); tcAirfieldObject(tcGenericDBObject* obj); virtual ~tcAirfieldObject(); }; Index: Game.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/Game.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Game.h 21 Jun 2004 22:21:43 -0000 1.41 --- Game.h 18 Jul 2004 03:18:00 -0000 1.42 *************** *** 157,161 **** tcOOBView* oobView; tcPopupControl* popupControl; // popup control object ! tcDatabase mcDatabase; tcSimState* simState; tcMapData mcMapData; --- 157,161 ---- tcOOBView* oobView; tcPopupControl* popupControl; // popup control object ! tcDatabase* database; tcSimState* simState; tcMapData mcMapData; Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DViewer.h 4 Jun 2004 21:39:22 -0000 1.23 --- tc3DViewer.h 18 Jul 2004 03:18:00 -0000 1.24 *************** *** 157,160 **** --- 157,161 ---- osg::Vec3 cameraPositionOffset; ///< current position offset of camera rel to target, for moveWith osg::Vec3 cameraTarget; ///< point camera is looking at for lookAt modes + osg::Vec3 cameraTargetOffset; ///< offset for lookAt modes float cameraAz; ///< camera azimuth relative to target for moveWith modes float cameraEl; ///< camera elevation relative to target for moveWith modes *************** *** 165,168 **** --- 166,171 ---- float azStart; ///< camera az start for mouse look float elStart; ///< camera el start for mouse look + float lookAzStart; ///< camera look az start for mouse look + float lookElStart; ///< camera look el start for mouse look bool isMouseDown; Index: tcCarrierObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcCarrierObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcCarrierObject.h 13 Jul 2004 23:28:02 -0000 1.7 --- tcCarrierObject.h 18 Jul 2004 03:18:00 -0000 1.8 *************** *** 22,39 **** #include "tcFile.h" #include "tcSurfaceObject.h" ! #include "tcFlightPort.h" /** ! * Represents a Carrier * * @see tcSurfaceObject */ ! class tcCarrierObject : public tcSurfaceObject { public: - tcFlightPort flight_deck; - - bool AddChildToFlightDeck(std::string className, std::string unitName, teLocation loc); - int CheckLanding(tcGameObject *obj); virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); --- 22,38 ---- #include "tcFile.h" #include "tcSurfaceObject.h" ! #include "tcFlightOpsObject.h" /** ! * Models a Carrier ! * Changed to derive from tcFlightOpsObject instead of implementing ! * flight ops here. * * @see tcSurfaceObject + * @see tcFlightOpsObject */ ! class tcCarrierObject : public tcSurfaceObject, public tcFlightOpsObject { public: virtual void Clear(); virtual void RandInitNear(float afLon_deg, float afLat_deg); *************** *** 42,48 **** void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! void SetFlightportDefaults(); virtual void Update(double afStatusTime); - virtual void UpdateLaunch(); tcCarrierObject(); --- 41,46 ---- void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); ! virtual void Update(double afStatusTime); tcCarrierObject(); |
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtension.cpp tcPlatformInterfaceExtensionB.cpp tcScenarioInterface.cpp tcSimPythonInterface.cpp Log Message: Index: tcPlatformInterfaceExtensionB.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtensionB.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcPlatformInterfaceExtensionB.cpp 27 Apr 2004 22:18:52 -0000 1.10 --- tcPlatformInterfaceExtensionB.cpp 18 Jul 2004 03:18:01 -0000 1.11 *************** *** 124,127 **** --- 124,128 ---- .def("SetLandingState",&tcPlatformInterface::SetLandingState) .def("HasFlightPort",&tcPlatformInterface::HasFlightPort) + .def("GetLandingData", &tcPlatformInterface::GetLandingData) .def("GetUserInput",&tcPlatformInterface::GetUserInput) .def("SendCommand",&tcPlatformInterface::SendCommand) Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSimPythonInterface.cpp 27 Apr 2004 22:18:52 -0000 1.13 --- tcSimPythonInterface.cpp 18 Jul 2004 03:18:01 -0000 1.14 *************** *** 156,164 **** } ! tcFlightPort* tcSimPythonInterface::GetHookedObjFlightPort(void) { ! tcCarrierObject *carrier = dynamic_cast<tcCarrierObject*>(mpHookedObj); ! if (carrier == NULL) return NULL; ! return &carrier->flight_deck; } --- 156,164 ---- } ! tcFlightPort* tcSimPythonInterface::GetHookedObjFlightPort() { ! tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpHookedObj); ! if (flightOps == 0) return 0; ! return flightOps->GetFlightPort(); } Index: tcPlatformInterfaceExtension.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtension.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcPlatformInterfaceExtension.cpp 27 Apr 2004 22:18:52 -0000 1.8 --- tcPlatformInterfaceExtension.cpp 18 Jul 2004 03:18:01 -0000 1.9 *************** *** 44,50 **** void tcPlatformInterface::InitPythonClassesA(void) { object class_track = class_<tcTrack>("tcTrack") ! .def_readonly("Alt",&tcTrack::mfAlt_m) ! .def_readonly("Lat",&tcTrack::mfLat_rad) ! .def_readonly("Lon",&tcTrack::mfLon_rad) .def_readonly("Speed",&tcTrack::mfSpeed_kts) .def_readonly("Heading_rad",&tcTrack::mfHeading_rad) --- 44,50 ---- void tcPlatformInterface::InitPythonClassesA(void) { object class_track = class_<tcTrack>("tcTrack") ! .def_readwrite("Alt",&tcTrack::mfAlt_m) ! .def_readwrite("Lat",&tcTrack::mfLat_rad) ! .def_readwrite("Lon",&tcTrack::mfLon_rad) .def_readonly("Speed",&tcTrack::mfSpeed_kts) .def_readonly("Heading_rad",&tcTrack::mfHeading_rad) *************** *** 60,66 **** object class_smtrack = class_<tcSensorMapTrack>("tcSMTrack") ! .def_readonly("Alt",&tcSensorMapTrack::mfAlt_m) ! .def_readonly("Lat",&tcSensorMapTrack::mfLat_rad) ! .def_readonly("Lon",&tcSensorMapTrack::mfLon_rad) .def_readonly("Speed",&tcSensorMapTrack::mfSpeed_kts) .def_readonly("Heading_rad",&tcSensorMapTrack::mfHeading_rad) --- 60,66 ---- object class_smtrack = class_<tcSensorMapTrack>("tcSMTrack") ! .def_readwrite("Alt",&tcSensorMapTrack::mfAlt_m) ! .def_readwrite("Lat",&tcSensorMapTrack::mfLat_rad) ! .def_readwrite("Lon",&tcSensorMapTrack::mfLon_rad) .def_readonly("Speed",&tcSensorMapTrack::mfSpeed_kts) .def_readonly("Heading_rad",&tcSensorMapTrack::mfHeading_rad) Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcScenarioInterface.cpp 24 Jun 2004 21:35:40 -0000 1.11 --- tcScenarioInterface.cpp 18 Jul 2004 03:18:01 -0000 1.12 *************** *** 41,46 **** --- 41,48 ---- #include "tcCarrierObject.h" #include "tcAeroAirObject.h" + #include "tcAirfieldObject.h" #include "tcGenericDBObject.h" + using namespace std; using namespace boost::python; *************** *** 193,196 **** --- 195,199 ---- gameObj->mcKin.mfLat_rad = C_PIOVER180*unit.lat; gameObj->mcKin.mfAlt_m = unit.alt; + gameObj->mcKin.mfHeading_rad = C_PIOVER180*unit.heading; gameObj->SetHeading(gameObj->mcKin.mfHeading_rad); *************** *** 228,231 **** --- 231,242 ---- } + // place ground objects relative to terrain height + if (tcAirfieldObject* fieldObj = dynamic_cast<tcAirfieldObject*>(gameObj)) + { + fieldObj->mcKin.mfAlt_m += + mapData->GetTerrainHeight(unit.lon, unit.lat, 0); + } + + simState->AddPlatform(gameObj); return true; *************** *** 245,249 **** wxASSERT(simState); tcGameObject* parentObj = simState->GetObjectByName(parentName); ! if (tcCarrierObject* carrierObj = dynamic_cast<tcCarrierObject*>(parentObj)) { teLocation loc; --- 256,260 ---- wxASSERT(simState); tcGameObject* parentObj = simState->GetObjectByName(parentName); ! if (tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(parentObj)) { teLocation loc; *************** *** 256,260 **** return false; } ! return carrierObj->AddChildToFlightDeck(className, unitName, loc); } else --- 267,271 ---- return false; } ! return flightOps->AddChildToFlightDeck(className, unitName, loc); } else Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcPlatformInterface.cpp 29 May 2004 00:11:53 -0000 1.23 --- tcPlatformInterface.cpp 18 Jul 2004 03:18:01 -0000 1.24 *************** *** 835,850 **** bool tcPlatformInterface::HasFlightPort(void) { ! tcCarrierObject *carrier = dynamic_cast<tcCarrierObject*>(mpPlatformObj); ! if (carrier != NULL) return true; ! return false; } tcFlightPortInterface tcPlatformInterface::GetFlightPortInfo(void) { tcFlightPortInterface fpi; ! tcCarrierObject *carrier = dynamic_cast<tcCarrierObject*>(mpPlatformObj); ! if (carrier != NULL) { ! fpi.flightport = &carrier->flight_deck; } return fpi; --- 835,884 ---- bool tcPlatformInterface::HasFlightPort(void) { ! if (dynamic_cast<tcFlightOpsObject*>(mpPlatformObj)) ! { ! return true; ! } ! else ! { ! return false; ! } } + + /** + * Id is set to -1 if no landing data available + * Heading_rad has runway orientation + * + * @returns track with landing data for platform id + */ + tcTrack tcPlatformInterface::GetLandingData(long id) + { + tcGameObject* obj = mpSimState->GetObject(id); + if ((obj == 0) || !mpSimState->mpUserInfo->IsOwnAlliance(obj->mnAlliance)) + { + tcTrack data; + data.mnID = -1; + return data; + } + + if (tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(obj)) + { + return flightOps->GetLandingData(); + } + else + { + tcTrack data; + data.mnID = -1; + return data; + } + } + tcFlightPortInterface tcPlatformInterface::GetFlightPortInfo(void) { tcFlightPortInterface fpi; ! tcFlightOpsObject* flightOps = dynamic_cast<tcFlightOpsObject*>(mpPlatformObj); ! if (flightOps != NULL) { ! fpi.flightport = flightOps->GetFlightPort(); } return fpi; |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:10
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/src/database Modified Files: tcDatabase.cpp tcGenericDBObject.cpp Log Message: Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcGenericDBObject.cpp 9 Apr 2004 14:17:42 -0000 1.8 --- tcGenericDBObject.cpp 18 Jul 2004 03:18:00 -0000 1.9 *************** *** 25,28 **** --- 25,30 ---- #include "tcGenericDBObject.h" + #include "tcDatabase.h" + #include "tcFlightportDBObject.h" #include "math_constants.h" #include "randfn.h" *************** *** 46,49 **** --- 48,64 ---- } + tcFlightportDBObject* tcGenericDBObject::GetFlightport() + { + tcFlightportDBObject* flightport = dynamic_cast<tcFlightportDBObject*> + (database->GetObject(flightportClass.mz)); + + if (!flightport) + { + fprintf(stderr, "Error - Class: %s - flightport (%s) not found\n", + mzClass.mz, flightportClass.mz); + } + return flightport; + } + void tcGenericDBObject::RandInit() { Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tcDatabase.cpp 9 Apr 2004 14:17:42 -0000 1.10 --- tcDatabase.cpp 18 Jul 2004 03:18:00 -0000 1.11 *************** *** 52,56 **** { ! /********************************** tcDatabase ************************************/ /** --- 52,64 ---- { ! /** ! * Method for accessing singleton instance. ! */ ! tcDatabase* tcDatabase::Get() ! { ! static tcDatabase instance; ! ! return &instance; ! } /** *************** *** 1043,1047 **** } ! tcDatabase::~tcDatabase() { } --- 1051,1056 ---- } ! tcDatabase::~tcDatabase() ! { } |
|
From: Dewitt C. <ddc...@us...> - 2004-07-18 03:18:09
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11624/scripts Modified Files: AI.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AI.py 16 Feb 2004 01:06:22 -0000 1.9 --- AI.py 18 Jul 2004 03:18:00 -0000 1.10 *************** *** 155,179 **** return 0 def Land(UI,dest_id): # 0 - init, 1 - distant, 2 - init approach, 3 - final approach land_state = UI.GetVar(0) track_info = UI.GetTrackById(dest_id) if (track_info.ID == -1): UI.DisplayMessage('Invalid landing platform') UI.CompletedOrder() return # invalid id # adjust track location based on approach state if (land_state <= 1): if (land_state == 0): UI.DisplayMessage('Landing on platform %d' % track_info.ID) ! UI.SetAlt(1200) UI.SetVar(0,1) ! track_info.Offset(8, track_info.Heading_rad + 3.1416) # approach from rear for now elif (land_state == 2): ! track_info.Offset(5, track_info.Heading_rad + 3.1416) ! UI.SetAlt(400) UI.SetPitchLimit(15) elif (land_state == 3): ! UI.SetAlt(18) UI.SetPitchLimit(10) SetFractionalSpeed(UI,0.6) --- 155,194 ---- return 0 + # modified this to adjust altitude based on altitude of landing + # site def Land(UI,dest_id): # 0 - init, 1 - distant, 2 - init approach, 3 - final approach land_state = UI.GetVar(0) track_info = UI.GetTrackById(dest_id) + + alt_m = track_info.Alt if (track_info.ID == -1): + UI.DisplayMessage('Bad track ID for landing') + UI.CompletedOrder() + return # invalid id + + landing_data = UI.GetLandingData(dest_id) + if (landing_data.ID == -1): UI.DisplayMessage('Invalid landing platform') UI.CompletedOrder() return # invalid id + + track_info.Lat = landing_data.Lat + track_info.Lon = landing_data.Lon + track_info.Alt = landing_data.Alt + # adjust track location based on approach state if (land_state <= 1): if (land_state == 0): UI.DisplayMessage('Landing on platform %d' % track_info.ID) ! UI.SetAlt(1200 + alt_m) UI.SetVar(0,1) ! track_info.Offset(8, landing_data.Heading_rad + 3.1416) # approach from rear for now elif (land_state == 2): ! track_info.Offset(5, landing_data.Heading_rad + 3.1416) ! UI.SetAlt(400 + alt_m) UI.SetPitchLimit(15) elif (land_state == 3): ! UI.SetAlt(18 + alt_m) UI.SetPitchLimit(10) SetFractionalSpeed(UI,0.6) |