[Gcblue-commits] gcb_wx/src/sim tcObjectControl.cpp,1.11,1.12 tcPlatformObject.cpp,1.13,1.14 tcSimSt
Status: Alpha
Brought to you by:
ddcforge
From: <ddc...@pr...> - 2004-02-02 01:23:35
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1681/src/sim Modified Files: tcObjectControl.cpp tcPlatformObject.cpp tcSimState.cpp Log Message: Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcObjectControl.cpp 1 Feb 2004 22:19:09 -0000 1.11 --- tcObjectControl.cpp 2 Feb 2004 01:21:37 -0000 1.12 *************** *** 1240,1245 **** if (mpCommandInterface == NULL) {return false;} ! bReadyForLaunch = mpSS->IsLauncherReady(mpHookedGameObj, anLauncher); ! switch (anButton) { --- 1240,1246 ---- if (mpCommandInterface == NULL) {return false;} ! //bReadyForLaunch = mpSS->IsLauncherReady(mpHookedGameObj, anLauncher); ! bReadyForLaunch = true; // SetLaunch upgraded to check readiness independently ! switch (anButton) { Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcPlatformObject.cpp 1 Feb 2004 22:19:09 -0000 1.13 --- tcPlatformObject.cpp 2 Feb 2004 01:21:37 -0000 1.14 *************** *** 60,63 **** --- 60,77 ---- } + /** + * set AI target, also set all launcher targets. This + * may have some undesirable side effects !? + */ + void tcPlatformObject::DesignateTarget(long anID) + { + mcAI.SetTarget(anID); + unsigned nLaunchers = mcLauncherState.launchers.size(); + for (size_t n=0; n<nLaunchers; n++) + { + mcLauncherState.SetLauncherTarget(n, anID); + } + } + // update guidance to maintain/achieve formation position void tcPlatformObject::UpdateFormationGuidance() { Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tcSimState.cpp 1 Feb 2004 22:19:09 -0000 1.27 --- tcSimState.cpp 2 Feb 2004 01:21:37 -0000 1.28 *************** *** 334,345 **** pobj->mfDamageLevel += 1.0f; // missile destroys itself on impact ! ! if (mpUserInfo->IsOwnAlliance(ptarget->mnAlliance)) ! { ! mpSound->PlayEffect(SEFFECT_IMPLOSION); ! } ! else { ! mpSound->PlayEffect(SEFFECT_EXPLOSION2); } } --- 334,347 ---- pobj->mfDamageLevel += 1.0f; // missile destroys itself on impact ! if (fDamageFract > 0) { ! if (mpUserInfo->IsOwnAlliance(ptarget->mnAlliance)) ! { ! mpSound->PlayEffect(SEFFECT_IMPLOSION); ! } ! else ! { ! mpSound->PlayEffect(SEFFECT_EXPLOSION2); ! } } } *************** *** 1151,1209 **** if (pDBObject == NULL) {return;} ! switch (pDBObject->mnClassID) { ! case DTYPE_GENERIC: ! { ! tcGenericDBObject *pGenericData = (tcGenericDBObject*)pDBObject; ! pnew = CreateGameObject(pGenericData); ! if (pnew == NULL) {return;} ! pnew->SetHeading(plaunchingplatform->mcKin.mfHeading_rad); ! pnew->SetSpeed(pGenericData->mfMaxSpeed_kts); ! } ! break; ! case DTYPE_MISSILE: ! { ! tcMissileDBObject *pMissileData = (tcMissileDBObject*)pDBObject; ! tcMissileObject* pMissileObj = dynamic_cast<tcMissileObject*>(CreateGameObject(pMissileData)); ! if (pMissileObj == NULL) {return;} - pMissileObj->msKState.mfAltitude_m = plaunchingplatform->mcKin.mfAlt_m; - if (pMissileObj->msKState.mfAltitude_m < 5.0f) { - pMissileObj->msKState.mfAltitude_m = 5.0f; - } - pMissileObj->msKState.mfSpeed_mps = plaunchingplatform->mcKin.mfSpeed_kts* - (float)C_KTSTOMPS; - pMissileObj->mfGoalHeading_rad = plaunchingplatform->mcKin.mfHeading_rad; - tcLauncherState* pLauncherState; - plaunchingplatform->GetLauncherState(pLauncherState); - if (pLauncherState != NULL) - { - tsLData *pLauncher = &pLauncherState->launchers[anLauncher]; - if (pLauncher->meLaunchMode == DATUM_ONLY) - { - pMissileObj->msWaypoint = pLauncher->msDatum; - } - else if ((pLauncher->meLaunchMode == SEEKER_TRACK) - || (pLauncher->meLaunchMode == FC_TRACK)) - { - pMissileObj->msWaypoint = pLauncher->msDatum; - pMissileObj->mcSensorState.mbActive = true; - pMissileObj->mcSensorState.mnMode = SSMODE_SEEKERACQUIRE; - pMissileObj->mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; - if (pMissileObj->mcSensorState.IsSemiactive()) - { - pMissileObj->mcSensorState.SetIlluminator( - plaunchingplatform->mnID, pLauncher->fireControlSensorIdx); - pLauncher->fireControlSensor->RequestTrack(); - } - } - } - // add heading and pitch initializers eventually, have to deal with launcher angle - pnew = static_cast<tcGameObject*>(pMissileObj); - } - break; - } // switch pnew->mfStatusTime = plaunchingplatform->mfStatusTime; pnew->mcKin = plaunchingplatform->mcKin; tcString s; s.Format("From %s",plaunchingplatform->mzUnit.mz); --- 1153,1209 ---- if (pDBObject == NULL) {return;} ! // only missiles are supported with this (and not for long) ! tcMissileDBObject *pMissileData = dynamic_cast<tcMissileDBObject*>(pDBObject); ! wxASSERT(pMissileData); ! ! tcMissileObject* pMissileObj = dynamic_cast<tcMissileObject*>(CreateGameObject(pMissileData)); ! if (pMissileObj == NULL) {return;} ! ! pMissileObj->msKState.mfAltitude_m = plaunchingplatform->mcKin.mfAlt_m; ! if (pMissileObj->msKState.mfAltitude_m < 5.0f) ! { ! pMissileObj->msKState.mfAltitude_m = 5.0f; ! } ! pMissileObj->msKState.mfSpeed_mps = plaunchingplatform->mcKin.mfSpeed_kts* ! (float)C_KTSTOMPS; ! ! tcLauncherState* pLauncherState; ! plaunchingplatform->GetLauncherState(pLauncherState); ! wxASSERT(pLauncherState); ! ! tsLData *pLauncher = &pLauncherState->launchers[anLauncher]; ! ! pMissileObj->mfGoalHeading_rad = ! plaunchingplatform->mcKin.mfHeading_rad + pLauncher->pointingAngle; ! ! if (pLauncher->meLaunchMode == DATUM_ONLY) ! { ! pMissileObj->msWaypoint = pLauncher->msDatum; ! } ! else if ((pLauncher->meLaunchMode == SEEKER_TRACK) ! || (pLauncher->meLaunchMode == FC_TRACK)) ! { ! pMissileObj->msWaypoint = pLauncher->msDatum; ! pMissileObj->mcSensorState.mbActive = true; ! pMissileObj->mcSensorState.mnMode = SSMODE_SEEKERACQUIRE; ! pMissileObj->mcSensorState.mcTrack.mnID = pLauncher->mnTargetID; ! if (pMissileObj->mcSensorState.IsSemiactive()) ! { ! pMissileObj->mcSensorState.SetIlluminator( ! plaunchingplatform->mnID, pLauncher->fireControlSensorIdx); ! pLauncher->fireControlSensor->RequestTrack(); ! } ! } ! ! // add heading and pitch initializers eventually, have to deal with launcher angle ! pnew = static_cast<tcGameObject*>(pMissileObj); ! pnew->mfStatusTime = plaunchingplatform->mfStatusTime; pnew->mcKin = plaunchingplatform->mcKin; + pnew->mcKin.mfHeading_rad += pLauncher->pointingAngle; + + // pnew->mcKin.mfHeading_rad += p tcString s; s.Format("From %s",plaunchingplatform->mzUnit.mz); |