gcblue-commits Mailing List for Global Conflict Blue (Page 31)
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...> - 2005-03-11 02:35:08
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24340/src/graphics Modified Files: tc3DViewer.cpp tcGameView.cpp tcStartView.cpp tcTerrainView.cpp Log Message: Index: tcStartView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStartView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcStartView.cpp 27 Jan 2005 01:01:51 -0000 1.6 --- tcStartView.cpp 11 Mar 2005 02:34:57 -0000 1.7 *************** *** 35,38 **** --- 35,39 ---- #include "tcOptions.h" #include "AError.h" + #include "tcTime.h" #include "wxcommands.h" *************** *** 89,92 **** --- 90,101 ---- } + osg::Vec4 color(1.0, 1.0, 0.6, 1.0); + unsigned int count = tcTime::Get()->Get30HzCount(); + float alpha = 0.4f + 0.4f * sinf(0.01f * float(count)); + color._v[3] = alpha; + + DrawTextR("March 10, 2005 Build", 85.0, 150.0, + GetDefaultFont(), color, 24.0, LEFT_BASE_LINE); + DrawBorder(); Index: tcTerrainView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainView.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcTerrainView.cpp 20 Feb 2005 21:54:33 -0000 1.3 --- tcTerrainView.cpp 11 Mar 2005 02:34:57 -0000 1.4 *************** *** 253,256 **** --- 253,258 ---- SetResizeable2D(false); // do not resize 2D surface on resize mapImage = new osg::Texture2D(); + // mapImage->setUseHardwareMipMapGeneration(true); + // mapImage->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT); SetBlend(false); Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DViewer.cpp 10 Mar 2005 03:28:28 -0000 1.12 --- tc3DViewer.cpp 11 Mar 2005 02:34:57 -0000 1.13 *************** *** 1039,1043 **** else { ! if (cameraPosition._v[2] < 1) cameraPosition._v[2] = 1; } // workaround for sky issue, deactivate sky when camera underwater --- 1039,1044 ---- else { ! float min_z = max(1.0f, cameraTarget._v[2] + 2.0f); ! if (cameraPosition._v[2] < min_z) cameraPosition._v[2] = min_z; } // workaround for sky issue, deactivate sky when camera underwater Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcGameView.cpp 5 Mar 2005 22:38:02 -0000 1.6 --- tcGameView.cpp 11 Mar 2005 02:34:57 -0000 1.7 *************** *** 624,627 **** --- 624,629 ---- mpMapView->maMapObj[rnIndex].mnID = po->mnID; mpMapView->maMapObj[rnIndex].mnColor = 0; + mpMapView->maMapObj[rnIndex].isStaleTrack = false; + mpMapView->maMapObj[rnIndex].isDestroyed = false; if ((mpMapView->maMapObj[rnIndex].meSymbol != SYMBOL_FIXED) && |
|
From: Dewitt C. <ddc...@us...> - 2005-03-11 02:35:06
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24340 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** GCblue.vcproj 5 Mar 2005 22:37:49 -0000 1.88 --- GCblue.vcproj 11 Mar 2005 02:34:57 -0000 1.89 *************** *** 98,102 **** RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" ! WarningLevel="4" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> --- 98,102 ---- RuntimeTypeInfo="TRUE" UsePrecompiledHeader="0" ! WarningLevel="3" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:28
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14966/database Added Files: database.db Log Message: --- NEW FILE: database.db --- (This appears to be a binary file; contents omitted.) |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:08
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/scripts Modified Files: AI.py HotKey.py UnitCommands.py Log Message: Index: HotKey.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/HotKey.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HotKey.py 9 Dec 2003 00:36:03 -0000 1.3 --- HotKey.py 10 Mar 2005 03:28:28 -0000 1.4 *************** *** 5,9 **** #UnitInfo.DisplayMessage(key) if (key == '1'): ! SetFractionalSpeed(UnitInfo, 0.4, 1) # last argument set to 1 to print message elif (key == '2'): SetFractionalSpeed(UnitInfo, 0.75, 1) --- 5,13 ---- #UnitInfo.DisplayMessage(key) if (key == '1'): ! if (UnitInfo.IsHelo()): ! SetFractionalSpeed(UnitInfo, 0.05, 1) # near hover for helo ! else: ! # last argument set to 1 to print message ! SetFractionalSpeed(UnitInfo, 0.4, 1) elif (key == '2'): SetFractionalSpeed(UnitInfo, 0.75, 1) *************** *** 12,15 **** --- 16,21 ---- elif (key == '4'): SetFractionalSpeed(UnitInfo, 1.1, 1) # afterburners or emergency power + elif (key == 'e'): + ToggleEngageAll(UnitInfo) elif (key == 'h'): UnitInfo.GetUserInput('SetHeading','Heading') Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** AI.py 8 Mar 2005 00:41:48 -0000 1.19 --- AI.py 10 Mar 2005 03:28:27 -0000 1.20 *************** *** 224,228 **** best_target, best_launcher = GetImmediateTarget(UI) if (best_target != -1): ! UI.DisplayMessage('%s: targ: %d, lau: %d' % (UI.GetName(), best_target, best_launcher)) launcher_info = UI.GetLauncherInfo(best_launcher) if (launcher_info.IsValid()): --- 224,228 ---- best_target, best_launcher = GetImmediateTarget(UI) if (best_target != -1): ! #UI.DisplayMessage('%s: targ: %d, lau: %d' % (UI.GetName(), best_target, best_launcher)) launcher_info = UI.GetLauncherInfo(best_launcher) if (launcher_info.IsValid()): *************** *** 236,239 **** --- 236,241 ---- else: TI.SetMemoryValue(2, 0) + #else: + #UI.DisplayMessage('%s: no targets' % UI.GetName()) if (engage_mode == 1): # turn to target *************** *** 249,253 **** if (GetConnControl(BB)): UI.SetHeading(target_bearing-launcher_angle) ! engagement_angle = target_bearing - launcher_angle if (engagement_angle > 180.0): --- 251,255 ---- if (GetConnControl(BB)): UI.SetHeading(target_bearing-launcher_angle) ! engagement_angle = target_bearing - launcher_angle if (engagement_angle > 180.0): *************** *** 257,267 **** if (engagement_angle <= 0.5 * sector_width): EngageTargetWithLauncher(UI, launcher) ! TI.SetMemoryValue(2, 2) ! TI.SetUpdateInterval(10.0) # wait 10 seconds - if (engage_mode >= 2): - TI.SetMemoryValue(2, 0) # return to search mode - TI.SetUpdateInterval(20.0) - ReleaseConnControl(BB) --- 259,269 ---- if (engagement_angle <= 0.5 * sector_width): EngageTargetWithLauncher(UI, launcher) ! TI.SetMemoryValue(2, 0) ! TI.SetUpdateInterval(1.0) # wait 1 seconds ! ReleaseConnControl(BB) ! # set for "fire and forget" this way ! # add check here for semiactive guidance that requires keeping FC radar on target ! # for duration of engagement *************** *** 292,306 **** track_info = track_list.GetTrack(n) track_id = track_info.ID ! staleness = track_info.Time - current_time engaged_count = track_info.GetEngagedCount() ! if (track_info.IsAir() or track_info.IsMissile()): max_engaged_count = 2 else: max_engaged_count = 6 ! if ((engaged_count < max_engaged_count) and (staleness < 15.0)): UI.SetTarget(track_id) launcher_info = UI.GetBestLauncher() launcher_idx = launcher_info.Launcher if (launcher_idx != -1): target_range = UI.GetRangeToTarget() --- 294,311 ---- track_info = track_list.GetTrack(n) track_id = track_info.ID ! staleness = current_time - track_info.Time ! bearing_only = track_info.IsBearingOnly() engaged_count = track_info.GetEngagedCount() ! if (track_info.IsAir() or track_info.IsMissile() or track_info.IsSub()): max_engaged_count = 2 else: max_engaged_count = 6 + #UI.DisplayMessage('Track %d, %.0f/%d/%d' % (track_id, staleness, bearing_only, engaged_count)) ! if ((engaged_count < max_engaged_count) and (staleness < 15.0) and (not bearing_only)): UI.SetTarget(track_id) launcher_info = UI.GetBestLauncher() launcher_idx = launcher_info.Launcher + #UI.DisplayMessage('Best launcher %d' % launcher_idx) if (launcher_idx != -1): target_range = UI.GetRangeToTarget() Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** UnitCommands.py 2 Mar 2005 22:28:41 -0000 1.14 --- UnitCommands.py 10 Mar 2005 03:28:28 -0000 1.15 *************** *** 3,6 **** --- 3,14 ---- UI.AddTask('EngageAll', 2.0) + def ToggleEngageAll(UI): + if (UI.TaskExists('EngageAll')): + UI.DeleteTask('EngageAll') + else: + UI.AddTask('EngageAll', 2.0) + + + def AddWaypointOrderGroup(GI, lon, lat): unit_count = GI.GetUnitCount() *************** *** 235,238 **** --- 243,248 ---- UI.DisplayMessage('Set throttle to afterburn') else: + if (k > 1): + k = 1 max_speed = UI.GetMaxSpeed() UI.SetSpeed(k*max_speed) |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:08
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/include/sim Modified Files: tcAeroAirObject.h tcGameObject.h tcLauncher.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** tcGameObject.h 8 Mar 2005 00:41:47 -0000 1.32 --- tcGameObject.h 10 Mar 2005 03:28:27 -0000 1.33 *************** *** 113,119 **** float mfDamageLevel; ///< 0 is no damage, up to toughness amount ! float RangeTo(tcGameObject& p); ! float BearingTo(tcGameObject& p); ! float BearingToRad(tcGameObject& p); void AddChild(tcGameObject *child); void RemoveChild(tcGameObject *child); --- 113,119 ---- float mfDamageLevel; ///< 0 is no damage, up to toughness amount ! float RangeTo(tcGameObject& p) const; ! float BearingTo(tcGameObject& p) const; ! float BearingToRad(tcGameObject& p) const; void AddChild(tcGameObject *child); void RemoveChild(tcGameObject *child); Index: tcLauncher.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcLauncher.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcLauncher.h 24 Feb 2005 22:19:14 -0000 1.11 --- tcLauncher.h 10 Mar 2005 03:28:27 -0000 1.12 *************** *** 81,86 **** float mfTimeToReady; ! unsigned int mnCurrent; ! unsigned int mnUncommitted; ///< mnCurrent - mnUncommitted = # pending launch int errorCode; ///< used in multiplayer to pass error code to client bool isLoading; ///< true if launcher is offline to load/unload weapons --- 81,86 ---- float mfTimeToReady; ! int mnCurrent; ! int mnUncommitted; ///< mnCurrent - mnUncommitted = # pending launch int errorCode; ///< used in multiplayer to pass error code to client bool isLoading; ///< true if launcher is offline to load/unload weapons *************** *** 112,115 **** --- 112,116 ---- tcUpdateStream& operator>>(tcUpdateStream& stream); + void ClearPendingLaunch(); bool CommandInfoMatches(const tcLauncher& launcher); void CopyCommandInfoFrom(const tcLauncher& launcher); *************** *** 119,122 **** --- 120,124 ---- int GetErrorCode() const {return errorCode;} int GetLauncherStatus(); + int GetLauncherStatus() const; float GetSectorCenter() const; ///< returns center of engagement sector in radians float GetSectorWidth() const; ///< returns width of engagement sector in radians Index: tcAeroAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAeroAirObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcAeroAirObject.h 7 Nov 2004 03:40:43 -0000 1.7 --- tcAeroAirObject.h 10 Mar 2005 03:28:27 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- virtual void ApplyRestrictions(); virtual void Clear(void); + virtual bool IsDestroyed(); virtual void RandInitNear(float afLon_deg, float afLat_deg); |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:08
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/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.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** simmath.cpp 7 Mar 2005 01:54:19 -0000 1.22 --- simmath.cpp 10 Mar 2005 03:28:28 -0000 1.23 *************** *** 595,599 **** * @returns range in km */ ! float tcKinematics::RangeToKm(tcKinematics& k) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)k.mfLat_rad,(float)k.mfLon_rad); --- 595,600 ---- * @returns range in km */ ! float tcKinematics::RangeToKm(tcKinematics& k) const ! { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)k.mfLat_rad,(float)k.mfLon_rad); *************** *** 602,606 **** * @return range in km including range due to altitude difference */ ! float tcKinematics::RangeToKmAlt(tcKinematics& k) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, --- 603,607 ---- * @return range in km including range due to altitude difference */ ! float tcKinematics::RangeToKmAlt(tcKinematics& k) const { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, *************** *** 609,613 **** } ! float tcKinematics::RangeToKm(const GeoPoint *apGeoPoint) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, --- 610,614 ---- } ! float tcKinematics::RangeToKm(const GeoPoint *apGeoPoint) const { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, *************** *** 619,623 **** * @return approximate range in km, altitude difference is neglected */ ! float tcKinematics::RangeToKm(const tcTrack& track) { float lat_rad = (float)track.mfLat_rad; --- 620,624 ---- * @return approximate range in km, altitude difference is neglected */ ! float tcKinematics::RangeToKm(const tcTrack& track) const { float lat_rad = (float)track.mfLat_rad; *************** *** 630,634 **** * @return approximate range in km, altitude difference is neglected */ ! float tcKinematics::RangeToKm(float lon_rad, float lat_rad) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, --- 631,635 ---- * @return approximate range in km, altitude difference is neglected */ ! float tcKinematics::RangeToKm(float lon_rad, float lat_rad) const { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:06
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/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.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** tcPlatformInterface.h 2 Mar 2005 22:28:38 -0000 1.35 --- tcPlatformInterface.h 10 Mar 2005 03:28:27 -0000 1.36 *************** *** 60,64 **** float maxDepth_m; ///< max depth for subsurface launch int mnLaunchMode; ///< 0 - datum, 1 - handoff ! double sectorCenter; ///< az of center of launch engagement sector in deg double sectorWidth; ///< width of engagement sector in deg --- 60,64 ---- float maxDepth_m; ///< max depth for subsurface launch int mnLaunchMode; ///< 0 - datum, 1 - handoff ! int launcherStatus; double sectorCenter; ///< az of center of launch engagement sector in deg double sectorWidth; ///< width of engagement sector in deg |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:29:06
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/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.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** simmath.h 7 Mar 2005 01:54:18 -0000 1.28 --- simmath.h 10 Mar 2005 03:28:26 -0000 1.29 *************** *** 122,125 **** --- 122,127 ---- bool IsMissile() {return ((mnClassification & PTYPE_MISSILE) != 0);} bool IsSurface() {return ((mnClassification & PTYPE_SURFACE) != 0);} + bool IsSub() {return ((mnClassification == PTYPE_SUBMARINE) != 0);} + bool IsTorpedo() {return ((mnClassification == PTYPE_TORPEDO) != 0);} bool IsValid() {return mnID != -1;} bool IsBearingOnly() const; *************** *** 188,196 **** float HeadingToTrack(const tcTrack& track); float HeadingToGeoRad(const GeoPoint *apGeoPoint); ! float RangeToKm(const GeoPoint *apGeoPoint); ! float RangeToKm(tcKinematics& k); ! float RangeToKm(const tcTrack& track); ! float RangeToKm(float lon_rad, float lat_rad); ! float RangeToKmAlt(tcKinematics& k); //float InterceptHeadingToTrack(tcTrack& track, float& afTimeToIntercept); void GetInterceptData2D(const tcTrack& track, float& rfHeading_rad, --- 190,198 ---- float HeadingToTrack(const tcTrack& track); float HeadingToGeoRad(const GeoPoint *apGeoPoint); ! float RangeToKm(const GeoPoint *apGeoPoint) const; ! float RangeToKm(tcKinematics& k) const; ! float RangeToKm(const tcTrack& track) const; ! float RangeToKm(float lon_rad, float lat_rad) const; ! float RangeToKmAlt(tcKinematics& k) const; //float InterceptHeadingToTrack(tcTrack& track, float& afTimeToIntercept); void GetInterceptData2D(const tcTrack& track, float& rfHeading_rad, |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:28:42
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/src/sim Modified Files: Game.cpp tcAeroAirObject.cpp tcAirObject.cpp tcBallisticWeapon.cpp tcGameObject.cpp tcLauncher.cpp tcLauncherState.cpp tcMissileObject.cpp tcPositionRegistry.cpp tcRadar.cpp tcSimState.cpp tcSonar.cpp tcSubObject.cpp tcTorpedoObject.cpp Log Message: Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** tcSimState.cpp 8 Mar 2005 00:41:50 -0000 1.71 --- tcSimState.cpp 10 Mar 2005 03:28:29 -0000 1.72 *************** *** 495,499 **** { tcGameObject* target = GetObject(blastPlats[idx]); ! if (target && (target->mnID != weapon->mnID)) { float range_m = 1000.0f * target->mcKin.RangeToKmAlt(weapon->mcKin); --- 495,502 ---- { tcGameObject* target = GetObject(blastPlats[idx]); ! ! bool eligible = target && (target->mnID != weapon->mnID) && (target->mcKin.mfAlt_m >= -5.0f); ! ! if (eligible) { float range_m = 1000.0f * target->mcKin.RangeToKmAlt(weapon->mcKin); *************** *** 615,619 **** return afDamage / pPlatformObj->mpDBObject->mfToughness; } ! wxASSERT(false); return afDamage; } --- 618,622 ---- return afDamage / pPlatformObj->mpDBObject->mfToughness; } ! return afDamage; } Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcMissileObject.cpp 24 Feb 2005 22:19:16 -0000 1.23 --- tcMissileObject.cpp 10 Mar 2005 03:28:29 -0000 1.24 *************** *** 192,199 **** msKState.mfPitch_rad = mcKin.mfPitch_rad; - tcString s; - s.Format("From %s", obj->mzUnit.mz); - mzUnit = s.GetBuffer(); mnAlliance = obj->mnAlliance; --- 192,198 ---- msKState.mfPitch_rad = mcKin.mfPitch_rad; + wxString s = wxString::Format("Missile %d-%d", obj->mnID, rand() % 1000); + mzUnit = s.c_str(); mnAlliance = obj->mnAlliance; *************** *** 508,514 **** mfGoalPitch_rad = 0.0f; } - // switch to next flight profile segment if within range ! if (mnCurrentSegment < (mpDBObject->mnNumSegments-1)) { if (mfRangeToObjective_km < pSegmentInfo->mfRange_km) --- 507,512 ---- mfGoalPitch_rad = 0.0f; } // switch to next flight profile segment if within range ! else if (mnCurrentSegment < (mpDBObject->mnNumSegments-1)) { if (mfRangeToObjective_km < pSegmentInfo->mfRange_km) Index: tcAeroAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAeroAirObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcAeroAirObject.cpp 18 Feb 2005 17:41:51 -0000 1.9 --- tcAeroAirObject.cpp 10 Mar 2005 03:28:29 -0000 1.10 *************** *** 45,48 **** --- 45,53 ---- } + bool tcAeroAirObject::IsDestroyed() + { + return mfDamageLevel >= 1.0f; + } + void tcAeroAirObject::RandInitNear(float afLon_deg, float afLat_deg) { Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcLauncher.cpp 2 Mar 2005 22:28:44 -0000 1.12 --- tcLauncher.cpp 10 Mar 2005 03:28:29 -0000 1.13 *************** *** 157,160 **** --- 157,168 ---- /** + * Clears pending launch by resetting mnUncommitted + */ + void tcLauncher::ClearPendingLaunch() + { + mnUncommitted = (int)mnCurrent; + } + + /** * @return class name of child, or "Empty" if none */ *************** *** 341,344 **** --- 349,484 ---- } + + /** + * @return LAUNCHER_READY if launcher is ready to launch. Launch readiness + * @return conditions depend on meLaunchMode for the launcher. + * @return Otherwise return error code + * @see teWeaponLaunchMode + * @see tcLauncherState::teLauncherStatus + * This method needs to be separated into smaller pieces. + */ + int tcLauncher::GetLauncherStatus() const + { + using namespace Database; + + if (mnCurrent <= 0) {return LAUNCHER_EMPTY;} // launcher empty + if ((mfTimeToReady > 0) || (isLoading)) + { + return LAUNCHER_BUSY; + } + if (!mbActive) {return LAUNCHER_INACTIVE;} // launcher inactive or damaged + + wxASSERT(simState); + wxASSERT(parent); + + // limit depth for launching sub-launched missiles + if (tcMissileDBObject* missile = + dynamic_cast<tcMissileDBObject*>(mpChildDBObj)) + { + if (parent->mcKin.mfAlt_m < -30.0) return TOO_DEEP; + } + else if (tcTorpedoDBObject* torpedo = + dynamic_cast<tcTorpedoDBObject*>(mpChildDBObj)) + { + if (-parent->mcKin.mfAlt_m > torpedo->maxDepth_m) return TOO_DEEP; + } + + if (meLaunchMode == DATUM_ONLY) // needs a datum programmed to launch + { + if ((msDatum.mfLat_rad != 0) || (msDatum.mfLon_rad != 0)) + { + return LAUNCHER_READY; + } + else + { + return NO_DATUM; + } + } + + + + + // will launch and either proceed unguided or autonomously search out target + if (meLaunchMode == AUTO) + { + bool hasDatum = (msDatum.mfLat_rad != 0) || (msDatum.mfLon_rad != 0); + bool hasTarget = (mnTargetID == NULL_INDEX); + if ((!hasDatum) && (!hasTarget)) + { + return NO_TARGET; + } + else + { + return LAUNCHER_READY; + } + } + + // if running as multiplayer client, seeker track can't be checked so defer checking to server + if (parent->IsClientMode()) + { + return LAUNCHER_READY; + } + + tcGameObject *targetObj = simState->GetObject(mnTargetID); + + // TODO: called here as quick way to add autopoint feature, move to better location + /* + if (IsAutoPoint() && (targetObj != 0)) + { + pointingAngle = parent->BearingToRad(*targetObj) - parent->mcKin.mfHeading_rad; + if (pointingAngle >= C_PI) pointingAngle -= C_TWOPI; + else if (pointingAngle < -C_PI) pointingAngle += C_TWOPI; + } + */ + + // needs a fire control track (launching platform) to launch + if ((meLaunchMode == FC_TRACK)||(meLaunchMode == SEEKER_TRACK)) + { + if (mnTargetID == NULL_INDEX) return NO_TARGET; // needs a target + if (!fireControlSensor) return NO_FIRECONTROL; // database error + + if (!fireControlSensor->IsTrackAvailable()) return FC_BUSY; // no FC tracks available + if (targetObj == NULL) return NOT_DETECTED_FC; // target doesn't exist + + float range; + if (!fireControlSensor->CanDetectTarget(targetObj, range)) + { + return NOT_DETECTED_FC; + } + + if (meLaunchMode == FC_TRACK) return LAUNCHER_READY; + } + + // needs a seeker track to launch + if (meLaunchMode == SEEKER_TRACK) + { + tcMissileDBObject *pMissileDBObj = dynamic_cast<tcMissileDBObject*>(mpChildDBObj); + if (pMissileDBObj==NULL) + { + std::cerr << "GetLauncherStatus -- Error: SEEKER_TRACK guidance with non-missile" << std::endl; + return LAUNCHER_ERROR; + } + tnPoolIndex nSensorKey = pMissileDBObj->GetPrimarySeekerKey(); + + long fcID = parent->mnID; + unsigned fcIdx = fireControlSensorIdx; + + bool canDetect = simState->RadarCanDetect(nSensorKey, targetObj, + parent, pointingAngle, fcID, fcIdx); + + if (canDetect) + { + return LAUNCHER_READY; + } + else + { + return NOT_DETECTED_SEEKER; + } + } + + + return LAUNCHER_ERROR; // bad meLaunchMode + } + /** * *************** *** 488,494 **** { mnCurrent = quantity; ! if (mnCurrent > mpLauncherDBObj->mnCapacity) { ! mnCurrent = mpLauncherDBObj->mnCapacity; } mnUncommitted = mnCurrent; --- 628,634 ---- { mnCurrent = quantity; ! if (mnCurrent > (int)mpLauncherDBObj->mnCapacity) { ! mnCurrent = (int)mpLauncherDBObj->mnCapacity; } mnUncommitted = mnCurrent; Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcTorpedoObject.cpp 8 Mar 2005 00:41:51 -0000 1.8 --- tcTorpedoObject.cpp 10 Mar 2005 03:28:29 -0000 1.9 *************** *** 180,186 **** } ! tcString s; ! s.Format("From %s", obj->mzUnit.mz); ! mzUnit = s.GetBuffer(); mnAlliance = obj->mnAlliance; --- 180,186 ---- } ! wxString s = wxString::Format("Torp %d-%d", obj->mnID, rand() % 1000); ! mzUnit = s.c_str(); ! mnAlliance = obj->mnAlliance; Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcGameObject.cpp 8 Mar 2005 00:41:50 -0000 1.30 --- tcGameObject.cpp 10 Mar 2005 03:28:29 -0000 1.31 *************** *** 250,254 **** * */ ! float tcGameObject::RangeTo(tcGameObject& p) { return mcKin.RangeToKm(p.mcKin); --- 250,254 ---- * */ ! float tcGameObject::RangeTo(tcGameObject& p) const { return mcKin.RangeToKm(p.mcKin); *************** *** 285,289 **** * @return bearing to p in degrees */ ! float tcGameObject::BearingTo(tcGameObject& p) { return (float)(C_180OVERPI* --- 285,289 ---- * @return bearing to p in degrees */ ! float tcGameObject::BearingTo(tcGameObject& p) const { return (float)(C_180OVERPI* *************** *** 294,298 **** * @return bearing to p in radians */ ! float tcGameObject::BearingToRad(tcGameObject& p) { return (float)(atan2(p.mcKin.mfLon_rad-mcKin.mfLon_rad, --- 294,298 ---- * @return bearing to p in radians */ ! float tcGameObject::BearingToRad(tcGameObject& p) const { return (float)(atan2(p.mcKin.mfLon_rad-mcKin.mfLon_rad, Index: tcPositionRegistry.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPositionRegistry.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcPositionRegistry.cpp 8 Mar 2005 00:41:50 -0000 1.2 --- tcPositionRegistry.cpp 10 Mar 2005 03:28:29 -0000 1.3 *************** *** 124,129 **** --- 124,131 ---- if (posIter == positionMap.end()) { + #ifdef _DEBUG fprintf(stderr, "tcPositionRegistry::RemoveIdFromBin - " "bin not found in positionMap (%d)\n", bin); + #endif return; } *************** *** 133,138 **** --- 135,142 ---- if (binIter == posIter->second.end()) { + #ifdef _DEBUG fprintf(stderr, "tcPositionRegistry::RemoveIdFromBin - " "id not found in bin map (%d, %d)\n", bin, id); + #endif return; } Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcSubObject.cpp 8 Mar 2005 00:41:51 -0000 1.5 --- tcSubObject.cpp 10 Mar 2005 03:28:29 -0000 1.6 *************** *** 525,528 **** --- 525,530 ---- UpdateMessages(); + UpdateAI(afStatusTime); + mfStatusTime = afStatusTime; } Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tcAirObject.cpp 8 Mar 2005 00:41:50 -0000 1.18 --- tcAirObject.cpp 10 Mar 2005 03:28:29 -0000 1.19 *************** *** 281,287 **** mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; ! mcKin.mfRoll_rad += 0.01f * dt_s; ! if (mcKin.mfAlt_m <= mcTerrain.mfHeight_m + 25.0f) { doneCrashing = true; --- 281,288 ---- mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; ! mcKin.mfRoll_rad += 0.1f * dt_s; ! if ((mcKin.mfAlt_m <= mcTerrain.mfHeight_m + 20.0f) || ! (mcKin.mfAlt_m <= 20.0f)) { doneCrashing = true; Index: tcLauncherState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncherState.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tcLauncherState.cpp 7 Dec 2004 04:00:43 -0000 1.25 --- tcLauncherState.cpp 10 Mar 2005 03:28:29 -0000 1.26 *************** *** 215,219 **** tcLauncher* pLauncher = launchers[n]; ! if ((pLauncher->mbActive)&&(pLauncher->mnCurrent > pLauncher->mnUncommitted)) { bool bLaunch = (pLauncher->mnCurrent > 0)&&(pLauncher->mfTimeToReady <= 0); --- 215,219 ---- tcLauncher* pLauncher = launchers[n]; ! if ((pLauncher->mbActive)&&((int)pLauncher->mnCurrent > pLauncher->mnUncommitted)) { bool bLaunch = (pLauncher->mnCurrent > 0)&&(pLauncher->mfTimeToReady <= 0); *************** *** 245,248 **** --- 245,249 ---- else { + pLauncher->mnUncommitted = pLauncher->mnCurrent; // reset } *************** *** 303,307 **** { pLauncher->mnUncommitted = 0; // don't set new cmd here since this is an error case ! std::cerr << "Error - tcLauncherState::SetLaunch - negative uncommitted\n"; } else --- 304,310 ---- { pLauncher->mnUncommitted = 0; // don't set new cmd here since this is an error case ! #ifdef _DEBUG ! fprintf(stderr, "Warning - tcLauncherState::SetLaunch - request exceeds capacity\n"); ! #endif } else *************** *** 357,362 **** return false; } ! launchers[nLauncher]->mnTargetID = targetID; ! launchers[nLauncher]->msDatum.Set(0, 0, 0); // clear datum commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); --- 360,368 ---- return false; } ! ! tcLauncher* launcher = launchers[nLauncher]; ! launcher->mnTargetID = targetID; ! launcher->msDatum.Set(0, 0, 0); // clear datum ! launcher->ClearPendingLaunch(); commandObj.SetNewCommand(GetLauncherFlag(nLauncher)); Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSonar.cpp 8 Mar 2005 00:41:50 -0000 1.9 --- tcSonar.cpp 10 Mar 2005 03:28:29 -0000 1.10 *************** *** 206,210 **** else { ! fprintf(stderr, "tcSonar::SetActiveSonar - no active capability\n"); } } --- 206,211 ---- else { ! fprintf(stderr, "tcSonar::SetActiveSonar - no active capability (%s)\n", ! mpDBObj->mzClass.mz); } } *************** *** 495,499 **** wxASSERT(target->mpDBObject); unsigned int nClassification = target->mpDBObject->mnType; ! nClassification &= 0xFFF0; // leave size field unknown teAffiliation eAffil = UNKNOWN; if (nClassification & PTYPE_TORPEDO) {eAffil = HOSTILE;} --- 496,503 ---- wxASSERT(target->mpDBObject); unsigned int nClassification = target->mpDBObject->mnType; ! if (nClassification & PTYPE_SURFACE) ! { ! nClassification &= 0xFFF0; // leave size field unknown ! } teAffiliation eAffil = UNKNOWN; if (nClassification & PTYPE_TORPEDO) {eAffil = HOSTILE;} Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** Game.cpp 24 Feb 2005 22:19:15 -0000 1.122 --- Game.cpp 10 Mar 2005 03:28:29 -0000 1.123 *************** *** 2401,2405 **** popupControl->Freeze(); popupControl->SetMenu(MENUMODE_FLIGHTPANEL); ! popupControl->Track(wxPoint(mrectMap.left+20,mrectMap.top+70)); } } --- 2401,2405 ---- popupControl->Freeze(); popupControl->SetMenu(MENUMODE_FLIGHTPANEL); ! popupControl->Track(wxPoint(mrectMap.left+220,mrectMap.top+70)); } } Index: tcBallisticWeapon.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcBallisticWeapon.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcBallisticWeapon.cpp 24 Feb 2005 22:19:16 -0000 1.9 --- tcBallisticWeapon.cpp 10 Mar 2005 03:28:29 -0000 1.10 *************** *** 122,128 **** } ! tcString s; ! s.Format("Ball %s", obj->mzUnit.mz); ! mzUnit = s.GetBuffer(); mnAlliance = obj->mnAlliance; --- 122,128 ---- } ! wxString s = wxString::Format("Ball %d-%d", obj->mnID, rand() % 1000); ! mzUnit = s.c_str(); ! mnAlliance = obj->mnAlliance; Index: tcRadar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcRadar.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcRadar.cpp 2 Mar 2005 22:28:45 -0000 1.26 --- tcRadar.cpp 10 Mar 2005 03:28:29 -0000 1.27 *************** *** 147,152 **** else { ! fprintf(stderr, "tcRadar::CanDetectTarget called with illegal target class (%s)\n", ! target->mzClass.mz); return false; } --- 147,158 ---- else { ! #ifdef _DEBUG ! static unsigned int reportCount = 0; ! if (reportCount++ < 3) ! { ! fprintf(stderr, "tcRadar::CanDetectTarget called with illegal target class (%s)\n", ! target->mzClass.mz); ! } ! #endif return false; } |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:28:40
|
Update of /cvsroot/gcblue/gcb_wx/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/xml Modified Files: options.xml Log Message: Index: options.xml =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/xml/options.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** options.xml 5 Mar 2005 22:38:03 -0000 1.15 --- options.xml 10 Mar 2005 03:28:30 -0000 1.16 *************** *** 2,7 **** <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Test.SubTestII.py</LastScenarioPath> ! <LastScenarioName>SubTestII</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> --- 2,7 ---- <HostAddress>192.168.0.102</HostAddress> <DisplaySettings>default</DisplaySettings> ! <LastScenarioPath>Test.Type42.py</LastScenarioPath> ! <LastScenarioName>Type42</LastScenarioName> <noCopyDatabase /> <noWriteXmlDatabase /> |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:28:39
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/src/graphics Modified Files: ObjectUpdater.cpp tc3DViewer.cpp tcCreditView.cpp tcHookInfo.cpp tcMapView.cpp tcPopupControl.cpp Log Message: Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcCreditView.cpp 27 Jan 2005 01:01:49 -0000 1.11 --- tcCreditView.cpp 10 Mar 2005 03:28:28 -0000 1.12 *************** *** 56,59 **** --- 56,65 ---- AddCredit(s, 40.0f, 1); + s = "Credits not updated for 0.7 yet"; + AddCredit(s, 45.0f, 1); + + s = "GCB 0.6 Credits"; + AddCredit(s, 45.0f, 1); + s = "Dewitt Colclough"; AddCredit(s, 25.0f, 1); *************** *** 62,66 **** AddCredit(s, 80.0f, 0); - s = "3D art"; AddCredit(s, 25.0f, 1); --- 68,71 ---- Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcHookInfo.cpp 5 Mar 2005 22:38:02 -0000 1.7 --- tcHookInfo.cpp 10 Mar 2005 03:28:28 -0000 1.8 *************** *** 297,321 **** id = obj->mnDBKey; name = obj->mpDBObject->mzClass.mz; ! } ! else ! { ! id = -1; ! name = "Error"; ! } ! bool matches = false; ! for(unsigned k=0;(k<classID.size())&&(!matches);k++) ! { ! if (classID[k] == id) { ! matches = true; ! quantity[k]++; } } ! if (!matches) ! { ! classID.push_back(id); ! quantity.push_back(1); ! className.Add(name); } } --- 297,321 ---- id = obj->mnDBKey; name = obj->mpDBObject->mzClass.mz; ! ! bool matches = false; ! for(unsigned k=0;(k<classID.size())&&(!matches);k++) { ! if (classID[k] == id) ! { ! matches = true; ! quantity[k]++; ! } ! } ! if (!matches) ! { ! classID.push_back(id); ! quantity.push_back(1); ! className.Add(name); } } ! else ! { } + } Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMapView.cpp 5 Mar 2005 22:38:02 -0000 1.19 --- tcMapView.cpp 10 Mar 2005 03:28:28 -0000 1.20 *************** *** 2378,2382 **** mpointMouse = point; ! if (mpointMouse.x <= nScrollBorder) { if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} // allows for delay --- 2378,2383 ---- mpointMouse = point; ! // +200 is a hack to workaround the semi-transparent overlay window ! if (mpointMouse.x <= nScrollBorder + 200) { if (mnScrollState < SCROLL_DELAY) {mnScrollState++;} // allows for delay Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcPopupControl.cpp 11 Dec 2004 01:09:06 -0000 1.7 --- tcPopupControl.cpp 10 Mar 2005 03:28:28 -0000 1.8 *************** *** 308,313 **** tc3DWindow(parent, pos, size, name) { ! mpointUpperLeft.x = 100; ! mpointUpperLeft.y = 100; mbActive = false; mbRebuildMenu = false; --- 308,313 ---- tc3DWindow(parent, pos, size, name) { ! mpointUpperLeft.x = 250; ! mpointUpperLeft.y = 150; mbActive = false; mbRebuildMenu = false; Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ObjectUpdater.cpp 8 Mar 2005 00:41:48 -0000 1.14 --- ObjectUpdater.cpp 10 Mar 2005 03:28:28 -0000 1.15 *************** *** 214,217 **** --- 214,221 ---- z = pos->dz; isVisible = pos->isVisible; + if (!isVisible) + { + z = -50000.0f; + } } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tc3DViewer.cpp 5 Mar 2005 22:37:52 -0000 1.11 --- tc3DViewer.cpp 10 Mar 2005 03:28:28 -0000 1.12 *************** *** 1026,1031 **** cameraTarget = cameraPosition*m; } ! // limit min camera altitude unless subsurface obj ! if ((obj->mpDBObject->mnType & PTYPE_SUBSURFACE) != 0) { if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; --- 1026,1031 ---- cameraTarget = cameraPosition*m; } ! // limit min camera altitude unless surface or subsurface obj ! if ((obj->mpDBObject->mnType & (PTYPE_SUBSURFACE | PTYPE_SURFACE)) != 0) { if (cameraPosition._v[2] < -480.0) cameraPosition._v[2] = -480.0; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-10 03:28:38
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14606/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcPlatformInterfaceExtension.cpp Log Message: Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** tcPlatformInterface.cpp 2 Mar 2005 22:28:44 -0000 1.38 --- tcPlatformInterface.cpp 10 Mar 2005 03:28:29 -0000 1.39 *************** *** 432,435 **** --- 432,439 ---- nTargetType = MISSILE_TARGET; } + else if (track.IsSub()) + { + nTargetType = SUBSURFACE_TARGET; + } else { *************** *** 446,450 **** { int bCompatible = info.mnTargetFlags & nTargetType; ! bool bInRange = info.mfRange_km <= mfTargetRange; if (bCompatible && info.mnQuantity) { --- 450,454 ---- { int bCompatible = info.mnTargetFlags & nTargetType; ! bool bInRange = mfTargetRange <= info.mfRange_km; if (bCompatible && info.mnQuantity) { *************** *** 479,483 **** { info.mnLauncher = -1; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) --- 483,488 ---- { info.mnLauncher = -1; ! info.launcherStatus = tcLauncher::LAUNCHER_BUSY; ! int nCount = GetLauncherCount(); if ((anLauncher < 0)||(anLauncher >= nCount)) *************** *** 486,500 **** } ! const tcLauncher* const pLauncherData = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncherData); // convert engagement sector values to degrees ! info.sectorCenter = C_180OVERPI * pLauncherData->GetSectorCenter(); ! info.sectorWidth = C_180OVERPI * pLauncherData->GetSectorWidth(); info.maxDepth_m = 0; if (tcMissileDBObject* missileDBObj = ! dynamic_cast<tcMissileDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = missileDBObj->mfRange_km; --- 491,512 ---- } ! const tcLauncher* const pLauncher = mpPlatformObj->mcLauncherState.GetLauncher(anLauncher); ! wxASSERT(pLauncher); ! ! info.launcherStatus = pLauncher->GetLauncherStatus(); ! if ((info.launcherStatus == tcLauncher::LAUNCHER_BUSY) || ! (info.launcherStatus >= tcLauncher::NOT_DETECTED_FC)) ! { ! return false; ! } // convert engagement sector values to degrees ! info.sectorCenter = C_180OVERPI * pLauncher->GetSectorCenter(); ! info.sectorWidth = C_180OVERPI * pLauncher->GetSectorWidth(); info.maxDepth_m = 0; if (tcMissileDBObject* missileDBObj = ! dynamic_cast<tcMissileDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = missileDBObj->mfRange_km; *************** *** 502,511 **** } else if (tcBallisticDBObject* ballisticDBObj = ! dynamic_cast<tcBallisticDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = 20; } else if (tcTorpedoDBObject* torpDBObj = ! dynamic_cast<tcTorpedoDBObject*>(pLauncherData->mpChildDBObj)) { info.mfRange_km = torpDBObj->mfRange_km; --- 514,523 ---- } else if (tcBallisticDBObject* ballisticDBObj = ! dynamic_cast<tcBallisticDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = 20; } else if (tcTorpedoDBObject* torpDBObj = ! dynamic_cast<tcTorpedoDBObject*>(pLauncher->mpChildDBObj)) { info.mfRange_km = torpDBObj->mfRange_km; *************** *** 513,530 **** } else { ! fprintf(stderr, "Error - unsupported launcher child class (%s)\n", ! pLauncherData->mpChildDBObj->GetClassName()); return false; } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncherData->mnUncommitted; ! info.mnTargetFlags = pLauncherData->mnTargetFlags; ! if (pLauncherData->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; } ! else if (pLauncherData->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; --- 525,542 ---- } else { ! //fprintf(stderr, "Error - unsupported launcher child class (%s)\n", ! // pLauncher->mpChildDBObj->GetClassName()); return false; } info.mnLauncher = anLauncher; ! info.mnQuantity = pLauncher->mnUncommitted; ! info.mnTargetFlags = pLauncher->mnTargetFlags; ! if (pLauncher->meLaunchMode == DATUM_ONLY) { info.mnLaunchMode = 0; } ! else if (pLauncher->meLaunchMode == SEEKER_TRACK) { info.mnLaunchMode = 1; Index: tcPlatformInterfaceExtension.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterfaceExtension.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcPlatformInterfaceExtension.cpp 2 Mar 2005 22:28:44 -0000 1.15 --- tcPlatformInterfaceExtension.cpp 10 Mar 2005 03:28:29 -0000 1.16 *************** *** 58,61 **** --- 58,64 ---- .def("IsSurface", &tcTrack::IsSurface) .def("IsGround", &tcTrack::IsGround) + .def("IsSub", &tcTrack::IsSub) + .def("IsTorpedo", &tcTrack::IsTorpedo) + .def("IsBearingOnly", &tcTrack::IsBearingOnly) .def("IsValid", &tcTrack::IsValid) .def("Offset", &tcTrack::Offset) *************** *** 77,80 **** --- 80,86 ---- .def("IsSurface", &tcSensorMapTrack::IsSurface) .def("IsGround", &tcSensorMapTrack::IsGround) + .def("IsSub", &tcSensorMapTrack::IsSub) + .def("IsTorpedo", &tcSensorMapTrack::IsTorpedo) + .def("IsBearingOnly", &tcSensorMapTrack::IsBearingOnly) .def("IsValid", &tcSensorMapTrack::IsValid) .def("Offset", &tcSensorMapTrack::Offset) |
|
From: Dewitt C. <ddc...@us...> - 2005-03-08 00:42:31
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/scripts Modified Files: AI.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** AI.py 2 Mar 2005 22:28:41 -0000 1.18 --- AI.py 8 Mar 2005 00:41:48 -0000 1.19 *************** *** 567,577 **** # modified this to adjust altitude based on altitude of landing # site ! def LandHelo(UI,dest_id): if (not UI.IsHelo()): UI.DisplayMessage('LandHelo called with non-helo unit') return ! # 0 - init, 1 - distant, 2 - init approach, 3 - final approach ! land_state = UI.GetVar(0) track_info = UI.GetTrackById(dest_id) --- 567,597 ---- # modified this to adjust altitude based on altitude of landing # site ! def LandHelo(TI): ! UI = TI.GetPlatformInterface() ! BB = TI.GetBlackboardInterface() ! ! if (not GetConnControl(BB)): ! return ! ! iteration = TI.GetMemoryValue(1) # will return 0 first time ! if (iteration == 0): # do initialization ! TI.SetMemoryText('Description', 'Land at designated airbase') ! TI.SetMemoryValue(2, 0) # 0 - init, 1 - distant, 2 - init approach, 3 - final approach ! dest_name = BB.ReadMessage('LandingTarget') ! dest_id = UI.LookupFriendlyId(dest_name) ! TI.SetMemoryValue(3, dest_id) ! ! iteration = iteration + 1 ! TI.SetMemoryValue(1, iteration) ! ! if (not UI.IsHelo()): UI.DisplayMessage('LandHelo called with non-helo unit') + TI.EndTask() return ! # 0 - init, 1 - distant, 2 - init approach, 3 - final approach ! land_state = TI.GetMemoryValue(2) ! dest_id = long(TI.GetMemoryValue(3)) track_info = UI.GetTrackById(dest_id) *************** *** 579,583 **** if (track_info.ID == -1): UI.DisplayMessage('Bad track ID for landing') ! UI.CompletedOrder() return # invalid id --- 599,603 ---- if (track_info.ID == -1): UI.DisplayMessage('Bad track ID for landing') ! TI.EndTask() return # invalid id *************** *** 585,589 **** if (landing_data.ID == -1): UI.DisplayMessage('Invalid landing platform') ! UI.CompletedOrder() return # invalid id --- 605,609 ---- if (landing_data.ID == -1): UI.DisplayMessage('Invalid landing platform') ! TI.EndTask() return # invalid id *************** *** 592,595 **** --- 612,618 ---- track_info.Alt = landing_data.Alt + + alt_m = track_info.Alt + # adjust track location based on approach state if (land_state <= 1): *************** *** 599,603 **** UI.SetAlt(300 + alt_m) SetFractionalSpeed(UI, 0.7) ! UI.SetVar(0, 1) elif (land_state == 2): UI.SetSpeed(track_info.Speed + 5) --- 622,626 ---- UI.SetAlt(300 + alt_m) SetFractionalSpeed(UI, 0.7) ! TI.SetMemoryValue(2, 1) elif (land_state == 2): UI.SetSpeed(track_info.Speed + 5) *************** *** 617,626 **** elif (land_state == 2) and (TTI <= 1): land_state = 3 ! UI.SetVar(0, land_state) ! UI.SetUpdate(3) elif (TTI <= 20): ! UI.SetUpdate(3) else: ! UI.SetUpdate(10) # this version iterates through all tracks --- 640,655 ---- elif (land_state == 2) and (TTI <= 1): land_state = 3 ! TI.SetMemoryValue(2, land_state) ! TI.SetUpdateInterval(3) elif (TTI <= 20): ! TI.SetUpdateInterval(3) else: ! TI.SetUpdateInterval(10) ! ! ! ! ! ! # this version iterates through all tracks |
|
From: Dewitt C. <ddc...@us...> - 2005-03-08 00:42:28
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/include/sim Modified Files: tcAirObject.h tcGameObject.h tcSimState.h tcSubObject.h tcSurfaceObject.h Log Message: Index: tcGameObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGameObject.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcGameObject.h 24 Feb 2005 22:19:14 -0000 1.31 --- tcGameObject.h 8 Mar 2005 00:41:47 -0000 1.32 *************** *** 138,141 **** --- 138,142 ---- virtual bool HasNewCommand() const; virtual bool HasUnacknowledgedCommand() const; + virtual bool IsDestroyed(); virtual void LoadFromFile(tcFile& file); Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSubObject.h 2 Dec 2004 04:17:24 -0000 1.2 --- tcSubObject.h 8 Mar 2005 00:41:47 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- virtual void ApplyRestrictions(); virtual void Clear(); + virtual bool IsDestroyed(); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void UpdateClimb(float dt_s); *************** *** 82,86 **** --- 83,89 ---- float periscopeDepth_m; ///< periscope depth (positive number) float lastDepth_m; ///< for depth notification messages + bool doneSinking; + void UpdateDestroyed(double t); virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); Index: tcAirObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcAirObject.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcAirObject.h 7 Nov 2004 03:40:43 -0000 1.12 --- tcAirObject.h 8 Mar 2005 00:41:47 -0000 1.13 *************** *** 51,55 **** virtual void ApplyRestrictions(); ! virtual void Clear(void); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void SetLandingState(int state); --- 51,56 ---- virtual void ApplyRestrictions(); ! virtual void Clear(); ! virtual bool IsDestroyed(); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void SetLandingState(int state); *************** *** 80,87 **** --- 81,90 ---- tcCommandObject commandObj; + virtual void UpdateDestroyed(double t); virtual void UpdateEffects(); virtual void UpdateHeading(float dt_s); virtual void UpdateSpeed(float dt_s); float maxPitch_rad; ///< user imposed restriction to pitch angle + bool doneCrashing; }; Index: tcSurfaceObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSurfaceObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcSurfaceObject.h 17 Aug 2004 02:22:56 -0000 1.9 --- tcSurfaceObject.h 8 Mar 2005 00:41:48 -0000 1.10 *************** *** 45,49 **** tcGenericDBObject *mpDBObject; ! virtual void Clear(void); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void Update(double afStatusTime); --- 45,50 ---- tcGenericDBObject *mpDBObject; ! virtual void Clear(); ! virtual bool IsDestroyed(); virtual void RandInitNear(float afLon_deg, float afLat_deg); virtual void Update(double afStatusTime); *************** *** 64,67 **** --- 65,71 ---- virtual void ApplyRestrictions(void); virtual void UpdateClimb(float dt_s) {} // do nothing for surface objs + virtual void UpdateDestroyed(double t); + + bool doneSinking; }; Index: tcSimState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSimState.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** tcSimState.h 2 Mar 2005 22:28:40 -0000 1.34 --- tcSimState.h 8 Mar 2005 00:41:47 -0000 1.35 *************** *** 150,154 **** tcGameObject* GetObject(tnPoolIndex anKey); tcGameObject* GetObjectByName(const std::string& unitName); ! int GetPlatformsWithinRegion(tnPoolIndex *apKeyList, int anLength, tcRect *apRegion); long GetRandomPlatform(); int GetSeekerTrack(long anKey, tcTrack& track); --- 150,154 ---- tcGameObject* GetObject(tnPoolIndex anKey); tcGameObject* GetObjectByName(const std::string& unitName); ! void GetPlatformsWithinRegion(std::vector<long>& keyList, tcRect *apRegion); long GetRandomPlatform(); int GetSeekerTrack(long anKey, tcTrack& track); |
|
From: Dewitt C. <ddc...@us...> - 2005-03-08 00:42:03
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/src/sim Modified Files: tcAirObject.cpp tcGameObject.cpp tcHeloObject.cpp tcPositionRegistry.cpp tcSimState.cpp tcSonar.cpp tcSubObject.cpp tcSurfaceObject.cpp tcTorpedoObject.cpp Log Message: Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSubObject.cpp 4 Mar 2005 00:46:18 -0000 1.4 --- tcSubObject.cpp 8 Mar 2005 00:41:51 -0000 1.5 *************** *** 106,109 **** --- 106,115 ---- } + bool tcSubObject::IsDestroyed() + { + return (mfDamageLevel >= 1.0f) && doneSinking; + } + + /** * *************** *** 345,348 **** --- 351,384 ---- } + + void tcSubObject::UpdateDestroyed(double t) + { + float dt_s = (float)(t - mfStatusTime); + + if (mcKin.mfSpeed_kts >= 12.0f) + { + mcKin.mfSpeed_kts += 1.0f * dt_s; + } + else + { + mcKin.mfSpeed_kts = 12.0f; + } + + if (mcKin.mfClimbAngle_rad > -0.3f) + { + mcKin.mfClimbAngle_rad -= 0.1f * dt_s; + } + + mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; + + + if (mcKin.mfAlt_m <= mcTerrain.mfHeight_m + 5.0f) + { + doneSinking = true; + } + + Move(dt_s); + } + /** * *************** *** 461,464 **** --- 497,508 ---- wxASSERT(mpDBObject); + if (mfDamageLevel >= 1.0f) + { + UpdateDestroyed(afStatusTime); + mfStatusTime = afStatusTime; + return; + } + + UpdateFormationGuidance(); // formation heading/speed calculation *************** *** 504,508 **** : tcPlatformObject(obj), maxPitch_rad(0.5), ! periscopeDepth_m(18) { mpDBObject = obj; --- 548,553 ---- : tcPlatformObject(obj), maxPitch_rad(0.5), ! periscopeDepth_m(18), ! doneSinking(false) { mpDBObject = obj; Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** tcSimState.cpp 7 Mar 2005 01:54:19 -0000 1.70 --- tcSimState.cpp 8 Mar 2005 00:41:50 -0000 1.71 *************** *** 477,481 **** float rLon = rLat / cosf(weapon->mcKin.mfLat_rad); ! long blastPlats[16]; tcRect blastRegion; --- 477,481 ---- float rLon = rLat / cosf(weapon->mcKin.mfLat_rad); ! std::vector<long> blastPlats; tcRect blastRegion; *************** *** 488,492 **** blastRegion.Set(west, east, south, north); ! int nPlats = GetPlatformsWithinRegion(blastPlats, 16, &blastRegion); float fDamage = weapon->GetDamage(); --- 488,493 ---- blastRegion.Set(west, east, south, north); ! GetPlatformsWithinRegion(blastPlats, &blastRegion); ! int nPlats = (int)blastPlats.size(); float fDamage = weapon->GetDamage(); *************** *** 884,888 **** { maPlatformState.GetNextAssoc(cmappos, nKey, obj); ! if (obj->mfDamageLevel >= 1.0f) { DeleteObject(nKey); --- 885,889 ---- { maPlatformState.GetNextAssoc(cmappos, nKey, obj); ! if (obj->IsDestroyed()) { DeleteObject(nKey); *************** *** 1127,1130 **** --- 1128,1132 ---- void tcSimState::UpdateSurveillance(tcGameObject *applat, tcSensorState *apSensorState) { + #if 0 tnPoolIndex aTargetKeys[100]; tnPoolIndex nTargetID; *************** *** 1135,1138 **** --- 1137,1141 ---- wxASSERT(false); // deprecated + apSensorState->GetTestArea(region); nCount = GetPlatformsWithinRegion(aTargetKeys, 100, ®ion); *************** *** 1155,1158 **** --- 1158,1162 ---- } } + #endif } *************** *** 1163,1167 **** { wxASSERT(false); // deprecated? ! tnPoolIndex aTargetKeys[N_TARGET_KEYS]; tnPoolIndex aFCKeys[N_FC_KEYS]; --- 1167,1171 ---- { wxASSERT(false); // deprecated? ! #if 0 tnPoolIndex aTargetKeys[N_TARGET_KEYS]; tnPoolIndex aFCKeys[N_FC_KEYS]; *************** *** 1206,1209 **** --- 1210,1214 ---- } } + #endif } *************** *** 1331,1334 **** --- 1336,1340 ---- wxASSERT(false); + #if 0 long nTargetID; GeoPoint currentpos; *************** *** 1435,1438 **** --- 1441,1445 ---- break; } + #endif } *************** *** 2084,2088 **** * */ ! int tcSimState::GetPlatformsWithinRegion(tnPoolIndex *apKeyList, int anLength, tcRect *apRegion) { tcGameObject *pplat; --- 2091,2095 ---- * */ ! void tcSimState::GetPlatformsWithinRegion(std::vector<long>& keyList, tcRect *apRegion) { tcGameObject *pplat; *************** *** 2096,2110 **** if (positionRegistry) { ! std::vector<long>& idVect = positionRegistry->GetAllWithinRegion(apRegion->GetLeft(), apRegion->GetRight(), apRegion->GetBottom(), apRegion->GetTop()); ! for (size_t k=0; k<idVect.size(); k++) ! { ! apKeyList[nListIndex++] = idVect[k]; ! } ! return nListIndex; } ! for (tnPoolIndex i=0;(i<nSize)&&(nListIndex<anLength);i++) { maPlatformState.GetNextAssoc(cmappos,nKey,pplat); --- 2103,2114 ---- if (positionRegistry) { ! keyList = positionRegistry->GetAllWithinRegion(apRegion->GetLeft(), apRegion->GetRight(), apRegion->GetBottom(), apRegion->GetTop()); ! ! return; } ! for (tnPoolIndex i=0; (i<nSize); i++) { maPlatformState.GetNextAssoc(cmappos,nKey,pplat); *************** *** 2113,2120 **** if (GeoWithinRegion(p,apRegion)) { ! apKeyList[nListIndex++]=nKey; } } - return nListIndex; } --- 2117,2123 ---- if (GeoWithinRegion(p,apRegion)) { ! keyList.push_back(nKey); } } } Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcAirObject.cpp 16 Feb 2005 23:13:49 -0000 1.17 --- tcAirObject.cpp 8 Mar 2005 00:41:50 -0000 1.18 *************** *** 101,104 **** --- 101,110 ---- } + bool tcAirObject::IsDestroyed() + { + return (mfDamageLevel >= 1.0f) && doneCrashing; + } + + void tcAirObject::RandInitNear(float afLon_deg, float afLat_deg) { *************** *** 259,262 **** --- 265,297 ---- } + + void tcAirObject::UpdateDestroyed(double t) + { + float dt_s = (float)(t - mfStatusTime); + + if (mcKin.mfSpeed_kts >= 450.0f) + { + mcKin.mfSpeed_kts += 20.0f * dt_s; + } + + if (mcKin.mfClimbAngle_rad > -0.3f) + { + mcKin.mfClimbAngle_rad -= 0.1f * dt_s; + } + + mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; + mcKin.mfRoll_rad += 0.01f * dt_s; + + if (mcKin.mfAlt_m <= mcTerrain.mfHeight_m + 25.0f) + { + doneCrashing = true; + } + + Move(dt_s); + } + + + + void tcAirObject::UpdateEffects() { *************** *** 363,366 **** --- 398,408 ---- wxASSERT(mpDBObject); + if (mfDamageLevel >= 1.0f) + { + UpdateDestroyed(afStatusTime); + mfStatusTime = afStatusTime; + return; + } + UpdateFormationGuidance(); // formation heading/speed calculation *************** *** 400,404 **** */ tcAirObject::tcAirObject(tcGenericDBObject *obj) ! : tcPlatformObject(obj) { mpDBObject = obj; --- 442,447 ---- */ tcAirObject::tcAirObject(tcGenericDBObject *obj) ! : tcPlatformObject(obj), ! doneCrashing(false) { mpDBObject = obj; Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSonar.cpp 7 Mar 2005 01:54:19 -0000 1.8 --- tcSonar.cpp 8 Mar 2005 00:41:50 -0000 1.9 *************** *** 452,503 **** tcSensorMapTrack *pSMTrack = 0; ! wxASSERT(simState); bool bAccept = simState->mcSensorMap.UpdatePassiveReport(pReport, parent->mnID, target->mnID, pSMTrack, parent->mnAlliance); ! // update passive report if update needed (if bAccept) ! if (bAccept) ! { ! bool bNewReport = pReport->IsNew(); ! bool bNewDetection = pSMTrack->IsNew(); ! if (bNewReport) {pReport->mfStartTime = t;} // new detection report ! double fTrackLife = pReport->mfTimestamp - pReport->mfStartTime; pReport->mfLat_rad = (float)parent->mcKin.mfLat_rad; pReport->mfLon_rad = (float)parent->mcKin.mfLon_rad; pReport->mfHeading_rad = az_rad; ! pReport->mnFlags = TRACK_BEARING_ONLY | TRACK_HEADING_VALID; ! ! pReport->mfTimestamp = t; ! pReport->mnSensorPlatformID = parent->mnID; ! pReport->mnTrackID = target->mnID; ! ! ! if ((!pReport->mbClassified) && (fTrackLife > 20.0)) { ! wxASSERT(target->mpDBObject); ! unsigned int nClassification = target->mpDBObject->mnType; ! nClassification &= 0xFFF0; // leave size field unknown ! teAffiliation eAffil = UNKNOWN; ! if (nClassification & PTYPE_TORPEDO) {eAffil = HOSTILE;} ! pSMTrack->UpdateClassification(nClassification, eAffil, NULL_INDEX); ! pReport->mbClassified = 1; } ! if (bNewDetection) { ! pSMTrack->UpdateTrack(); ! if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) ! { ! tcSound::Get()->PlayEffect("shishding"); ! } ! fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" ! " at time %.1f (%.1f dB) (a:%d)\n", ! parent->mzUnit.mz, parent->mzClass.mz, target->mnID, target->mzClass.mz, ! range_km, t, last_snr_excess, parent->mnAlliance); } } } --- 452,519 ---- tcSensorMapTrack *pSMTrack = 0; ! wxASSERT(simState); bool bAccept = simState->mcSensorMap.UpdatePassiveReport(pReport, parent->mnID, target->mnID, pSMTrack, parent->mnAlliance); ! if (!bAccept) return; ! ! bool bNewReport = pReport->IsNew(); ! bool bNewDetection = pSMTrack->IsNew(); ! if (bNewReport) {pReport->mfStartTime = t;} // new detection report ! double fTrackLife = pReport->mfTimestamp - pReport->mfStartTime; ! ! bool bTriangulated = (fTrackLife > 60.0f) && (pSMTrack->mnContributors > 1); + if (!bTriangulated) + { pReport->mfLat_rad = (float)parent->mcKin.mfLat_rad; pReport->mfLon_rad = (float)parent->mcKin.mfLon_rad; pReport->mfHeading_rad = az_rad; ! pReport->mnFlags = TRACK_BEARING_ONLY; ! } ! else ! { ! pReport->mfLat_rad = (float)target->mcKin.mfLat_rad; ! pReport->mfLon_rad = (float)target->mcKin.mfLon_rad; ! pReport->mnFlags = TRACK_TRIANGULATED; ! if (fTrackLife > 90.0f) { ! pReport->mfHeading_rad = target->mcKin.mfHeading_rad; ! pReport->mfSpeed_kts = target->mcKin.mfSpeed_kts; ! pReport->mnFlags |= (TRACK_SPEED_VALID | TRACK_HEADING_VALID); } + } + pReport->mfTimestamp = t; + pReport->mnSensorPlatformID = parent->mnID; + pReport->mnTrackID = target->mnID; ! ! if ((!pReport->mbClassified) && (fTrackLife > 20.0)) ! { ! wxASSERT(target->mpDBObject); ! unsigned int nClassification = target->mpDBObject->mnType; ! nClassification &= 0xFFF0; // leave size field unknown ! teAffiliation eAffil = UNKNOWN; ! if (nClassification & PTYPE_TORPEDO) {eAffil = HOSTILE;} ! pSMTrack->UpdateClassification(nClassification, eAffil, NULL_INDEX); ! pReport->mbClassified = 1; ! } ! ! ! if (bNewDetection) ! { ! pSMTrack->UpdateTrack(); ! if (simState->mpUserInfo->IsOwnAlliance(parent->mnAlliance)) { ! tcSound::Get()->PlayEffect("shishding"); } + fprintf(stdout, "%s (%s): target %d (%s) detected by passive sonar at %3.1f km" + " at time %.1f (%.1f dB) (a:%d)\n", + parent->mzUnit.mz, parent->mzClass.mz, target->mnID, target->mzClass.mz, + range_km, t, last_snr_excess, parent->mnAlliance); } + } *************** *** 546,551 **** void tcSonar::UpdateTrack(const tcGameObject* target, double t) { ! if (isPassive) { float bearingRate = parent->mcKin.BearingRateTo(last_range_km, last_az_rad, --- 562,568 ---- void tcSonar::UpdateTrack(const tcGameObject* target, double t) { + bool cheatPassive = last_range_km <= 2.0f; ! if (isPassive && !cheatPassive) { float bearingRate = parent->mcKin.BearingRateTo(last_range_km, last_az_rad, Index: tcSurfaceObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSurfaceObject.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcSurfaceObject.cpp 24 Feb 2005 22:19:16 -0000 1.16 --- tcSurfaceObject.cpp 8 Mar 2005 00:41:51 -0000 1.17 *************** *** 86,89 **** --- 86,96 ---- if (mpDBObject == NULL) {return;} + if (mfDamageLevel >= 1.0f) + { + UpdateDestroyed(afStatusTime); + mfStatusTime = afStatusTime; + return; + } + UpdateFormationGuidance(); // formation heading/speed calculation *************** *** 107,115 **** } void tcSurfaceObject::UpdateEffects() { if (model) { ! if (mfDamageLevel > 0.1f) { model->SetSmokeMode(tcParticleEffect::DAMAGE); --- 114,147 ---- } + void tcSurfaceObject::UpdateDestroyed(double t) + { + float dt_s = (float)(t - mfStatusTime); + + if (mcKin.mfSpeed_kts >= 0.5f) + { + mcKin.mfSpeed_kts -= 1.0f * dt_s; + } + else + { + mcKin.mfSpeed_kts = 0; + } + + mcKin.mfAlt_m -= 0.1f * dt_s; + mcKin.mfRoll_rad += 0.01f * dt_s; + mcKin.mfPitch_rad += 0.001f * dt_s; + + if (mcKin.mfAlt_m <= -20.0f) + { + doneSinking = true; + } + + Move(dt_s); + } + void tcSurfaceObject::UpdateEffects() { if (model) { ! if ((mfDamageLevel > 0.1f) && (mcKin.mfAlt_m > -10.0f)) { model->SetSmokeMode(tcParticleEffect::DAMAGE); *************** *** 125,129 **** /******************************************************************************/ ! void tcSurfaceObject::Clear(void) { tcPlatformObject::Clear(); --- 157,161 ---- /******************************************************************************/ ! void tcSurfaceObject::Clear() { tcPlatformObject::Clear(); *************** *** 131,134 **** --- 163,171 ---- } + bool tcSurfaceObject::IsDestroyed() + { + return (mfDamageLevel >= 1.0f) && doneSinking; + } + /******************************************************************************/ *************** *** 207,211 **** tcSurfaceObject::tcSurfaceObject(tcGenericDBObject *obj) ! : tcPlatformObject(obj) { mpDBObject = obj; --- 244,249 ---- tcSurfaceObject::tcSurfaceObject(tcGenericDBObject *obj) ! : tcPlatformObject(obj), ! doneSinking(false) { mpDBObject = obj; Index: tcHeloObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcHeloObject.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcHeloObject.cpp 31 Jan 2005 01:33:09 -0000 1.3 --- tcHeloObject.cpp 8 Mar 2005 00:41:50 -0000 1.4 *************** *** 178,181 **** --- 178,183 ---- UpdateSensors(afStatusTime); + UpdateAI(afStatusTime); + mfStatusTime = afStatusTime; } Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcTorpedoObject.cpp 7 Mar 2005 01:54:19 -0000 1.7 --- tcTorpedoObject.cpp 8 Mar 2005 00:41:51 -0000 1.8 *************** *** 137,141 **** else { ! runToEnable_m = 1000.0f * mcKin.RangeToKm(&waypoint); } --- 137,141 ---- else { ! runToEnable_m = 500.0f * mcKin.RangeToKm(&waypoint); // enable halfway to waypoint } *************** *** 246,259 **** UpdateSpeedSimple(dt_s); ! float speed_mps = C_KTSTOMPS * cosf(mcKin.mfClimbAngle_rad) * mcKin.mfSpeed_kts; float disp_m = speed_mps * dt_s; // distance moved this update float disp_rad = C_MTORAD * disp_m; // distance in equator radians runToEnable_m -= disp_m; float heading_rad = mcKin.mfHeading_rad; ! mcKin.mfLon_rad += disp_rad * (double)(sinf(heading_rad) / cosf((float)mcKin.mfLat_rad)); ! mcKin.mfLat_rad += (double)cosf(heading_rad) * disp_rad; ! mcKin.mfAlt_m += sinf(mcKin.mfClimbAngle_rad) * disp_m; --- 246,261 ---- UpdateSpeedSimple(dt_s); ! float speed_mps = C_KTSTOMPS * mcKin.mfSpeed_kts; float disp_m = speed_mps * dt_s; // distance moved this update float disp_rad = C_MTORAD * disp_m; // distance in equator radians runToEnable_m -= disp_m; + float disp_xy_rad = disp_rad * cosf(mcKin.mfClimbAngle_rad); + float disp_z_m = disp_m * sinf(mcKin.mfClimbAngle_rad); float heading_rad = mcKin.mfHeading_rad; ! mcKin.mfLon_rad += disp_xy_rad * (double)(sinf(heading_rad) / cosf((float)mcKin.mfLat_rad)); ! mcKin.mfLat_rad += (double)cosf(heading_rad) * disp_xy_rad; ! mcKin.mfAlt_m += disp_z_m; Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcGameObject.cpp 24 Feb 2005 22:19:16 -0000 1.29 --- tcGameObject.cpp 8 Mar 2005 00:41:50 -0000 1.30 *************** *** 176,179 **** --- 176,185 ---- } + bool tcGameObject::IsDestroyed() + { + return (mfDamageLevel >= 1.0f); + } + + /** * Used to decide when to display info messages and play sound Index: tcPositionRegistry.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPositionRegistry.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcPositionRegistry.cpp 4 Mar 2005 00:46:18 -0000 1.1 --- tcPositionRegistry.cpp 8 Mar 2005 00:41:50 -0000 1.2 *************** *** 229,233 **** twopi(6.283185307179586), piovertwo(1.570796326794897), ! binWidth(0.25 * 0.017453293) // 0.25 degrees lon/lat { invBinWidth = 1.0 / binWidth; --- 229,233 ---- twopi(6.283185307179586), piovertwo(1.570796326794897), ! binWidth(0.2 * 0.017453293) // 0.2 degrees lon/lat { invBinWidth = 1.0 / binWidth; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-08 00:42:00
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10870/src/graphics Modified Files: ObjectUpdater.cpp tcMessageCenter.cpp Log Message: Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcMessageCenter.cpp 7 Mar 2005 01:54:19 -0000 1.4 --- tcMessageCenter.cpp 8 Mar 2005 00:41:49 -0000 1.5 *************** *** 196,200 **** : tc3DWindow(parent, pos, size, name, 0), activeChannelName(""), ! popupBase(180, 70), popupCount(0) { --- 196,200 ---- : tc3DWindow(parent, pos, size, name, 0), activeChannelName(""), ! popupBase(205, 70), popupCount(0) { Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ObjectUpdater.cpp 27 Jan 2005 01:01:48 -0000 1.13 --- ObjectUpdater.cpp 8 Mar 2005 00:41:48 -0000 1.14 *************** *** 211,216 **** roll = pos->roll; x = pos->dx; ! y = -pos->dz; ! z = pos->dy; isVisible = pos->isVisible; } --- 211,216 ---- roll = pos->roll; x = pos->dx; ! y = pos->dy; ! z = pos->dz; isVisible = pos->isVisible; } |
|
From: Dewitt C. <ddc...@us...> - 2005-03-07 01:54:29
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31072/src/common Modified Files: simmath.cpp Log Message: Passive sonar seeker work Index: simmath.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/simmath.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** simmath.cpp 24 Feb 2005 22:19:15 -0000 1.21 --- simmath.cpp 7 Mar 2005 01:54:19 -0000 1.22 *************** *** 339,345 **** bool bAltValid = (mnFlags & TRACK_ALT_VALID) != 0; bool bClimbValid = (mnFlags & TRACK_CLIMB_VALID) != 0; ! if (bHeadingValid) {td.mfHeading_rad = mfHeading_rad;} ! else {td.mfHeading_rad = 0;} if (bSpeedValid && bHeadingValid) --- 339,370 ---- bool bAltValid = (mnFlags & TRACK_ALT_VALID) != 0; bool bClimbValid = (mnFlags & TRACK_CLIMB_VALID) != 0; + bool bearingRateValid = (mnFlags & TRACK_BEARINGRATE_VALID) != 0; + bool isBearingOnly = (mnFlags & TRACK_BEARING_ONLY) != 0; ! if (isBearingOnly) ! { ! if (bearingRateValid) ! { ! const float dh_max = C_PIOVER180 * 15.0f; ! const float dh_min = -C_PIOVER180 * 15.0f; ! float dHeading = dt_s * bearingRate_radps; ! if (dHeading < dh_min) dHeading = dh_min; ! else if (dHeading > dh_max) dHeading = dh_max; ! ! td.mfHeading_rad = mfHeading_rad + dHeading; ! } ! else ! { ! td.mfHeading_rad = mfHeading_rad; ! } ! } ! else if (bHeadingValid) ! { ! td.mfHeading_rad = mfHeading_rad; ! } ! else ! { ! td.mfHeading_rad = 0; ! } if (bSpeedValid && bHeadingValid) *************** *** 378,381 **** --- 403,407 ---- } + td.bearingRate_radps = bearingRate_radps; // for bearing only tracks, copy rate td.mnFlags = mnFlags; td.mnID = mnID; *************** *** 530,544 **** } ! // returns radian heading to track float tcKinematics::HeadingToTrack(const tcTrack& track) { return nsNav::GCHeadingApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)track.mfLat_rad,(float)track.mfLon_rad); } ! // returns radian heading to (lat,lon) point float tcKinematics::HeadingToGeoRad(const GeoPoint *apGeoPoint) { return nsNav::GCHeadingApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)apGeoPoint->mfLat_rad,(float)apGeoPoint->mfLon_rad); } ! // returns range in km float tcKinematics::RangeToKm(tcKinematics& k) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, --- 556,598 ---- } ! /** ! * @return bearing rate to track in radians per second ! * Ignores altitude difference ! * @param range_km range to target ! * @param bearing_rad bearing to target ! * @param speet_kts target speed ! * @param heading_rad target heading ! */ ! float tcKinematics::BearingRateTo(float range_km, float bearing_rad, float speed_kts, float heading_rad) ! { ! float inv_range = 1.0f / range_km; ! float dx = sinf(bearing_rad) * inv_range; ! float dy = cosf(bearing_rad) * inv_range; ! ! float dvx = C_KTSTOKMPS * (sinf(heading_rad) * speed_kts - ! sinf(mfHeading_rad) * mfSpeed_kts); ! float dvy = C_KTSTOKMPS * (cosf(heading_rad) * speed_kts - ! cosf(mfHeading_rad) * mfSpeed_kts); ! ! return ((dy * dvx) - (dx * dvy)); ! } ! ! /** ! * @returns radian heading to track ! */ float tcKinematics::HeadingToTrack(const tcTrack& track) { return nsNav::GCHeadingApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)track.mfLat_rad,(float)track.mfLon_rad); } ! /** ! * @returns radian heading to (lat,lon) point ! */ float tcKinematics::HeadingToGeoRad(const GeoPoint *apGeoPoint) { return nsNav::GCHeadingApprox_rad((float)mfLat_rad,(float)mfLon_rad, (float)apGeoPoint->mfLat_rad,(float)apGeoPoint->mfLon_rad); } ! /** ! * @returns range in km ! */ float tcKinematics::RangeToKm(tcKinematics& k) { return C_RADTOKM * nsNav::GCDistanceApprox_rad((float)mfLat_rad,(float)mfLon_rad, |
|
From: Dewitt C. <ddc...@us...> - 2005-03-07 01:54:29
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31072/src/sim Modified Files: tcSimState.cpp tcSonar.cpp tcTorpedoObject.cpp Log Message: Passive sonar seeker work Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** tcSimState.cpp 5 Mar 2005 22:38:03 -0000 1.69 --- tcSimState.cpp 7 Mar 2005 01:54:19 -0000 1.70 *************** *** 413,418 **** if (tclosest > 0.3) return; // defer until future time step ! float trueRange2 = dx*dx + dy*dy + dz*dz; ! if (trueRange2 < 64.0f) // 8.0 m range { float fDamage = torp->mpDBObject->mfDamage; --- 413,418 ---- if (tclosest > 0.3) return; // defer until future time step ! float trueRange2 = dx*dx + dy*dy + 0.5*dz*dz; ! if (trueRange2 < 144.0f) // 12.0 m range, dz not counted as heavily { float fDamage = torp->mpDBObject->mfDamage; Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcTorpedoObject.cpp 2 Mar 2005 22:28:45 -0000 1.6 --- tcTorpedoObject.cpp 7 Mar 2005 01:54:19 -0000 1.7 *************** *** 304,308 **** mfDamageLevel = 1.0f; tcString s; ! s.Format("Object %s hit bottom at time %.1f lon %.3f, lat %.3f", mzUnit.mz,afStatusTime,mcKin.mfLon_rad*C_180OVERPI,mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); --- 304,308 ---- mfDamageLevel = 1.0f; tcString s; ! s.Format("Torpedo %s hit bottom at time %.1f lon %.3f, lat %.3f", mzUnit.mz,afStatusTime,mcKin.mfLon_rad*C_180OVERPI,mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); *************** *** 317,321 **** mfDamageLevel = 1.0f; // self-destruct tcString s; ! s.Format("Object %s shut down at time %.1f lon %.3f, lat %.3f", mzUnit.mz,afStatusTime,mcKin.mfLon_rad*C_180OVERPI,mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); --- 317,321 ---- mfDamageLevel = 1.0f; // self-destruct tcString s; ! s.Format("Torpedo %s shut down at time %.1f lon %.3f, lat %.3f", mzUnit.mz,afStatusTime,mcKin.mfLon_rad*C_180OVERPI,mcKin.mfLat_rad*C_180OVERPI); WTL(s.GetBuffer()); *************** *** 410,414 **** const float one_over_torpedo_acz = 1.0f / 50.0f; ! if ((t - lastGuidanceUpdate) < guidanceUpdateInterval) return; lastGuidanceUpdate = t; --- 410,415 ---- const float one_over_torpedo_acz = 1.0f / 50.0f; ! float dt_s = t - lastGuidanceUpdate; ! if (dt_s < guidanceUpdateInterval) return; lastGuidanceUpdate = t; *************** *** 430,449 **** guidanceUpdateInterval = 0.5f; ! if (seeker.mnMode == SSMODE_SEEKERTRACK) ! { if (seeker.mcTrack.mnFlags & TRACK_BEARING_ONLY) { ! goalHeading_rad = seeker.mcTrack.mfHeading_rad; // bearing in this case ! goalDepth_m = -seeker.mcTrack.mfAlt_m; } else { - tcTrack predictedtrack; - float tti_s; - float range_km; - - goalDepth_m = -seeker.mcTrack.mfAlt_m; - seeker.mcTrack.GetPrediction(predictedtrack, t); - mcKin.GetInterceptData3D(predictedtrack, goalHeading_rad, interceptPitch_rad, tti_s, range_km); --- 431,455 ---- guidanceUpdateInterval = 0.5f; ! if (seeker.mnMode == SSMODE_SEEKERTRACK) ! { ! tcTrack predictedtrack; ! float tti_s; ! float range_km; ! ! goalDepth_m = -seeker.mcTrack.mfAlt_m; ! seeker.mcTrack.GetPrediction(predictedtrack, t); ! if (seeker.mcTrack.mnFlags & TRACK_BEARING_ONLY) { ! goalHeading_rad = predictedtrack.mfHeading_rad; // bearing in this case ! ! // attempt to lead target (ad-hoc intercept course) ! if (predictedtrack.mnFlags & TRACK_BEARINGRATE_VALID) ! { ! goalHeading_rad += 0.5f * predictedtrack.bearingRate_radps; ! } } else { mcKin.GetInterceptData3D(predictedtrack, goalHeading_rad, interceptPitch_rad, tti_s, range_km); *************** *** 461,474 **** break; case SEARCH_LEFTCIRCLE: ! goalHeading_rad = searchHeading_rad - 0.2f * runTime; goalHeading_rad = fmodf(goalHeading_rad, C_TWOPI) + C_PI; break; case SEARCH_RIGHTCIRCLE: ! goalHeading_rad = searchHeading_rad + 0.2f * runTime; goalHeading_rad = fmodf(goalHeading_rad, C_TWOPI) - C_PI; break; default: break; ! } } else if (seeker.mnMode == SSMODE_SEEKERACQUIRE) --- 467,480 ---- break; case SEARCH_LEFTCIRCLE: ! goalHeading_rad = searchHeading_rad - 0.05f * runTime; goalHeading_rad = fmodf(goalHeading_rad, C_TWOPI) + C_PI; break; case SEARCH_RIGHTCIRCLE: ! goalHeading_rad = searchHeading_rad + 0.05f * runTime; goalHeading_rad = fmodf(goalHeading_rad, C_TWOPI) - C_PI; break; default: break; ! } } else if (seeker.mnMode == SSMODE_SEEKERACQUIRE) Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSonar.cpp 5 Mar 2005 22:38:03 -0000 1.7 --- tcSonar.cpp 7 Mar 2005 01:54:19 -0000 1.8 *************** *** 83,92 **** float TS = 0; // target strength for active case float SLp = 0; // passive source level ! float NL = 10.0f + 0.2f * par_kin->mfSpeed_kts;; // noise level of parent if (const tcSurfaceObject* surfaceObj = dynamic_cast<const tcSurfaceObject*>(target)) { TS = 20.0f; // surfaceObj->mpDBObject->mfRcs_dbsm; ! SLp = 100.0f + 0.5f * tgt_kin->mfSpeed_kts; isSurface = true; } --- 83,92 ---- float TS = 0; // target strength for active case float SLp = 0; // passive source level ! float NL = -10.0f + 0.2f * par_kin->mfSpeed_kts; // noise level of parent if (const tcSurfaceObject* surfaceObj = dynamic_cast<const tcSurfaceObject*>(target)) { TS = 20.0f; // surfaceObj->mpDBObject->mfRcs_dbsm; ! SLp = 100.0f + tgt_kin->mfSpeed_kts; isSurface = true; } *************** *** 94,98 **** { TS = 10; ! SLp = 80 + 0.5f * tgt_kin->mfSpeed_kts; isSubSurface = true; } --- 94,98 ---- { TS = 10; ! SLp = 80.0f + tgt_kin->mfSpeed_kts; isSubSurface = true; } *************** *** 100,104 **** { TS = 0; ! SLp = 90 + 0.5f * tgt_kin->mfSpeed_kts; isSubSurface = true; } --- 100,104 ---- { TS = 0; ! SLp = 120.0f + tgt_kin->mfSpeed_kts; isSubSurface = true; } *************** *** 120,128 **** tgt_kin->mfLat_rad, tgt_kin->mfLon_rad); last_az_rad = fTargetAz_rad; - float fHalfFOV_rad = 0.5f*C_PIOVER180*mpDBObj->mfFieldOfView_deg; - fCoverageAz1 = lookAz_rad - fHalfFOV_rad; - fCoverageAz2 = lookAz_rad + fHalfFOV_rad; - bInSearchVolume = AngleWithinRange(fTargetAz_rad,fCoverageAz1,fCoverageAz2) != 0; if (!bInSearchVolume) { --- 120,136 ---- tgt_kin->mfLat_rad, tgt_kin->mfLon_rad); last_az_rad = fTargetAz_rad; + + if (mpDBObj->mfFieldOfView_deg >= 360.0f) + { + bInSearchVolume = true; + } + else + { + float fHalfFOV_rad = 0.5f*C_PIOVER180*mpDBObj->mfFieldOfView_deg; + fCoverageAz1 = lookAz_rad - fHalfFOV_rad; + fCoverageAz2 = lookAz_rad + fHalfFOV_rad; + bInSearchVolume = AngleWithinRange(fTargetAz_rad,fCoverageAz1,fCoverageAz2) != 0; + } if (!bInSearchVolume) { *************** *** 150,153 **** --- 158,162 ---- } last_snr_excess = excessSNR; + last_range_km = range_km; return excessSNR > 0; *************** *** 294,297 **** --- 303,307 ---- if (CanDetectTarget(ptarget, fRange_km)) { + //fprintf(stdout, "Torpedo %d updating target %d\n", parent->mnID, ptarget->mnID); UpdateTrack(ptarget, t); return; *************** *** 303,306 **** --- 313,317 ---- if (returnToSearch) { + //fprintf(stdout, "Torpedo %d lost target %d\n", parent->mnID, ptarget->mnID); mcTrack.mnID = -1; mnMode = SSMODE_SEEKERSEARCH; *************** *** 364,367 **** --- 375,379 ---- if (minID == -1) return; // no targets found parent->DesignateTarget(minID); // select closest as target + //fprintf(stdout, "Torpedo %d targeting %d\n", parent->mnID, minID); } } *************** *** 529,532 **** --- 541,546 ---- * Update sensor track with target state. Used with * torpedos + * Assumes CanDetectTarget has been called immediately before with + * this target. */ void tcSonar::UpdateTrack(const tcGameObject* target, double t) *************** *** 535,538 **** --- 549,555 ---- if (isPassive) { + float bearingRate = parent->mcKin.BearingRateTo(last_range_km, last_az_rad, + target->mcKin.mfSpeed_kts, target->mcKin.mfHeading_rad); + mcTrack.mfLat_rad = 0; mcTrack.mfLon_rad = 0; *************** *** 541,546 **** mcTrack.mfHeading_rad = last_az_rad; mcTrack.mfClimbAngle_rad = 0; // or could use this as passive elevation mcTrack.mfTimestamp = t; ! mcTrack.mnFlags = TRACK_BEARING_ONLY | TRACK_ALT_VALID; } else --- 558,564 ---- mcTrack.mfHeading_rad = last_az_rad; mcTrack.mfClimbAngle_rad = 0; // or could use this as passive elevation + mcTrack.bearingRate_radps = bearingRate; mcTrack.mfTimestamp = t; ! mcTrack.mnFlags = TRACK_BEARING_ONLY | TRACK_ALT_VALID | TRACK_BEARINGRATE_VALID; } else |
|
From: Dewitt C. <ddc...@us...> - 2005-03-07 01:54:29
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31072/include/sim Modified Files: tcSonar.h Log Message: Passive sonar seeker work Index: tcSonar.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSonar.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSonar.h 5 Dec 2004 02:49:46 -0000 1.2 --- tcSonar.h 7 Mar 2005 01:54:18 -0000 1.3 *************** *** 87,90 **** --- 87,91 ---- private: float last_az_rad; ///< [rad] target azimuth from last call to CanDetectTarget + float last_range_km; ///< [km] target range from last call to CanDetectTarget float last_snr_excess; ///< [dB] snr excess from last call to CanDetectTarget }; |
|
From: Dewitt C. <ddc...@us...> - 2005-03-07 01:54:29
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31072/include/common Modified Files: math_constants.h simmath.h Log Message: Passive sonar seeker work Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** simmath.h 2 Mar 2005 22:28:35 -0000 1.27 --- simmath.h 7 Mar 2005 01:54:18 -0000 1.28 *************** *** 89,92 **** --- 89,93 ---- #define TRACK_ACTIVE 0x20 #define TRACK_TRIANGULATED 0x40 + #define TRACK_BEARINGRATE_VALID 0x80 class tcTrack *************** *** 99,102 **** --- 100,104 ---- float mfHeading_rad; float mfClimbAngle_rad; + float bearingRate_radps; ///< bearing rate in rad/s for bearing-only tracks double mfTimestamp; long mnID; *************** *** 113,117 **** mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; mfSpeed_kts=0;mfHeading_rad=0;mfTimestamp=0; ! mnID=0;mfClimbAngle_rad=0;mnFlags = 0; mnPassivePlatformID = -1; } --- 115,119 ---- mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; mfSpeed_kts=0;mfHeading_rad=0;mfTimestamp=0; ! mnID=0;mfClimbAngle_rad=0;bearingRate_radps=0;mnFlags = 0; mnPassivePlatformID = -1; } *************** *** 175,179 **** float mfSpeed_kts; ///< [kts] - float CalculateCollisionPoint(const tcKinematics& collider, float& dxi, float& dyi, float& dzi); float CalculateGroundImpactPoint(float terrainHeight_m, double& lon_rad, double& lat_rad); --- 177,180 ---- *************** *** 184,187 **** --- 185,189 ---- void PredictPosition(float dt_s, double& lon_rad, double& lat_rad, float& alt_m); + float BearingRateTo(float range_km, float bearing_rad, float speed_kts, float heading_rad); float HeadingToTrack(const tcTrack& track); float HeadingToGeoRad(const GeoPoint *apGeoPoint); Index: math_constants.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/math_constants.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** math_constants.h 6 Nov 2004 15:13:39 -0000 1.9 --- math_constants.h 7 Mar 2005 01:54:18 -0000 1.10 *************** *** 40,43 **** --- 40,44 ---- #define C_DEGTOM 111120.0f #define C_KTSTOMPS 0.51444444f + #define C_KTSTOKMPS 0.51444444e-3f #define C_MPSTOKTS 1.94384450f #define C_MPSTODEGPS 8.999280e-006f |
|
From: Dewitt C. <ddc...@us...> - 2005-03-07 01:54:29
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31072/src/graphics Modified Files: tcMessageCenter.cpp Log Message: Passive sonar seeker work Index: tcMessageCenter.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMessageCenter.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMessageCenter.cpp 2 Dec 2004 04:17:25 -0000 1.3 --- tcMessageCenter.cpp 7 Mar 2005 01:54:19 -0000 1.4 *************** *** 196,200 **** : tc3DWindow(parent, pos, size, name, 0), activeChannelName(""), ! popupBase(50, 70), popupCount(0) { --- 196,200 ---- : tc3DWindow(parent, pos, size, name, 0), activeChannelName(""), ! popupBase(180, 70), popupCount(0) { |
|
From: Dewitt C. <ddc...@us...> - 2005-03-05 22:38:32
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/include/graphics Modified Files: tc3DViewer.h tcMapView.h Log Message: Added sonobuoy model. 2525 view now uses small symbol for ballistic and sonobuoy instead of unknown symbol Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcMapView.h 4 Mar 2005 00:46:15 -0000 1.14 --- tcMapView.h 5 Mar 2005 22:37:51 -0000 1.15 *************** *** 73,79 **** SYMBOL_TORPEDO = 10, SYMBOL_FIXED = 11, ! SYMBOL_SENSOR = 12, ! SYMBOL_TARGET = 13, ! SYMBOL_PIE = 14 }; --- 73,80 ---- SYMBOL_TORPEDO = 10, SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 }; *************** *** 367,370 **** --- 368,373 ---- osg::Geometry* CreateSymbolGeometry(); osg::Geometry* CreateTexturedSymbol(const char* symbolName); + + osg::Geometry* DrawDefaultMark(teAffiliation affil); osg::Geometry* DrawNTDSSurface(teAffiliation affil); osg::Geometry* DrawNTDSGround(teAffiliation affil); *************** *** 376,379 **** --- 379,383 ---- osg::Geometry* DrawNTDSUnknown(teAffiliation affil); + void DrawSymbol2(tcMapObj* pMO); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tc3DViewer.h 23 Nov 2004 23:30:35 -0000 1.6 --- tc3DViewer.h 5 Mar 2005 22:37:51 -0000 1.7 *************** *** 178,181 **** --- 178,182 ---- bool viewWireframe; bool useRelativeChildPos; ///< true to add children as children of parent transform group + bool shakeAirCamera; ///< true to shake camera for air objects to simulate turbulence tcSimState *simState; int mnWidth; *************** *** 204,207 **** --- 205,211 ---- osg::Vec3 cameraTarget; ///< point camera is looking at for lookAt modes osg::Vec3 cameraTargetOffset; ///< offset for lookAt modes + osg::Vec3 cameraWalkOffset; ///< offset for simulated turbulence with camera motion + osg::Vec3 lastWalkOffset; + float cameraAz; ///< camera azimuth relative to target for moveWith modes float cameraEl; ///< camera elevation relative to target for moveWith modes |
|
From: Dewitt C. <ddc...@us...> - 2005-03-05 22:38:31
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/include/sim Modified Files: tcSensorMap.h Added Files: tcSonobuoy.h Log Message: Added sonobuoy model. 2525 view now uses small symbol for ballistic and sonobuoy instead of unknown symbol Index: tcSensorMap.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSensorMap.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcSensorMap.h 2 Mar 2005 22:28:39 -0000 1.11 --- tcSensorMap.h 5 Mar 2005 22:37:51 -0000 1.12 *************** *** 143,146 **** --- 143,149 ---- unsigned GetInterceptCount() const; + unsigned GetContributorCount() const; + const char* GetContributorName(unsigned idx) const; + const tcTrack* GetTrack() {return this;} bool IsNew() {return mfTimestamp == 0;} --- NEW FILE: tcSonobuoy.h --- /** ** @file tcSonobuoy.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCSONOBUOY_H_ #define _TCSONOBUOY_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tcGameObject.h" #include "tcSensorPlatform.h" namespace Database { class tcSonobuoyDBObject; } using Database::tcSonobuoyDBObject; class tcGameObject; /** * Sonobuoy model */ class tcSonobuoy : public tcGameObject, public tcSensorPlatform { public: virtual void Clear(); void PrintToFile(tcFile& file); void SaveToFile(tcFile& file); void LoadFromFile(tcFile& file); virtual void Serialize(tcFile& file, bool mbLoad); void LaunchFrom(tcGameObject* obj, unsigned nLauncher); virtual void Update(double afStatusTime); tcSonobuoy(); tcSonobuoy(tcSonobuoy&); tcSonobuoy(tcSonobuoyDBObject* obj); virtual ~tcSonobuoy(); private: tcSonobuoyDBObject* mpDBObject; float batteryTimeRemaining_s; long parentId; void UpdateDrop(float dt_s); }; #endif |
|
From: Dewitt C. <ddc...@us...> - 2005-03-05 22:38:31
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/src/database Modified Files: tcDatabase.cpp Added Files: tcSonobuoyDBObject.cpp Log Message: Added sonobuoy model. 2525 view now uses small symbol for ballistic and sonobuoy instead of unknown symbol Index: tcDatabase.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcDatabase.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tcDatabase.cpp 4 Mar 2005 00:46:16 -0000 1.23 --- tcDatabase.cpp 5 Mar 2005 22:37:51 -0000 1.24 *************** *** 2,6 **** ** @file tcDatabase.cpp */ ! /* Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ** All rights reserved. ** --- 2,6 ---- ** @file tcDatabase.cpp */ ! /* Copyright (C) 2003-2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** *************** *** 49,52 **** --- 49,53 ---- #include "tcBallisticDBObject.h" #include "tcStoresDBObject.h" + #include "tcSonobuoyDBObject.h" #include "tcTorpedoDBObject.h" #include "tcDatabaseIterator.h" *************** *** 317,320 **** --- 318,329 ---- else serializer.Save(); } + // tcSonobuoyDBObject + { + tcDBObjSerializerSql<tcSonobuoyDBObject> + serializer(this, sqlConnection, "sonobuoys"); + if (load) serializer.Load(); + else serializer.Save(); + } + BuildDictionaries(); } --- NEW FILE: tcSonobuoyDBObject.cpp --- /** ** @file tcSonobuoyDBObject.cpp */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" #if _MSC_VER > 1000 #pragma warning(disable:4786) // suppress warning for STL bug in VC6, see Q167355 in the MSDN Library. #endif // _MSC_VER > 1000 #include "tcSonobuoyDBObject.h" #include "common/tinyxml.h" #include "database/tcSqlReader.h" #include <sstream> #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace std; namespace Database { /** * workaround for write serialization issue * @return true if db obj is a leaf obj */ bool tcSonobuoyDBObject::IsLeaf() const { return mnClassID == DTYPE_SONOBUOY; } void tcSonobuoyDBObject::PrintToFile(tcFile& file) { tcDatabaseObject::PrintToFile(file); tcSensorPlatformDBObject::PrintToFile(file); } /** * Loads/saves XML data for database object * @param load true to load, false to save */ void tcSonobuoyDBObject::SerializeXml(TiXmlElement* node, bool load) { if (load) return; // write only for now wxASSERT(node); tcDatabaseObject::SerializeXml(node, load); tcSensorPlatformDBObject::SerializeXml(node, load); TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("sonobuoy"))->ToElement(); localNode->SetAttribute("batteryLife_s", batteryLife_s); localNode->SetAttribute("commRange_km", commRange_km); } /** * Adds sql column definitions to columnString. This is used for * SQL create table command */ void tcSonobuoyDBObject::AddSqlColumns(std::string& columnString) { tcDatabaseObject::AddSqlColumns(columnString); tcSensorPlatformDBObject::AddSqlColumns(columnString); columnString += ","; columnString += "BatteryLife_s number(5),"; columnString += "CommRange_km number(5)"; } void tcSonobuoyDBObject::ReadSql(tcSqlReader& entry) { tcDatabaseObject::ReadSql(entry); tcSensorPlatformDBObject::ReadSql(entry); batteryLife_s = entry.GetDouble("BatteryLife_s"); commRange_km = entry.GetDouble("CommRange_km"); } void tcSonobuoyDBObject::WriteSql(std::string& valueString) { tcDatabaseObject::WriteSql(valueString); tcSensorPlatformDBObject::WriteSql(valueString); std::stringstream s; s << ","; s << batteryLife_s << ","; s << commRange_km; valueString += s.str(); } tcSonobuoyDBObject::tcSonobuoyDBObject() : tcDatabaseObject(), tcSensorPlatformDBObject() { mzClass = "Default Sonobuoy"; mnClassID = DTYPE_SONOBUOY; } tcSonobuoyDBObject::tcSonobuoyDBObject(tcSonobuoyDBObject& obj) : tcDatabaseObject(obj), tcSensorPlatformDBObject(obj), batteryLife_s(obj.batteryLife_s), commRange_km(obj.commRange_km) { mnClassID = DTYPE_SONOBUOY; } tcSonobuoyDBObject::~tcSonobuoyDBObject() { } } |
|
From: Dewitt C. <ddc...@us...> - 2005-03-05 22:38:30
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843/include/database Modified Files: tcDatabaseObject.h Added Files: tcSonobuoyDBObject.h Log Message: Added sonobuoy model. 2525 view now uses small symbol for ballistic and sonobuoy instead of unknown symbol Index: tcDatabaseObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcDatabaseObject.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcDatabaseObject.h 31 Jan 2005 01:32:35 -0000 1.20 --- tcDatabaseObject.h 5 Mar 2005 22:37:50 -0000 1.21 *************** *** 68,71 **** --- 68,72 ---- #define PTYPE_SUBMARINE 0x0081 #define PTYPE_TORPEDO 0x0082 + #define PTYPE_SONOBUOY 0x0084 #define PTYPE_FIXED 0x0100 #define PTYPE_BALLISTIC 0x0200 *************** *** 91,94 **** --- 92,96 ---- #define MTYPE_AIRFIELD 13 #define MTYPE_BALLISTIC 14 + #define MTYPE_SONOBUOY 15 *************** *** 110,113 **** --- 112,116 ---- #define DTYPE_SONAR 14 #define DTYPE_TORPEDO 15 + #define DTYPE_SONOBUOY 16 #define DTYPE_NULL 0xFFFFFFFF --- NEW FILE: tcSonobuoyDBObject.h --- /* ** @file tcSonobuoyDBObject.h */ /* Copyright (C) 2005 Dewitt Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _SONOBUOYDBOBJECT_H_ #define _SONOBUOYDBOBJECT_H_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "tcDatabaseObject.h" #include "tcSensorPlatformDBObject.h" class TiXmlElement; namespace Database { class tcSqlReader; class tcSonobuoyDBObject : public tcDatabaseObject, public tcSensorPlatformDBObject { public: float batteryLife_s; ///< duration that buoy is active float commRange_km; ///< max comm range to parent platform virtual const char* GetClassName() {return "Sonobuoy";} ///< returns class name of database object bool IsLeaf() const; ///< returns true if db obj is a leaf obj virtual void PrintToFile(tcFile& file); virtual void SerializeXml(TiXmlElement* node, bool load); ///< XML serialization static void AddSqlColumns(std::string& columnString); void ReadSql(tcSqlReader& entry); void WriteSql(std::string& valueString); tcSonobuoyDBObject(tcSonobuoyDBObject& obj); tcSonobuoyDBObject(); virtual ~tcSonobuoyDBObject(); }; } // namespace Database #endif |