[Gcblue-commits] gcb_wx/src/sim tcAirObject.cpp,1.26,1.27 tcLauncher.cpp,1.26,1.27 tcMenu.cpp,1.12,1
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:42:37
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15641/src/sim Modified Files: tcAirObject.cpp tcLauncher.cpp tcMenu.cpp tcMissileObject.cpp tcObjectControl.cpp tcOpticalSensor.cpp tcSimState.cpp tcSonar.cpp tcSonobuoy.cpp tcSubObject.cpp tcTorpedoObject.cpp Log Message: Fixed shaking object bug Index: tcSimState.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSimState.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** tcSimState.cpp 7 Jul 2005 01:13:44 -0000 1.86 --- tcSimState.cpp 14 Jul 2005 23:42:24 -0000 1.87 *************** *** 2251,2255 **** tnPoolIndex nSize = maPlatformState.GetCount(); tnPoolIndex nKey; ! int nListIndex=0; tcKinematics *pKin; GeoPoint p; --- 2251,2255 ---- tnPoolIndex nSize = maPlatformState.GetCount(); tnPoolIndex nKey; ! //int nListIndex=0; tcKinematics *pKin; GeoPoint p; Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcMissileObject.cpp 2 Jul 2005 16:51:12 -0000 1.29 --- tcMissileObject.cpp 14 Jul 2005 23:42:23 -0000 1.30 *************** *** 396,400 **** */ tcSensorMapTrack mapTrack; ! float tti_s; if (simState->GetTrack(intendedTarget, GetAlliance(), mapTrack)) { --- 396,400 ---- */ tcSensorMapTrack mapTrack; ! float tti_s = 999.0f; if (simState->GetTrack(intendedTarget, GetAlliance(), mapTrack)) { Index: tcTorpedoObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcTorpedoObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcTorpedoObject.cpp 9 Jul 2005 14:43:41 -0000 1.14 --- tcTorpedoObject.cpp 14 Jul 2005 23:42:24 -0000 1.15 *************** *** 356,360 **** float vz_mps = C_KTSTOMPS * sinf(mcKin.mfClimbAngle_rad) * mcKin.mfSpeed_kts; float vxy_mps = C_KTSTOMPS * fGroundSpeed_kts; ! float z = mcKin.mfAlt_m; float dvz = C_G * dt_s; --- 356,360 ---- float vz_mps = C_KTSTOMPS * sinf(mcKin.mfClimbAngle_rad) * mcKin.mfSpeed_kts; float vxy_mps = C_KTSTOMPS * fGroundSpeed_kts; ! //float z = mcKin.mfAlt_m; float dvz = C_G * dt_s; Index: tcMenu.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMenu.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcMenu.cpp 2 Mar 2005 22:28:45 -0000 1.12 --- tcMenu.cpp 14 Jul 2005 23:42:23 -0000 1.13 *************** *** 301,316 **** parentWindow->DrawGeometryR(submenuIcon.get(), subx, suby); - #if 0 - // draw submenu triangle icon - PointF aSubIcon[3]; // points for tri submenu icon, rel to upper left of item - aSubIcon[0].X = item_rect.X + mfItemWidth - 5.0f; - aSubIcon[0].Y = item_rect.Y + 0.5f*item_rect.Height; - aSubIcon[1].X = aSubIcon[0].X - 5.0f; - aSubIcon[1].Y = aSubIcon[0].Y - 5.0f; - aSubIcon[2].X = aSubIcon[1].X; - aSubIcon[2].Y = aSubIcon[0].Y + 5.0f; - apGraphics->FillPolygon(mpBrush,aSubIcon,3); - #endif // if item is selected, draw the submenu if (apMD->mbSelected) --- 301,305 ---- Index: tcLauncher.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcLauncher.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcLauncher.cpp 30 Jun 2005 01:06:11 -0000 1.26 --- tcLauncher.cpp 14 Jul 2005 23:42:23 -0000 1.27 *************** *** 645,649 **** dynamic_cast<tcMissileDBObject*>(mpChildDBObj)) { ! if (parent->mcKin.mfAlt_m < -30.0) { status = TOO_DEEP; --- 645,652 ---- dynamic_cast<tcMissileDBObject*>(mpChildDBObj)) { ! /* sub-launched SAMs have to be at periscope depth, otherwise -30. May want to ! ** add a database parameter for max launch depth vs. hard coding it */ ! if ( (parent->mcKin.mfAlt_m < -30.0) || ! ((meLaunchMode == SEEKER_TRACK) && (parent->mcKin.mfAlt_m < -18.0)) ) { status = TOO_DEEP; Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** tcObjectControl.cpp 10 Jul 2005 20:32:04 -0000 1.44 --- tcObjectControl.cpp 14 Jul 2005 23:42:24 -0000 1.45 *************** *** 413,421 **** void tcObjectControl::CreateHeadingCircles() { headingCircle = CreatePieGeometry(msHOI.mrectArc.Width(), msHOI.mrectArc.Height(), ! -180, 180, osg::Vec4(1, 1, 1, 1), FILL_OFF); headingCircleLight = CreatePieGeometry(msHOI.mrectArc.Width(), msHOI.mrectArc.Height(), ! -180, 180, osg::Vec4(1, 1, 1, 0.2f), FILL_ON); } --- 413,424 ---- void tcObjectControl::CreateHeadingCircles() { + osg::Vec4 opaqueWhite(1, 1, 1, 1); + osg::Vec4 transparentWhite(1, 1, 1, 0.2f); + headingCircle = CreatePieGeometry(msHOI.mrectArc.Width(), msHOI.mrectArc.Height(), ! -180, 180, opaqueWhite, FILL_OFF); headingCircleLight = CreatePieGeometry(msHOI.mrectArc.Width(), msHOI.mrectArc.Height(), ! -180, 180, transparentWhite, FILL_ON); } *************** *** 427,431 **** tcString s; ! if ((nFrameCount++ % 2)==0) {return;} wxASSERT(mpSS); --- 430,434 ---- tcString s; ! if ((nFrameCount++ % 3) != 0) {return;} wxASSERT(mpSS); *************** *** 666,671 **** wxASSERT(mpSS); ! tcPlatformObject *obj; ! if (!(obj = dynamic_cast<tcPlatformObject*>(mpHookedGameObj))) return; if (obj->mpDBObject->mfFuelCapacity_kg == 0) return; // object has infinite fuel, don't display --- 669,674 ---- wxASSERT(mpSS); ! tcPlatformObject* obj = dynamic_cast<tcPlatformObject*>(mpHookedGameObj); ! if (obj == 0) return; if (obj->mpDBObject->mfFuelCapacity_kg == 0) return; // object has infinite fuel, don't display *************** *** 743,748 **** DrawRectangleR(barFill, color, FILL_ON); ! wxString fuelText = fuelText.Format("FUEL: %.1f%% BATT: %.1f%%", ! fuelFraction * 100.0f, batteryFraction * 100.0f); DrawTextR(fuelText.c_str(), xbar-15, ybar+barHeight+12, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); --- 746,760 ---- DrawRectangleR(barFill, color, FILL_ON); ! wxString fuelText; ! if (sub->IsSnorkeling()) ! { ! fuelText = fuelText.Format("FUEL: %.1f%% BATT: %.1f%% (Snorkeling)", ! fuelFraction * 100.0f, batteryFraction * 100.0f); ! } ! else ! { ! fuelText = fuelText.Format("FUEL: %.1f%% BATT: %.1f%%", ! fuelFraction * 100.0f, batteryFraction * 100.0f); ! } DrawTextR(fuelText.c_str(), xbar-15, ybar+barHeight+12, defaultFont.get(), color, fontSize, LEFT_BASE_LINE); *************** *** 1355,1359 **** return; } ! bool bAccepted = ProcessSensorPanelButton(nSensor, nCol); } else if (msHOI.mrectArc.ContainsPoint((float)point.x,(float)point.y)) --- 1367,1371 ---- return; } ! ProcessSensorPanelButton(nSensor, nCol); } else if (msHOI.mrectArc.ContainsPoint((float)point.x,(float)point.y)) *************** *** 1799,1803 **** hintText = ""; ! int xhint, yhint; tcPlatformObject* platformObj = dynamic_cast<tcPlatformObject*>(mpHookedGameObj); --- 1811,1816 ---- hintText = ""; ! int xhint = 0; ! int yhint = 0; tcPlatformObject* platformObj = dynamic_cast<tcPlatformObject*>(mpHookedGameObj); Index: tcSubObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSubObject.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcSubObject.cpp 10 Jul 2005 20:32:04 -0000 1.12 --- tcSubObject.cpp 14 Jul 2005 23:42:24 -0000 1.13 *************** *** 205,215 **** } - /** - * @return true if snorkeling, false otherwise - */ - bool tcSubObject::GetSnorkelState() const - { - return isSnorkeling; - } /** --- 205,208 ---- *************** *** 252,255 **** --- 245,257 ---- } + /** + * @return true if snorkeling, false otherwise + */ + bool tcSubObject::IsSnorkeling() const + { + return isSnorkeling; + } + + bool tcSubObject::IsSurfaced() const { *************** *** 397,401 **** float oldAngle_rad = mcKin.mfClimbAngle_rad; ! float alpha = 0.5f * dt_s; mcKin.mfClimbAngle_rad = alpha*goalPitch + (1-alpha)*oldAngle_rad; --- 399,403 ---- float oldAngle_rad = mcKin.mfClimbAngle_rad; ! float alpha = (goalPitch < 0) ? 0.1f * dt_s : 0.15f * dt_s; mcKin.mfClimbAngle_rad = alpha*goalPitch + (1-alpha)*oldAngle_rad; *************** *** 403,408 **** mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; ! // add slow vertical ascent/descent component ! if (mcKin.mfAlt_m > -5) { float dz = (dalt_m > 0) ? 0.5f * dt_s : -0.5f * dt_s; --- 405,410 ---- mcKin.mfPitch_rad = mcKin.mfClimbAngle_rad; ! // add slow vertical ascent/descent component near surface or for near stopped sub (e.g. out of battery) ! if ((mcKin.mfAlt_m > -5) || (mcKin.mfSpeed_kts < 1)) { float dz = (dalt_m > 0) ? 0.5f * dt_s : -0.5f * dt_s; Index: tcOpticalSensor.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOpticalSensor.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcOpticalSensor.cpp 7 Jul 2005 01:13:44 -0000 1.8 --- tcOpticalSensor.cpp 14 Jul 2005 23:42:24 -0000 1.9 *************** *** 83,89 **** if (!mbActive) return false; ! bool isSurface = false; ! bool isAir = false; ! bool isGround = false; float target_size_m = target->GetSpan(); --- 83,89 ---- if (!mbActive) return false; ! //bool isSurface = false; ! //bool isAir = false; ! //bool isGround = false; float target_size_m = target->GetSpan(); Index: tcAirObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcAirObject.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tcAirObject.cpp 2 Jul 2005 16:51:12 -0000 1.26 --- tcAirObject.cpp 14 Jul 2005 23:42:23 -0000 1.27 *************** *** 277,281 **** } ! if (mcKin.mfClimbAngle_rad > -0.3f) { mcKin.mfClimbAngle_rad -= 0.1f * dt_s; --- 277,281 ---- } ! if (mcKin.mfClimbAngle_rad > -0.9f) { mcKin.mfClimbAngle_rad -= 0.1f * dt_s; Index: tcSonar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonar.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcSonar.cpp 7 Jul 2005 01:13:45 -0000 1.13 --- tcSonar.cpp 14 Jul 2005 23:42:24 -0000 1.14 *************** *** 695,699 **** float dscope_m = (mpDBObj->isTowed) ? dt_s * parent->mcKin.mfSpeed_kts * C_KTSTOMPS : dt_s * 10.0f; ! scope_m -= dt_s * parent->mcKin.mfSpeed_kts * C_KTSTOMPS; } else if (scope_m < 0) --- 695,699 ---- float dscope_m = (mpDBObj->isTowed) ? dt_s * parent->mcKin.mfSpeed_kts * C_KTSTOMPS : dt_s * 10.0f; ! scope_m -= dscope_m; } else if (scope_m < 0) Index: tcSonobuoy.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcSonobuoy.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSonobuoy.cpp 29 Apr 2005 18:52:56 -0000 1.2 --- tcSonobuoy.cpp 14 Jul 2005 23:42:24 -0000 1.3 *************** *** 175,179 **** float vz_mps = C_KTSTOMPS * sinf(mcKin.mfClimbAngle_rad) * mcKin.mfSpeed_kts; float vxy_mps = C_KTSTOMPS * fGroundSpeed_kts; ! float z = mcKin.mfAlt_m; float dvz = C_G * dt_s; --- 175,179 ---- float vz_mps = C_KTSTOMPS * sinf(mcKin.mfClimbAngle_rad) * mcKin.mfSpeed_kts; float vxy_mps = C_KTSTOMPS * fGroundSpeed_kts; ! //float z = mcKin.mfAlt_m; float dvz = C_G * dt_s; |