[Gcblue-commits] gcb_wx/src/sim tcBallisticWeapon.cpp,1.3,1.4 tcGameObject.cpp,1.17,1.18 tcMissileOb
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-08-06 02:48:01
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7549/src/sim Modified Files: tcBallisticWeapon.cpp tcGameObject.cpp tcMissileObject.cpp Log Message: Index: tcBallisticWeapon.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcBallisticWeapon.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcBallisticWeapon.cpp 5 Aug 2004 02:22:35 -0000 1.3 --- tcBallisticWeapon.cpp 6 Aug 2004 02:47:51 -0000 1.4 *************** *** 25,32 **** --- 25,34 ---- #include "common/tcStream.h" #include "common/tcObjStream.h" + #include "database/tcGenericDBObject.h" #include "tc3DModel.h" #include "tcParticleEffect.h" #include "tcLauncher.h" #include "tcSimState.h" + #include "tc3DPoint.h" /** *************** *** 62,67 **** const tcLauncher* pLauncher = obj->GetLauncher(nLauncher); mfStatusTime = obj->mfStatusTime; - mcKin = obj->mcKin; mcKin.mfHeading_rad += pLauncher->pointingAngle; mcKin.mfPitch_rad += pLauncher->pointingElevation; --- 64,88 ---- const tcLauncher* pLauncher = obj->GetLauncher(nLauncher); + if (tcPlatformObject* platObj = dynamic_cast<tcPlatformObject*>(obj)) + { + tc3DPoint launcherPos = platObj->mpDBObject->GetLauncherPosition(nLauncher); + tsGeoPoint pos = obj->RelPosToLatLonAlt(launcherPos.x, launcherPos.y, + launcherPos.z); + mcKin.mfLon_rad = pos.mfLon_rad; + mcKin.mfLat_rad = pos.mfLat_rad; + mcKin.mfAlt_m = pos.mfAlt_m; + } + else + { + mcKin.mfLon_rad = obj->mcKin.mfLon_rad; + mcKin.mfLat_rad = obj->mcKin.mfLat_rad; + mcKin.mfAlt_m = obj->mcKin.mfAlt_m; + } + + mcKin.mfSpeed_kts = obj->mcKin.mfSpeed_kts; + mcKin.mfHeading_rad = obj->mcKin.mfHeading_rad; + mcKin.mfPitch_rad = obj->mcKin.mfPitch_rad; + mfStatusTime = obj->mfStatusTime; mcKin.mfHeading_rad += pLauncher->pointingAngle; mcKin.mfPitch_rad += pLauncher->pointingElevation; Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcMissileObject.cpp 27 Jul 2004 23:26:07 -0000 1.15 --- tcMissileObject.cpp 6 Aug 2004 02:47:52 -0000 1.16 *************** *** 1,21 **** ! /** @file tcMissileObject.cpp */ /* ! * Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ! * All rights reserved. ! * ! * This file is part of the Global Conflict Blue (GCB) program. ! * GCB is free software; you can redistribute it and/or modify ! * it under the terms of version 2 of the GNU General Public License as ! * published by the Free Software Foundation. ! * ! * GCB is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with GCB; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ --- 1,22 ---- ! /** ! ** @file tcMissileObject.cpp */ /* ! ** Copyright (C) 2003-2004 Dewitt Colclough (de...@tw...) ! ** All rights reserved. ! ** ! ** This file is part of the Global Conflict Blue (GCB) program. ! ** GCB is free software; you can redistribute it and/or modify ! ** it under the terms of version 2 of the GNU General Public License as ! ** published by the Free Software Foundation. ! ** ! ** GCB is distributed in the hope that it will be useful, ! ** but WITHOUT ANY WARRANTY; without even the implied warranty of ! ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! ** GNU General Public License for more details. ! ** ! ** You should have received a copy of the GNU General Public License ! ** along with GCB; if not, write to the Free Software ! ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ *************** *** 23,30 **** --- 24,33 ---- #include "common/tcStream.h" #include "common/tcObjStream.h" + #include "database/tcGenericDBObject.h" #include "tc3DModel.h" #include "tcParticleEffect.h" #include "tcLauncher.h" #include "tcSimState.h" + #include "tc3DPoint.h" /** *************** *** 79,83 **** tsMissileFlightSegment* segmentInfo = &mpDBObject->maFlightProfile[mnCurrentSegment]; ! return segmentInfo->meAltitudeMode; } --- 82,86 ---- tsMissileFlightSegment* segmentInfo = &mpDBObject->maFlightProfile[mnCurrentSegment]; ! return segmentInfo->meAltitudeMode; } *************** *** 104,108 **** void tcMissileObject::LaunchFrom(tcGameObject* obj, unsigned nLauncher) { ! msKState.mfAltitude_m = obj->mcKin.mfAlt_m; if (msKState.mfAltitude_m < 5.0f) { --- 107,143 ---- void tcMissileObject::LaunchFrom(tcGameObject* obj, unsigned nLauncher) { ! if (tcPlatformObject* platObj = dynamic_cast<tcPlatformObject*>(obj)) ! { ! tc3DPoint launcherPos = platObj->mpDBObject->GetLauncherPosition(nLauncher); ! tsGeoPoint pos = obj->RelPosToLatLonAlt(launcherPos.x, launcherPos.y, ! launcherPos.z); ! mcKin.mfLon_rad = pos.mfLon_rad; ! mcKin.mfLat_rad = pos.mfLat_rad; ! mcKin.mfAlt_m = pos.mfAlt_m; ! } ! else ! { ! mcKin.mfLon_rad = obj->mcKin.mfLon_rad; ! mcKin.mfLat_rad = obj->mcKin.mfLat_rad; ! mcKin.mfAlt_m = obj->mcKin.mfAlt_m; ! } ! ! mcKin.mfSpeed_kts = obj->mcKin.mfSpeed_kts; ! mcKin.mfHeading_rad = obj->mcKin.mfHeading_rad; ! ! ! if (dynamic_cast<tcSurfaceObject*>(obj)) ! { ! // point surface launched missiles up ! mcKin.mfPitch_rad = 0.45f * C_PI; ! } ! else ! { ! mcKin.mfPitch_rad = obj->mcKin.mfPitch_rad; ! } ! ! ! ! msKState.mfAltitude_m = mcKin.mfAlt_m; if (msKState.mfAltitude_m < 5.0f) { *************** *** 138,145 **** // add pitch initializer eventually, have to deal with launcher elevation mfStatusTime = obj->mfStatusTime; - mcKin = obj->mcKin; mcKin.mfHeading_rad += pLauncher->pointingAngle; mcKin.mfPitch_rad += pLauncher->pointingElevation; tcString s; s.Format("From %s", obj->mzUnit.mz); --- 173,183 ---- // add pitch initializer eventually, have to deal with launcher elevation mfStatusTime = obj->mfStatusTime; mcKin.mfHeading_rad += pLauncher->pointingAngle; mcKin.mfPitch_rad += pLauncher->pointingElevation; + mcKin.mfClimbAngle_rad = mcKin.mfPitch_rad; + msKState.mfPitch_rad = mcKin.mfPitch_rad; + + tcString s; s.Format("From %s", obj->mzUnit.mz); *************** *** 294,298 **** } ! mfInterceptTime = tti_s; //interceptPitch_rad = atanf(0.001f*(msWaypoint.mfAlt_m - mcKin.mfAlt_m)/ --- 332,336 ---- } ! mfInterceptTime = tti_s; //interceptPitch_rad = atanf(0.001f*(msWaypoint.mfAlt_m - mcKin.mfAlt_m)/ Index: tcGameObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcGameObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcGameObject.cpp 18 Jul 2004 03:18:01 -0000 1.17 --- tcGameObject.cpp 6 Aug 2004 02:47:51 -0000 1.18 *************** *** 157,161 **** /** ! * Looking forward from the object, dx is right, and dz is back * TODO fix this system to use dx right, dy forward, dz up */ --- 157,161 ---- /** ! * Looking forward from the object, dx is right, dy is up, and dz is back * TODO fix this system to use dx right, dy forward, dz up */ |