gcblue-commits Mailing List for Global Conflict Blue (Page 20)
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-07-20 16:25:03
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/src/graphics Modified Files: tc3DModel.cpp tc3DTerrain.cpp tc3DViewer.cpp tcMapView.cpp Log Message: Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcMapView.cpp 16 Jul 2005 23:12:38 -0000 1.31 --- tcMapView.cpp 20 Jul 2005 16:24:54 -0000 1.32 *************** *** 1623,1627 **** osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.5, 0.8, 0.5, 1.0)); altA->setColorArray(colors); altA->setColorBinding(osg::Geometry::BIND_OVERALL); --- 1623,1627 ---- osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.6, 0.6, 0.8, 1.0)); altA->setColorArray(colors); altA->setColorBinding(osg::Geometry::BIND_OVERALL); *************** *** 1633,1637 **** osg::Geometry* altB = new osg::Geometry(*maSymbolB[nAffiliation][nSymbol]); osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.5, 0.8, 0.5, 1.0)); altB->setColorArray(colors); altB->setColorBinding(osg::Geometry::BIND_OVERALL); --- 1633,1637 ---- osg::Geometry* altB = new osg::Geometry(*maSymbolB[nAffiliation][nSymbol]); osg::Vec4Array* colors = new osg::Vec4Array; ! colors->push_back(osg::Vec4(0.6, 0.6, 0.8, 1.0)); altB->setColorArray(colors); altB->setColorBinding(osg::Geometry::BIND_OVERALL); Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tc3DTerrain.cpp 26 May 2005 11:54:11 -0000 1.18 --- tc3DTerrain.cpp 20 Jul 2005 16:24:54 -0000 1.19 *************** *** 94,98 **** colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); waterSurface->setColorArray(colors); ! waterSurface->setColorBinding(osg::Geometry::BIND_OVERALL); --- 94,98 ---- colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); waterSurface->setColorArray(colors); ! waterSurface->setColorBinding(osg::Geometry::BIND_OFF); // BIND_OVERALL Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** tc3DModel.cpp 16 Jul 2005 23:12:38 -0000 1.28 --- tc3DModel.cpp 20 Jul 2005 16:24:54 -0000 1.29 *************** *** 455,459 **** { // if object is close to camera, use predicted track for position ! if (distanceFromCamera < 10e3) { tcTrack predicted; --- 455,459 ---- { // if object is close to camera, use predicted track for position ! if ((distanceFromCamera < 10e3) || (sensorTrack->IsBearingOnly())) { tcTrack predicted; Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tc3DViewer.cpp 17 Jul 2005 12:58:04 -0000 1.24 --- tc3DViewer.cpp 20 Jul 2005 16:24:54 -0000 1.25 *************** *** 1060,1064 **** } ! // limit min camera altitude unless surface or subsurface obj const unsigned int limitMask = (~PTYPE_FIXED) & 0xFFF0; --- 1060,1064 ---- } ! // limit min camera altitude for ground objects const unsigned int limitMask = (~PTYPE_FIXED) & 0xFFF0; *************** *** 1270,1280 **** tcGameObject* obj = simState->GetObject(hookID); if (obj == 0) { ! classification = 0; return lastPos; } ! float x, y, z; if (n3DCheatMode == 3) { --- 1270,1301 ---- tcGameObject* obj = simState->GetObject(hookID); + float x, y, z; + + // try to find in sensor map if null object (multiplayer client case) if (obj == 0) { ! tcSensorMap* sensorMap = simState->GetSensorMap(); ! unsigned int ownAlliance = simState->mpUserInfo->GetOwnAlliance(); ! ! if (tcSensorMapTrack* track = ! sensorMap->GetSensorMapTrack(hookID, ownAlliance)) ! { ! tcTrack predicted; ! track->GetPrediction(predicted, simState->GetTime()); ! x = LonToX(predicted.mfLon_rad); ! y = LatToY(predicted.mfLat_rad); ! z = predicted.GetOrGuessAltitude(); ! ! classification = predicted.mnClassification; ! lastPos.set(x, y, z); ! } ! else ! { ! classification = 0; ! } return lastPos; } ! if (n3DCheatMode == 3) { |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:02
|
Update of /cvsroot/gcblue/gcb_wx/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/database Modified Files: database.db Log Message: Index: database.db =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/database/database.db,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsD6ykxH and /tmp/cvs8YADnP differ |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:02
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/scripts Modified Files: AI.py UnitCommands.py Log Message: Index: AI.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/AI.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AI.py 2 Jul 2005 16:51:11 -0000 1.22 --- AI.py 20 Jul 2005 16:24:53 -0000 1.23 *************** *** 1,3 **** --- 1,4 ---- from UnitCommands import * + from SubTactics import * import math *************** *** 321,324 **** --- 322,328 ---- TI.SetMemoryText('Description', 'Head to and bomb target') TI.SetMemoryValue(2, 1) # state: 1 - fly to release, 2 - release + if (not UI.IsAir()): + TI.EndTask() + return iteration = iteration + 1 *************** *** 386,389 **** --- 390,396 ---- TI.SetMemoryValue(10, datum_lon) TI.SetMemoryValue(11, datum_lat) + if (not UI.IsAir()): + TI.EndTask() + return iteration = iteration + 1 *************** *** 539,551 **** - def ActivateAllSensors(UI): - UI.SetAllSensorState(1) - def ActivatePassiveSensors(UI): - nSensors = UI.GetSensorCount() - for n in range(0, nSensors): - sensor_info = UI.GetSensorInfo(n) - if (sensor_info.IsPassive()): - UI.SetSensorState(n, 1) def Emcon(TI): --- 546,550 ---- *************** *** 567,581 **** UI = TI.GetPlatformInterface() - def GetConnControl(BB): - return BB.Write('ConnLock', '') - - def ReleaseConnControl(BB): - BB.Erase('ConnLock') - - def GetSensorControl(BB): - return BB.Write('SensorLock', '') - def ReleaseSensorControl(BB): - BB.Erase('SensorLock') def SAM_Defense(UI): --- 566,570 ---- Index: UnitCommands.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/UnitCommands.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UnitCommands.py 10 Jul 2005 20:32:02 -0000 1.20 --- UnitCommands.py 20 Jul 2005 16:24:53 -0000 1.21 *************** *** 1,3 **** --- 1,26 ---- + + def ActivateAllSensors(UI): + UI.SetAllSensorState(1) + + def ActivatePassiveSensors(UI): + nSensors = UI.GetSensorCount() + for n in range(0, nSensors): + sensor_info = UI.GetSensorInfo(n) + if (sensor_info.IsPassive()): + UI.SetSensorState(n, 1) + + def GetConnControl(BB): + return BB.Write('ConnLock', '') + + def ReleaseConnControl(BB): + BB.Erase('ConnLock') + + def GetSensorControl(BB): + return BB.Write('SensorLock', '') + + def ReleaseSensorControl(BB): + BB.Erase('SensorLock') + def TakeControl(UI): UI.TakeControl() *************** *** 34,37 **** --- 57,63 ---- UI.AddNavWaypoint(lon, lat) + def AddWaypointOrderDeg(UI, lon_deg, lat_deg): + deg_to_rad = 0.01745329252 + UI.AddNavWaypoint(deg_to_rad*lon_deg, deg_to_rad*lat_deg) def AddPatrolOrderGroup(GI): *************** *** 42,46 **** def AddPatrolOrder(UI): ! UI.AddTask('Patrol', 1.0) def AddPatrolStation(UI, lon, lat): --- 68,75 ---- def AddPatrolOrder(UI): ! if (UI.IsSub()): ! UI.AddTask('SubPatrol', 1.0) ! else: ! UI.AddTask('Patrol', 1.0) def AddPatrolStation(UI, lon, lat): |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:02
|
Update of /cvsroot/gcblue/gcb_wx/scenarios In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/scenarios Modified Files: TaiwanTest.py Log Message: Index: TaiwanTest.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scenarios/TaiwanTest.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TaiwanTest.py 9 Jul 2005 14:44:42 -0000 1.4 --- TaiwanTest.py 20 Jul 2005 16:24:53 -0000 1.5 *************** *** 283,289 **** # alliance 1 goals ! goal_1 = SM.TimeGoal() ! goal_1.SetFailTimeout(1800) # 30 min time limit ! SM.SetAllianceGoal(side_a, goal_1) # alliance 2 goals --- 283,293 ---- # alliance 1 goals ! goal_1a = SM.DestroyGoal('Hangzhou') ! ! goal_1 = SM.CompoundGoal(0) # 0 - AND, 1 - OR ! goal_1.AddGoal(goal_1a) ! ! SM.SetAllianceGoal(1, goal_1) ! # alliance 2 goals |
|
From: Dewitt C. <ddc...@us...> - 2005-07-20 16:25:02
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4256/include/sim Modified Files: tcGuidanceState.h tcPool.h Log Message: Index: tcGuidanceState.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcGuidanceState.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGuidanceState.h 17 Aug 2004 02:22:56 -0000 1.4 --- tcGuidanceState.h 20 Jul 2005 16:24:53 -0000 1.5 *************** *** 48,53 **** float mfGoalSpeed_kts; float mfGoalAltitude_m; - tcKinematics mcKinIntercept; - bool mbIntercept; void Serialize(tcFile& file, bool abLoad); --- 48,51 ---- Index: tcPool.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcPool.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcPool.h 8 Aug 2004 00:31:33 -0000 1.7 --- tcPool.h 20 Jul 2005 16:24:53 -0000 1.8 *************** *** 367,371 **** /**********************************************************/ template <class T, int POOLSIZE> ! void tcPool<T,POOLSIZE>::RemoveAll(void) { for(tnPoolIndex k=0;k<POOLSIZE;k++) --- 367,371 ---- /**********************************************************/ template <class T, int POOLSIZE> ! void tcPool<T,POOLSIZE>::RemoveAll() { for(tnPoolIndex k=0;k<POOLSIZE;k++) *************** *** 378,382 **** maPrev[k] = NULL_INDEX; maNext[k] = NULL_INDEX; ! maAvailable[k] = k; } mnSize = 0; --- 378,382 ---- maPrev[k] = NULL_INDEX; maNext[k] = NULL_INDEX; ! maAvailable[k] = (k + 1) % POOLSIZE; ///< start with 1 as index (for debugging) } mnSize = 0; *************** *** 400,404 **** maPrev[k] = NULL_INDEX; maNext[k] = NULL_INDEX; ! maAvailable[k] = k; } } --- 400,404 ---- maPrev[k] = NULL_INDEX; maNext[k] = NULL_INDEX; ! maAvailable[k] = (k + 1) % POOLSIZE; ///< start with 1 as index (for debugging) } } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-17 12:58:14
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31623/src/sim Modified Files: tcMissileObject.cpp Log Message: Index: tcMissileObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMissileObject.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcMissileObject.cpp 14 Jul 2005 23:42:23 -0000 1.30 --- tcMissileObject.cpp 17 Jul 2005 12:58:05 -0000 1.31 *************** *** 213,218 **** msKState.mfPitch_rad = mcKin.mfPitch_rad; ! wxString s = wxString::Format("Missile %d-%d", obj->mnID, rand() % 1000); ! mzUnit = s.c_str(); SetAlliance(obj->GetAlliance()); --- 213,229 ---- msKState.mfPitch_rad = mcKin.mfPitch_rad; ! wxString s = wxString::Format("Missile %d-%d", obj->mnID, rand() % 10000); ! ! /* Workaround, for some reason duplicate names were appearing with missiles ! ** despite statistical unlikelihood. E.g. Missile 11-133 showed up three times!? ! ** Changed from 3 to 4 digit random suffix and added test and second chance to ! ** get a unique object name. ! */ ! if (simState->GetObjectByName(s.c_str())) ! { ! s = wxString::Format("Missile %d-%d", obj->mnID, rand() % 10000); ! } ! ! mzUnit = s.c_str(); SetAlliance(obj->GetAlliance()); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-17 12:58:14
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31623/src/graphics Modified Files: ObjectUpdater.cpp cspSky.cpp tc3DViewer.cpp Log Message: Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ObjectUpdater.cpp 14 Jul 2005 23:42:22 -0000 1.19 --- ObjectUpdater.cpp 17 Jul 2005 12:58:04 -0000 1.20 *************** *** 221,229 **** tcSensorMapTrack* sensorTrack = model->GetSensorTrack(); ! int displayMode = tcOptions::Get()->mn3DCheatMode; if (gameObject) { ! if ((displayMode == 3) || simState->mpUserInfo->IsOwnAlliance(gameObject->GetAlliance())) { UpdateTrue(node); --- 221,231 ---- tcSensorMapTrack* sensorTrack = model->GetSensorTrack(); ! bool use3Dcheat = tcOptions::Get()->mn3DCheatMode == 3; ! bool isServer = simState->IsMultiplayerServer(); ! if (gameObject) { ! if (use3Dcheat || isServer || simState->mpUserInfo->IsOwnAlliance(gameObject->GetAlliance())) { UpdateTrue(node); Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** cspSky.cpp 16 Jul 2005 23:12:38 -0000 1.15 --- cspSky.cpp 17 Jul 2005 12:58:04 -0000 1.16 *************** *** 1109,1112 **** --- 1109,1119 ---- //////////////////////////////////////////////////////////////////////////////// + float Sky::skyDomeRadius = 50000.0f; + + void Sky::SetRadius(float r) + { + skyDomeRadius = r; + } + Sky::Sky(): Group() { m_LastMoonFullUpdate = -1e+10; *************** *** 1154,1158 **** float x, y, z; float alpha, theta; ! float radius = 1100000.0f; m_Horizon = new FalseHorizon; --- 1161,1165 ---- float x, y, z; float alpha, theta; ! float radius = skyDomeRadius; m_Horizon = new FalseHorizon; Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DViewer.cpp 16 Jul 2005 23:12:38 -0000 1.23 --- tc3DViewer.cpp 17 Jul 2005 12:58:04 -0000 1.24 *************** *** 1899,1905 **** updateVisitor->setTraversalNumber(frameStamp->getFrameNumber()); ! frameStampFar->setFrameNumber(frameStampFar->getFrameNumber()+1); ! frameStampFar->setReferenceTime(gameTime); ! updateVisitorFar->setTraversalNumber(frameStampFar->getFrameNumber()); } --- 1899,1908 ---- updateVisitor->setTraversalNumber(frameStamp->getFrameNumber()); ! if (useFarSceneView) ! { ! frameStampFar->setFrameNumber(frameStampFar->getFrameNumber()+1); ! frameStampFar->setReferenceTime(gameTime); ! updateVisitorFar->setTraversalNumber(frameStampFar->getFrameNumber()); ! } } *************** *** 1969,1972 **** --- 1972,1977 ---- // ---------------------- + Sky::SetRadius(zmax - 100.0f); + shiftDistance = 50000.0f; cameraAz = 0.5f*C_PI; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-17 12:58:14
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31623/src/scriptinterface Modified Files: tcScenarioInterface.cpp Log Message: Index: tcScenarioInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcScenarioInterface.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tcScenarioInterface.cpp 2 Jul 2005 16:51:11 -0000 1.31 --- tcScenarioInterface.cpp 17 Jul 2005 12:58:05 -0000 1.32 *************** *** 214,217 **** --- 214,224 ---- if (!unit.Validate()) return false; + if (simState->GetObjectByName(unit.unitName) != 0) + { + fprintf(stderr, "tcScenarioInterface::AddUnitToAlliance - Duplicate unit (%s)\n", + unit.unitName.c_str()); + return false; + } + tcDatabaseObject *dbObj = simState->mpDatabase->GetObject(unit.className); if (dbObj == NULL) |
|
From: Dewitt C. <ddc...@us...> - 2005-07-17 12:57:52
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31598/include/graphics Modified Files: cspSky.h Log Message: Index: cspSky.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/cspSky.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cspSky.h 18 Feb 2004 18:53:55 -0000 1.4 --- cspSky.h 17 Jul 2005 12:57:43 -0000 1.5 *************** *** 257,260 **** --- 257,262 ---- double getSpin() { return m_SpinTheWorld*86400.0; } void updateHorizon(osg::Vec4 const &fog_color, float altitude, float clip); + + static void SetRadius(float r); protected: void _init(); *************** *** 289,292 **** --- 291,296 ---- double m_Latitude; double m_SpinTheWorld; + + static float skyDomeRadius; ///< radius for sky dome }; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-16 23:13:18
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26502/src/graphics Modified Files: cspSky.cpp tc3DModel.cpp tc3DViewer.cpp tc3DWindow.cpp tcMapView.cpp tcTerrainView.cpp Log Message: Fix for horizon darkening bug, option cleanup Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tc3DModel.cpp 14 Jul 2005 23:42:22 -0000 1.27 --- tc3DModel.cpp 16 Jul 2005 23:12:38 -0000 1.28 *************** *** 128,134 **** if (node.getNumParents() == 1) { ! ! osg::MatrixTransform *rotateTransform = new osg::MatrixTransform; ! rotateTransform->setDataVariance(osg::Object::DYNAMIC); // temporarily hold node to avoid delete when removing from parent --- 128,132 ---- if (node.getNumParents() == 1) { ! osg::MatrixTransform *rotateTransform = 0; // temporarily hold node to avoid delete when removing from parent *************** *** 139,146 **** if (osg::Group* pivotParent = GetPivotParent(parent, pivotRotate, childIdx)) // check if this is a pivot { osg::ref_ptr<osg::Group> temp = pivotRotate; pivotParent->setChild(childIdx, rotateTransform); rotateTransform->addChild(pivotRotate); ! if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) --- 137,148 ---- if (osg::Group* pivotParent = GetPivotParent(parent, pivotRotate, childIdx)) // check if this is a pivot { + rotateTransform = dynamic_cast<osg::MatrixTransform*>(pivotRotate); + wxASSERT(rotateTransform != 0); + + /* osg::ref_ptr<osg::Group> temp = pivotRotate; pivotParent->setChild(childIdx, rotateTransform); rotateTransform->addChild(pivotRotate); ! */ if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) *************** *** 151,154 **** --- 153,159 ---- else { + rotateTransform = new osg::MatrixTransform; + rotateTransform->setDataVariance(osg::Object::DYNAMIC); + childIdx = parent->getChildIndex(&node); osg::BoundingSphere bs = node.getBound(); Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cspSky.cpp 1 Jun 2005 00:13:30 -0000 1.14 --- cspSky.cpp 16 Jul 2005 23:12:38 -0000 1.15 *************** *** 205,212 **** } ! bool computeBound() const { ! _bbox._min = Vec3(-1000100.0, -1000100.0, 0.0); ! _bbox._max = Vec3( 1000100.0, 1000100.0, 1000100.0); ! return true; } --- 205,213 ---- } ! // DDC modified for 0.9.9 ! osg::BoundingBox computeBound() const { ! _boundingBox._min = Vec3(-1000100.0, -1000100.0, 0.0); ! _boundingBox._max = Vec3( 1000100.0, 1000100.0, 1000100.0); ! return _boundingBox; } *************** *** 334,338 **** float ambient = background; if (ambient > 0.1) ambient = 0.1; ! // the sky shading at the sun's position is too blue when the sun // is high to use as the light color. instead we use the approximate --- 335,339 ---- float ambient = background; if (ambient > 0.1) ambient = 0.1; ! // the sky shading at the sun's position is too blue when the sun // is high to use as the light color. instead we use the approximate *************** *** 577,580 **** --- 578,582 ---- geom->setTexCoordArray(0,tcoords); + osg::Vec4Array* colours = new osg::Vec4Array(1); (*colours)[0].set(1.0f,1.0f,1.0,1.0f); *************** *** 1004,1007 **** --- 1006,1010 ---- rgb.check(); #endif // CUSTOM + return rgb; } *************** *** 1067,1070 **** --- 1070,1074 ---- void updateHorizonColors(Vec4Array const &colors) { + return; assert(int(colors.size()) == m_Segments); for (int i=0; i < m_Segments; i++) (*m_Colors)[i] = colors[i]; *************** *** 1078,1081 **** --- 1082,1086 ---- void updateHorizon(float altitude, float clip) { + return; float a = 0.0; float da = 2.0 * C_PI / m_Segments; *************** *** 1128,1132 **** m_lev = new float[90]; ! float base_elev = -10.0; m_nlev = 0; m_HorizonIndex = 0; --- 1133,1137 ---- m_lev = new float[90]; ! float base_elev = -20.0; m_nlev = 0; m_HorizonIndex = 0; *************** *** 1144,1154 **** } } ! m_nseg = 37; int i, j; float x, y, z; float alpha, theta; ! //float radius = 1100000.0f; ! float radius = 95000.0f; m_Horizon = new FalseHorizon; #ifdef TEXDOME --- 1149,1159 ---- } } ! m_nseg = 36; int i, j; float x, y, z; float alpha, theta; ! float radius = 1100000.0f; ! m_Horizon = new FalseHorizon; #ifdef TEXDOME *************** *** 1191,1196 **** colors[ci][3] = 1.0; ! tcoords[ci][0] = 0.5f + min(0.5f, (90.0f - m_lev[i]) / 180.0f) * cosf(theta); ! tcoords[ci][1] = 0.5f + min(0.5f, (90.0f - m_lev[i]) / 180.0f) * sinf(theta); (*cindex)[ci] = static_cast<unsigned short>(ci); --- 1196,1206 ---- colors[ci][3] = 1.0; ! /* DDC: this code produced dark horizon artifacts at 0, 90, 180, 270, ended up shutting off ! ** texturing for non TEXDOME mode */ ! // tcoords[ci][0] = 0.5f + min(0.5f, (90.0f - m_lev[i]) / 180.0f) * cosf(theta); ! // tcoords[ci][1] = 0.5f + min(0.5f, (90.0f - m_lev[i]) / 180.0f) * sinf(theta); ! ! tcoords[ci][0] = 0; ! tcoords[ci][1] = 1; (*cindex)[ci] = static_cast<unsigned short>(ci); *************** *** 1247,1250 **** --- 1257,1261 ---- dome_state->setMode(GL_CULL_FACE, StateAttribute::OFF); dome_state->setMode(GL_FOG, osg::StateAttribute::OFF); + dome_state->setMode(GL_TEXTURE_2D, osg::StateAttribute::OFF); // stops dark horizon artifacts in non TEXDOME mode // render bins: skydome and stars = -3, moon = -2, terrain = -1, rest = 0 (default) dome_state->setRenderBinDetails(-3,"RenderBin"); *************** *** 1343,1346 **** --- 1354,1358 ---- _updateShading(sun_h, sun_A); + // get the sky shading at the position of the sun m_ZenithColor = m_SkyShader.SkyColor(light_h, 0.0, 0.0, m_ZenithIntensity); *************** *** 1360,1364 **** --- 1372,1379 ---- #ifndef TEXDOME void Sky::_updateShading(double sun_h, double sun_A) { + Vec4Array& colors = *(dynamic_cast<Vec4Array*>(m_SkyDome->getColorArray())); + + double da = 2.0 * C_PI / (m_nseg); double min_a = 0.5*da; *************** *** 1370,1375 **** for (i = 0; i < m_nlev; ++i) { double elev = UnitConversions::toRadians(m_lev[i]); ! ! if (elev < 0.0) elev = 0.0; // sub horizon colors aren't correct double azimuth = -sun_A - 0.5 * C_PI; bool at_vertex = fabs(elev - sun_h) < min_a; // this is only a rough measure --- 1385,1393 ---- for (i = 0; i < m_nlev; ++i) { double elev = UnitConversions::toRadians(m_lev[i]); ! ! if (elev < 0.0) ! { ! elev = 0.0; // sub horizon colors aren't correct ! } double azimuth = -sun_A - 0.5 * C_PI; bool at_vertex = fabs(elev - sun_h) < min_a; // this is only a rough measure *************** *** 1392,1399 **** --- 1410,1419 ---- colors[ci][3] = 1.0; + if (i == m_HorizonIndex) { (*m_HorizonColors)[j] = colors[ci]; horizon_average += colors[ci]; } + ++ci; *************** *** 1533,1536 **** --- 1553,1557 ---- osg::Vec4 Sky::getHorizonColor(float angle) { static int avg = 0; + // skydome wraps around clockwise angle = -angle; Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tcMapView.cpp 30 Jun 2005 01:06:10 -0000 1.30 --- tcMapView.cpp 16 Jul 2005 23:12:38 -0000 1.31 *************** *** 692,695 **** --- 692,696 ---- defaultFont.get(), color, 16.0, LEFT_BASE_LINE); + #if 0 if ((mpOptions!=NULL) && (mpOptions->mbShowMapDebug)) { *************** *** 704,707 **** --- 705,709 ---- defaultFont.get(), color, 16.0, LEFT_BASE_LINE); } + #endif /*** Draw map command graphics ***/ *************** *** 1847,1850 **** --- 1849,1858 ---- int fillMode = (mpOptions->mbFillRangeCircles) ? FILL_ON : FILL_OFF; + osg::Vec4 pieColor = symbolColor; + if (fillMode == FILL_ON) + { + pieColor._v[3] *= 0.5f; + } + osg::Geometry* rangeCircle; if (pMO->mfArc_deg >= 360.0f) *************** *** 2661,2667 **** //DrawGrid(); - if ((mpOptions!=NULL) && (mpOptions->mbShowMapDebug)) - { - } for(i=0;(i<(int)mnObjCount)&&(i<MAXWORLDMAPOBJ);i++) --- 2669,2672 ---- Index: tcTerrainView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcTerrainView.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcTerrainView.cpp 1 Jun 2005 00:13:31 -0000 1.7 --- tcTerrainView.cpp 16 Jul 2005 23:12:38 -0000 1.8 *************** *** 175,188 **** { tsMapDataInfo sMDI; - bool mbTextureMaps; - - if (mpOptions != NULL) - { - mbTextureMaps = mpOptions->mbTextureMappedMaps == 1; - } - else - { - mbTextureMaps = true; - } mpMapData->GetMapDataInfo(&sMDI); // get size of map data arrays --- 175,178 ---- Index: tc3DWindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DWindow.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DWindow.cpp 11 Jun 2005 21:01:44 -0000 1.23 --- tc3DWindow.cpp 16 Jul 2005 23:12:38 -0000 1.24 *************** *** 31,34 **** --- 31,35 ---- #include <osg/Geode> #include <osg/Geometry> + #include <osg/Group> #include <osg/LineWidth> #include <osg/MatrixTransform> Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tc3DViewer.cpp 14 Jul 2005 23:42:22 -0000 1.22 --- tc3DViewer.cpp 16 Jul 2005 23:12:38 -0000 1.23 *************** *** 25,29 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #include "wx/msw/private.h" // for MS Windows specific definitions #endif --- 25,28 ---- *************** *** 32,35 **** --- 31,35 ---- #include "tc3DViewer.h" #include "math_constants.h" + #include <osg/AlphaFunc> #include <osg/BlendFunc> #include <osg/CullStack> *************** *** 359,363 **** int correctedY = parentHeight - (pos.y + size.GetHeight()); sceneView->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); ! sceneViewFar->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); mnWidth = size.GetWidth(); --- 359,367 ---- int correctedY = parentHeight - (pos.y + size.GetHeight()); sceneView->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); ! ! if (sceneViewFar.valid()) ! { ! sceneViewFar->setViewport(pos.x,correctedY, size.GetWidth(),size.GetHeight()); ! } mnWidth = size.GetWidth(); *************** *** 435,455 **** { osgUtil::RenderStage* stage = sceneView->getRenderStage(); - osgUtil::RenderStage* stageFar = sceneViewFar->getRenderStage(); if (modeCode == 1) { stage->setClearMask(GL_DEPTH_BUFFER_BIT); - stageFar->setClearMask(GL_DEPTH_BUFFER_BIT); } else if (modeCode == 2) { ! stage->setClearMask(GL_DEPTH_BUFFER_BIT); ! stageFar->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } else { stage->setClearMask(0); - stageFar->setClearMask(0); } } --- 439,480 ---- { osgUtil::RenderStage* stage = sceneView->getRenderStage(); if (modeCode == 1) { stage->setClearMask(GL_DEPTH_BUFFER_BIT); } else if (modeCode == 2) { ! if (useFarSceneView) ! { ! stage->setClearMask(GL_DEPTH_BUFFER_BIT); ! } ! else ! { ! stage->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); ! } } else { stage->setClearMask(0); } + + if (sceneViewFar.valid()) + { + osgUtil::RenderStage* stageFar = sceneViewFar->getRenderStage(); + if (modeCode == 1) + { + stageFar->setClearMask(GL_DEPTH_BUFFER_BIT); + } + else if (modeCode == 2) + { + stageFar->setClearMask(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); + } + else + { + stageFar->setClearMask(0); + } + } + } *************** *** 460,464 **** { wxASSERT(foggedObjects.valid()); - wxASSERT(sceneViewFar.valid()); osg::StateSet* fogState = foggedObjects->getOrCreateStateSet(); --- 485,488 ---- *************** *** 470,477 **** } if (mode == FOG_OFF) { fogState->setMode(GL_FOG, osg::StateAttribute::OFF); ! sceneViewFar->setClearColor(osg::Vec4(0, 0, 0, 1)); return; } --- 494,504 ---- } + osgUtil::SceneView* view = (useFarSceneView) ? sceneViewFar.get() : sceneView.get(); + wxASSERT(view != 0); + if (mode == FOG_OFF) { fogState->setMode(GL_FOG, osg::StateAttribute::OFF); ! view->setClearColor(osg::Vec4(0, 0, 0, 1)); return; } *************** *** 490,494 **** fog->setEnd(60000.0f); fog->setDensity(0.000006f); ! sceneViewFar->setClearColor(airFog); } else --- 517,521 ---- fog->setEnd(60000.0f); fog->setDensity(0.000006f); ! view->setClearColor(airFog); } else *************** *** 498,502 **** fog->setEnd(60000.0f); fog->setDensity(0.0006f); ! sceneViewFar->setClearColor(waterFog); } --- 525,529 ---- fog->setEnd(60000.0f); fog->setDensity(0.0006f); ! view->setClearColor(waterFog); } *************** *** 831,835 **** rootnode->addChild(foggedObjects.get()); ! rootnodeFar->addChild(skyTransform.get()); /* For some strange reason, adding the orthoProjection to --- 858,866 ---- rootnode->addChild(foggedObjects.get()); ! ! if (useFarSceneView) ! { ! rootnodeFar->addChild(skyTransform.get()); ! } /* For some strange reason, adding the orthoProjection to *************** *** 922,930 **** guiView->draw(); ! if (isActive && sceneView.valid() && sceneViewFar.valid()) { ! sceneViewFar->update(); ! sceneViewFar->cull(); ! sceneViewFar->draw(); sceneView->update(); --- 953,964 ---- guiView->draw(); ! if (isActive && sceneView.valid()) { ! if (sceneViewFar.valid()) ! { ! sceneViewFar->update(); ! sceneViewFar->cull(); ! sceneViewFar->draw(); ! } sceneView->update(); *************** *** 1046,1050 **** } ! // workaround for sky issue, deactivate sky when camera underwater if (cameraPosition._v[2] < -1.0) --- 1080,1085 ---- } ! osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! // workaround for sky issue, deactivate sky when camera underwater if (cameraPosition._v[2] < -1.0) *************** *** 1052,1056 **** if (skyTransform->getNumParents()) { ! rootnodeFar->removeChild(skyTransform.get()); SetFogMode(FOG_WATER); } --- 1087,1091 ---- if (skyTransform->getNumParents()) { ! terrainRoot->removeChild(skyTransform.get()); SetFogMode(FOG_WATER); } *************** *** 1060,1064 **** if (isTerrainActive && (skyTransform->getNumParents() == 0)) { ! rootnodeFar->addChild(skyTransform.get()); SetFogMode(FOG_AIR); } --- 1095,1099 ---- if (isTerrainActive && (skyTransform->getNumParents() == 0)) { ! terrainRoot->addChild(skyTransform.get()); SetFogMode(FOG_AIR); } *************** *** 1079,1083 **** sceneView->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); ! sceneViewFar->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); //osgAL::SoundManager::instance()->getListener()->setPosition(cameraPosition.x(), cameraPosition.y(), --- 1114,1121 ---- sceneView->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); ! if (sceneViewFar.valid()) ! { ! sceneViewFar->setViewMatrixAsLookAt(cameraPosition, cameraTarget, osg::Vec3(0,0,1)); ! } //osgAL::SoundManager::instance()->getListener()->setPosition(cameraPosition.x(), cameraPosition.y(), *************** *** 1428,1431 **** --- 1466,1470 ---- void tc3DViewer::InitSceneViewFar(wxPoint pos, wxSize size) { + wxASSERT(useFarSceneView); sceneViewFar = new osgUtil::SceneView(); *************** *** 1583,1594 **** osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); if (state) { if (skyTransform->getNumParents() == 0) { ! rootnodeFar->addChild(skyTransform.get()); } foggedObjects->addChild(terrainNode.get()); foggedObjects->addChild(skyLights.get()); // update terrain here with current origin since it isn't updated while inactive terrainManager->SetOrigin(lonOrigin_rad, latOrigin_rad); --- 1622,1637 ---- osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); + osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); + wxASSERT(terrainRoot); + if (state) { if (skyTransform->getNumParents() == 0) { ! terrainRoot->addChild(skyTransform.get()); } foggedObjects->addChild(terrainNode.get()); foggedObjects->addChild(skyLights.get()); + // update terrain here with current origin since it isn't updated while inactive terrainManager->SetOrigin(lonOrigin_rad, latOrigin_rad); *************** *** 1597,1601 **** { // skyTransform already removed if camera underwater ! rootnodeFar->removeChild(skyTransform.get()); if (unsigned int nParents = skyTransform->getNumParents()) { --- 1640,1645 ---- { // skyTransform already removed if camera underwater ! ! terrainRoot->removeChild(skyTransform.get()); if (unsigned int nParents = skyTransform->getNumParents()) { *************** *** 1603,1607 **** "skyTransform still has (%d) parents after removal\n", nParents); } ! if (!foggedObjects->removeChild(terrainNode.get()) || !foggedObjects->removeChild(skyLights.get())) --- 1647,1651 ---- "skyTransform still has (%d) parents after removal\n", nParents); } ! if (!foggedObjects->removeChild(terrainNode.get()) || !foggedObjects->removeChild(skyLights.get())) *************** *** 1799,1802 **** --- 1843,1854 ---- pm->setMode(osg::PolygonMode::Face::FRONT_AND_BACK, osg::PolygonMode::FILL); } + + if (useFarSceneView) + { + // do same for far sceneview + stateSet = rootnodeFar->getOrCreateStateSet(); + wxASSERT(stateSet); + stateSet->setAttribute(pm, osg::StateAttribute::ON); + } } *************** *** 1861,1873 **** wxASSERT(sceneView.valid()); - float zmid = sqrtf(zmin*zmax); - float aspectRatio = (float)windowSize.GetWidth() / (float)windowSize.GetHeight(); ! sceneView->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmin, zmid); ! if (sceneViewFar.valid()) ! { ! sceneViewFar->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmid-20, zmax); ! } } --- 1913,1931 ---- wxASSERT(sceneView.valid()); float aspectRatio = (float)windowSize.GetWidth() / (float)windowSize.GetHeight(); ! if (useFarSceneView) ! { ! float zmid = sqrtf(zmin*zmax); ! sceneView->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmin, zmid); ! if (sceneViewFar.valid()) ! { ! sceneViewFar->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmid-20, zmax); ! } ! } ! else ! { ! sceneView->setProjectionMatrixAsPerspective(45.0, aspectRatio, zmin, zmax); ! } } *************** *** 1890,1896 **** lonOrigin_rad = 0; zmin = 2.0f; ! zmax = 131072.0f; ! zmax = 50000.0f; ! shiftDistance = 50000.0f; --- 1948,1971 ---- lonOrigin_rad = 0; zmin = 2.0f; ! ! // user-selected options ------------------- ! tcOptions* options = tcOptions::Get(); ! if (options->max3Drange == 2) ! { ! zmax = 100000.0f; ! } ! else if (options->max3Drange == 1) ! { ! zmax = 75000.0f; ! } ! else ! { ! zmax = 50000.0f; ! } ! ! useFarSceneView = options->useFarSceneView; ! ! shakeAirCamera = options->OptionStringExists("ShakeAirCamera"); ! // ---------------------- shiftDistance = 50000.0f; *************** *** 1921,1925 **** InitSceneView(pos, size); ! InitSceneViewFar(pos, size); InitGuiView(); --- 1996,2003 ---- InitSceneView(pos, size); ! if (useFarSceneView) ! { ! InitSceneViewFar(pos, size); ! } InitGuiView(); *************** *** 1944,1952 **** rootnode = new osg::Group; - rootnodeFar = new osg::Group; - rootnodeFar->addChild(rootnode.get()); sceneView->setSceneData(rootnode.get()); ! sceneViewFar->setSceneData(rootnodeFar.get()); hudObjects = new osg::MatrixTransform; --- 2022,2034 ---- rootnode = new osg::Group; sceneView->setSceneData(rootnode.get()); ! ! if (useFarSceneView) ! { ! rootnodeFar = new osg::Group; ! rootnodeFar->addChild(rootnode.get()); ! sceneViewFar->setSceneData(rootnodeFar.get()); ! } hudObjects = new osg::MatrixTransform; *************** *** 1966,1971 **** tc3DModel::LoadUnknowns(); - shakeAirCamera = tcOptions::Get()->OptionStringExists("ShakeAirCamera"); - defaultSensorModel = new tc3DModel(); defaultSensorModel->LoadXml("unknown.xml"); --- 2048,2051 ---- |
|
From: Dewitt C. <ddc...@us...> - 2005-07-16 23:13:17
|
Update of /cvsroot/gcblue/gcb_wx/src/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26502/src/common Modified Files: tcOptions.cpp Log Message: Fix for horizon darkening bug, option cleanup Index: tcOptions.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcOptions.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tcOptions.cpp 29 Mar 2005 00:12:25 -0000 1.16 --- tcOptions.cpp 16 Jul 2005 23:12:38 -0000 1.17 *************** *** 56,67 **** AddOption(oi); - oi.meType = tsOptionInfo::OT_RADIOBUTTON; - oi.mnStateCount = 3; - oi.mnValue = 1; - oi.mpAssociated = NULL; - oi.mzCaption[0] = "Test 1"; - oi.mzCaption[1] = "Test 2"; - oi.mzCaption[2] = "Test 3"; - AddOption(oi); oi.meType = tsOptionInfo::OT_RADIOBUTTON; --- 56,59 ---- *************** *** 81,100 **** AddOption(oi); - oi.meType = tsOptionInfo::OT_RADIOBUTTON; - oi.mnStateCount = 2; - oi.mnValue = 0; - oi.mpAssociated = &mbShowMapDebug; - oi.mzCaption[0] = "Map debug OFF"; - oi.mzCaption[1] = "Map debug ON"; - AddOption(oi); - oi.meType = tsOptionInfo::OT_RADIOBUTTON; - oi.mnStateCount = 3; - oi.mnValue = 0; - oi.mpAssociated = &debugLevel; - oi.mzCaption[0] = "Debug OFF"; - oi.mzCaption[1] = "Debug 1"; - oi.mzCaption[2] = "Debug 2"; - AddOption(oi); oi.meType = tsOptionInfo::OT_RADIOBUTTON; --- 73,77 ---- *************** *** 111,125 **** oi.mnValue = 0; oi.mpAssociated = &mbFillRangeCircles; ! oi.mzCaption[0] = "Circle sensor regions"; ! oi.mzCaption[1] = "Filled sensor regions"; AddOption(oi); - oi.meType = tsOptionInfo::OT_RADIOBUTTON; - oi.mnStateCount = 2; - oi.mnValue = 1; - oi.mpAssociated = &mbTextureMappedMaps; - oi.mzCaption[0] = "Use bitmap maps"; - oi.mzCaption[1] = "Use texture-mapped maps"; - AddOption(oi); oi.meType = tsOptionInfo::OT_RADIOBUTTON; --- 88,95 ---- oi.mnValue = 0; oi.mpAssociated = &mbFillRangeCircles; ! oi.mzCaption[0] = "Circle range regions"; ! oi.mzCaption[1] = "Filled range regions"; AddOption(oi); oi.meType = tsOptionInfo::OT_RADIOBUTTON; *************** *** 141,144 **** --- 111,133 ---- AddOption(oi); + oi.meType = tsOptionInfo::OT_RADIOBUTTON; + oi.mnStateCount = 3; + oi.mnValue = 0; + oi.mpAssociated = &max3Drange; + oi.mzCaption[0] = "50 km 3D range"; + oi.mzCaption[1] = "75 km 3D range"; + oi.mzCaption[2] = "100 km 3D range"; + AddOption(oi); + + oi.meType = tsOptionInfo::OT_RADIOBUTTON; + oi.mnStateCount = 2; + oi.mnValue = 1; + oi.mpAssociated = &useFarSceneView; + oi.mzCaption[0] = "Faster sceneview"; + oi.mzCaption[1] = "Reduce z-fighting"; + AddOption(oi); + + + Serialize(true); // read option state from file (options.dat) |
|
From: Dewitt C. <ddc...@us...> - 2005-07-16 23:13:16
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26502/src/sim Modified Files: tcMapData.cpp Log Message: Fix for horizon darkening bug, option cleanup Index: tcMapData.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapData.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** tcMapData.cpp 2 Jul 2005 16:51:12 -0000 1.22 --- tcMapData.cpp 16 Jul 2005 23:12:38 -0000 1.23 *************** *** 234,372 **** ! ! /********************************************************************/ ! // TODO: fix ! #if 0 ! void tcMapData::UpdateSurface(LPDIRECTDRAWSURFACE apDDS, tcRect view) { ! DDSURFACEDESC ddsd; ! HRESULT hr; ! HDC hdc; ! int nWidth,nHeight; ! RECT aDest[2],aSource[2], rDestHR, rSourceHR; ! int n,nBlockCount,bHRBlt; ! DDBLTFX fx; ! ! ddsd.dwSize = sizeof(DDSURFACEDESC); ! apDDS->GetSurfaceDesc(&ddsd); ! nWidth = ddsd.dwWidth; ! nHeight = ddsd.dwHeight; ! memset(&fx,0,sizeof(fx)); ! fx.dwSize = sizeof(DDBLTFX); ! fx.dwFillColor = 0x000000; ! ! if ((mpOptions!=NULL)&&(mpOptions->mnMapMode!=mnCurrentMapMode)) { ! mnCurrentMapMode = mpOptions->mnMapMode; ! CreateMapImage(mnCurrentMapMode,0); ! CreateMapImage(mnCurrentMapMode,1); ! } ! ! nBlockCount = GetLowResBltList(view, nWidth, nHeight, aSource, aDest); ! if (nBlockCount > 2) {nBlockCount = 2;} ! ! for(n=0;n<nBlockCount;n++) { ! hr = apDDS->Blt(&aDest[n],mpDDS_LowRes,&aSource[n],DDBLT_WAIT ,&fx); ! if (hr != DD_OK) { ! apDDS->Blt(NULL,NULL,NULL,DDBLT_WAIT|DDBLT_COLORFILL,&fx); // blt black if error ! } ! } ! ! bHRBlt = GetHighResBltList(view, nWidth, nHeight, &rSourceHR, &rDestHR); ! ! if (bHRBlt) { ! hr = apDDS->Blt(&rDestHR,mpDDS_HighRes,&rSourceHR,DDBLT_WAIT ,&fx); ! if (hr != DD_OK) { ! apDDS->Blt(NULL,NULL,NULL,DDBLT_WAIT|DDBLT_COLORFILL,&fx); // blt black if error ! } ! } ! ! /***** draw text debug info *****/ ! hr = apDDS->GetDC(&hdc); ! if ((hdc==NULL)||(hr != DD_OK)) {WTL("Failed to get DC");return;} ! ! if ((mpOptions != NULL)&&(mpOptions->mbShowMapDebug)) { ! //HFONT hFontOld = (HFONT)SelectObject(hdc,mhFontDefault); ! SetBkColor(hdc, RGB(0, 0, 0)); ! SetBkMode(hdc, TRANSPARENT); ! SetTextColor(hdc, RGB(255, 255, 255)); ! tcString sText; ! sText.Format("(%3.1f,%3.1f lon) (%3.1f,%3.1f lat)", ! view.left,view.right,view.bottom,view.top); ! TextOut(hdc,50, 100, sText, sText.GetLength()); ! ! sText.Format("(%3.1f,%3.1f lon) (%3.1f,%3.1f lat) (HR)", ! mrTheaterView.left,mrTheaterView.right,mrTheaterView.bottom,mrTheaterView.top); ! TextOut(hdc,50, 120, sText, sText.GetLength()); ! ! for(n=0;n<nBlockCount;n++) { ! sText.Format("block %d src: (LRTB) %d %d %d %d -> dest: %d %d %d %d ",n, ! aSource[n].left,aSource[n].right,aSource[n].top,aSource[n].bottom, ! aDest[n].left,aDest[n].right,aDest[n].top,aDest[n].bottom); ! TextOut(hdc,50, 140 + 20*n, sText, sText.GetLength()); ! } ! ! if (bHRBlt) { ! sText.Format("(LRTB) %d %d %d %d -> dest: %d %d %d %d (HR)", ! rSourceHR.left,rSourceHR.right,rSourceHR.top,rSourceHR.bottom, ! rDestHR.left,rDestHR.right,rDestHR.top,rDestHR.bottom); ! TextOut(hdc,50, 180, sText, sText.GetLength()); ! } ! } ! ! /***** draw theater box *****/ ! float fLonSpan_deg = view.Width(); ! float fLatSpan_deg = view.Height(); ! float fLatScale = (float)nHeight/fLatSpan_deg; ! float fLonScale = (float)nWidth/fLonSpan_deg; ! int x1 = (int)((mrTheaterView.left - view.left)*fLonScale); ! int x2 = (int)((mrTheaterView.right - view.left)*fLonScale); ! int y1 = (int)((view.top - mrTheaterView.bottom)*fLatScale); ! int y2 = (int)((view.top - mrTheaterView.top)*fLonScale); ! HPEN mhPenOld = (HPEN)SelectObject(hdc,mhPenBox); ! MoveToEx(hdc,x1,y1,NULL); ! LineTo(hdc,x2,y1); ! LineTo(hdc,x2,y2); ! LineTo(hdc,x1,y2); ! LineTo(hdc,x1,y1); ! SelectObject(hdc,mhPenOld); ! //SelectObject(hdc,hFontOld); ! apDDS->ReleaseDC(hdc); ! } ! ! /********************************************************************/ ! int tcMapData::CreateOffscreen(LPDIRECTDRAW apDD) ! { ! DDSURFACEDESC ddsd; ! HRESULT hr; ! ! /***** Create offscreen low resolution global map *****/ ! memset(&ddsd,0,sizeof(ddsd)); ! ddsd.dwSize = sizeof(ddsd); ! ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH; ! ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; ! ddsd.dwWidth = N_LOWRES; ! ddsd.dwHeight = M_LOWRES; ! ! hr = apDD->CreateSurface(&ddsd, &mpDDS_LowRes, NULL); ! if(hr != DD_OK) { ! AfxMessageBox("Error - tcMapData - CreateOffscreen (mpDDS_LowRes)"); ! return false; ! } ! ddsd.dwWidth = N_HIGHRES; ! ddsd.dwHeight = M_HIGHRES; ! ! hr = apDD->CreateSurface(&ddsd, &mpDDS_HighRes, NULL); ! if(hr != DD_OK) { ! AfxMessageBox("Error - tcMapData - CreateOffscreen (mpDDS_HighRes)"); ! return false; ! } ! return true; ! } ! /********************************************************************/ ! void tcMapData::ReleaseOffscreen() { ! if (mpDDS_LowRes != NULL) {mpDDS_LowRes->Release();} ! if (mpDDS_HighRes != NULL) {mpDDS_HighRes->Release();} ! } ! #endif ! /********************************************************************/ void tcMapData::CreatePalettes() { --- 234,240 ---- ! /** ! * ! */ void tcMapData::CreatePalettes() { |
|
From: Dewitt C. <ddc...@us...> - 2005-07-16 23:11:08
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26245/include/graphics Modified Files: tc3DViewer.h tc3DWindow.h Log Message: Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tc3DWindow.h 11 Jun 2005 21:01:43 -0000 1.16 --- tc3DWindow.h 16 Jul 2005 23:10:59 -0000 1.17 *************** *** 45,48 **** --- 45,49 ---- class Geode; class Geometry; + class Group; class MatrixTransform; class Projection; Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DViewer.h 14 Jul 2005 23:41:50 -0000 1.10 --- tc3DViewer.h 16 Jul 2005 23:10:59 -0000 1.11 *************** *** 195,198 **** --- 195,199 ---- float zmin; ///< depth buffer limits float zmax; + bool useFarSceneView; ///< true to use two scene views to suppress z-fighting // camera parameters |
|
From: Dewitt C. <ddc...@us...> - 2005-07-16 23:11:08
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26245/include/common Modified Files: tcOptions.h Log Message: Index: tcOptions.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/tcOptions.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcOptions.h 30 Dec 2004 17:26:05 -0000 1.11 --- tcOptions.h 16 Jul 2005 23:10:59 -0000 1.12 *************** *** 66,75 **** int mbPlayMusic; int disableSound; - int mbShowMapDebug; int mnMapMode; int mbFillRangeCircles; - int mbTextureMappedMaps; int mbUseNTDS; ! int debugLevel; /// 0 - own-alliance only, 1 - raw track data, 2 - add true pitch roll if available, 3 - use true data if avail --- 66,75 ---- int mbPlayMusic; int disableSound; int mnMapMode; int mbFillRangeCircles; int mbUseNTDS; ! ! int max3Drange; ///< 0 - 50 km, 1 - 75 km, 2 - 100 km ! int useFarSceneView; ///< 0 - only one scene view, 1 - use near and far scene views (help with z-fighting) /// 0 - own-alliance only, 1 - raw track data, 2 - add true pitch roll if available, 3 - use true data if avail |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:43:00
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15641/src/database Modified Files: tcSubDBObject.cpp Log Message: Fixed shaking object bug Index: tcSubDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcSubDBObject.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcSubDBObject.cpp 10 Jul 2005 20:32:03 -0000 1.2 --- tcSubDBObject.cpp 14 Jul 2005 23:42:21 -0000 1.3 *************** *** 153,157 **** wxASSERT(node); ! TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("sub"))->ToElement(); wxASSERT(false); --- 153,157 ---- wxASSERT(node); ! //TiXmlElement* localNode = node->InsertEndChild(TiXmlElement("sub"))->ToElement(); wxASSERT(false); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:42:37
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15641/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp tc3DViewer.cpp tcContainerGui.cpp tcHookInfo.cpp tcOOBView.cpp tcPlatformGui.cpp tcPopupControl.cpp tcStoresGui.cpp Log Message: Fixed shaking object bug Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tc3DModel.cpp 1 Jun 2005 00:13:30 -0000 1.26 --- tc3DModel.cpp 14 Jul 2005 23:42:22 -0000 1.27 *************** *** 68,71 **** --- 68,92 ---- std::vector<tcAnimationInfo>& animationInfo; // vector of animation state info to update + /** + * @return pivot parent group if this node has a pivot, otherwise return 0, set immediate child (pivotRotate) and childIdx + */ + osg::Group* GetPivotParent(osg::Group* node, osg::Group*& pivotRotate, unsigned int& childIdx) + { + pivotRotate = 0; + childIdx = 0; + + osg::Transform* pivotTranslate = node->asTransform(); + if (pivotTranslate == 0) return 0; + + pivotRotate = pivotTranslate->getParent(0); + if (pivotRotate == 0) return 0; + + osg::Group* parent = pivotRotate->getParent(0); + if (parent == 0) return 0; + + childIdx = parent->getChildIndex(pivotRotate); + return parent; + } + public: AnimationProcessor(std::vector<tcAnimationInfo>& ai) *************** *** 107,129 **** if (node.getNumParents() == 1) { ! osg::BoundingSphere bs = node.getBound(); ! osg::Matrix untransMatrix; ! osg::Matrix transMatrix; ! untransMatrix.setTrans(-bs.center()); ! transMatrix.setTrans(bs.center()); ! osg::MatrixTransform *untranslateTransform = new osg::MatrixTransform(untransMatrix); ! osg::MatrixTransform *translateTransform = new osg::MatrixTransform(transMatrix); osg::MatrixTransform *rotateTransform = new osg::MatrixTransform; // temporarily hold node to avoid delete when removing from parent osg::ref_ptr<osg::Node> temp = &node; ! osg::Group *parent = node.getParent(0); ! unsigned childIdx = parent->getChildIndex(&node); ! parent->setChild(childIdx, translateTransform); // replace child with transform ! untranslateTransform->addChild(&node); ! rotateTransform->addChild(untranslateTransform); ! translateTransform->addChild(rotateTransform); info->switchVariable = NULL; --- 128,174 ---- if (node.getNumParents() == 1) { ! osg::MatrixTransform *rotateTransform = new osg::MatrixTransform; + rotateTransform->setDataVariance(osg::Object::DYNAMIC); // temporarily hold node to avoid delete when removing from parent osg::ref_ptr<osg::Node> temp = &node; ! osg::Group *parent = node.getParent(0); ! unsigned childIdx; ! osg::Group* pivotRotate; ! if (osg::Group* pivotParent = GetPivotParent(parent, pivotRotate, childIdx)) // check if this is a pivot ! { ! osg::ref_ptr<osg::Group> temp = pivotRotate; ! pivotParent->setChild(childIdx, rotateTransform); ! rotateTransform->addChild(pivotRotate); ! ! if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) ! { ! fprintf(stdout, "added animation info (with pivot) for: %s\n", name.c_str()); ! } ! } ! else ! { ! childIdx = parent->getChildIndex(&node); ! osg::BoundingSphere bs = node.getBound(); ! osg::Matrix untransMatrix; ! osg::Matrix transMatrix; ! untransMatrix.setTrans(-bs.center()); ! transMatrix.setTrans(bs.center()); ! osg::MatrixTransform *untranslateTransform = new osg::MatrixTransform(untransMatrix); ! osg::MatrixTransform *translateTransform = new osg::MatrixTransform(transMatrix); + parent->setChild(childIdx, translateTransform); // replace child with transform + + untranslateTransform->addChild(&node); + rotateTransform->addChild(untranslateTransform); + translateTransform->addChild(rotateTransform); + + if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) + { + fprintf(stdout, "added animation info for: %s\n", name.c_str()); + } + } info->switchVariable = NULL; *************** *** 131,138 **** info->bound = true; ! if (tcOptions::Get()->OptionStringExists("Log3DModelDetails")) ! { ! std::cout << "added animation info for: " << name <<"\n"; ! } } else --- 176,181 ---- info->bound = true; ! ! } else Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcOOBView.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcOOBView.cpp 28 Jun 2005 02:51:34 -0000 1.9 --- tcOOBView.cpp 14 Jul 2005 23:42:22 -0000 1.10 *************** *** 391,396 **** void tcOOBView::Draw() { ! static int nFrameCount = 0; ! //if ((nFrameCount++ % 4)!=0) {return 1;} // draw every fourth call --- 391,396 ---- void tcOOBView::Draw() { ! static int frameCount = 0; ! if ((frameCount++ % 5) !=0 ) return; Index: tcHookInfo.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcHookInfo.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tcHookInfo.cpp 25 Jun 2005 22:10:35 -0000 1.12 --- tcHookInfo.cpp 14 Jul 2005 23:42:22 -0000 1.13 *************** *** 56,61 **** void tcHookInfo::DrawTrack(tnPoolIndex anID) { - - tcSensorMapTrack *pSMTrack; std::string s; char zBuff[128]; --- 56,59 ---- *************** *** 65,69 **** osg::Vec4 color; ! if (!(pSMTrack = mpSS->mcSensorMap.GetSensorMapTrack(anID, nOwnAlliance))) {return;} const tcTrack *pTrack = pSMTrack->GetTrack(); --- 63,68 ---- osg::Vec4 color; ! tcSensorMapTrack* pSMTrack = mpSS->mcSensorMap.GetSensorMapTrack(anID, nOwnAlliance); ! if (pSMTrack == 0) return; const tcTrack *pTrack = pSMTrack->GetTrack(); *************** *** 466,470 **** wxASSERT(mpSS); ! if ((nFrameCount++ % 8) != 0) return; // use to skip draw updates --- 465,469 ---- wxASSERT(mpSS); ! if ((nFrameCount++ % 4) != 0) return; // use to skip draw updates Index: tcStoresGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcStoresGui.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcStoresGui.cpp 22 Jun 2005 01:22:08 -0000 1.3 --- tcStoresGui.cpp 14 Jul 2005 23:42:23 -0000 1.4 *************** *** 225,230 **** if (stores == 0) return; ! tcStoresDBObject* databaseObj = stores->GetDatabaseObject(); ! wxASSERT(databaseObj); size_t nSlots = 16; // use magic number for now --- 225,230 ---- if (stores == 0) return; ! tcStoresDBObject* storesData = stores->GetDatabaseObject(); ! wxASSERT(storesData); size_t nSlots = 16; // use magic number for now Index: tcPopupControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPopupControl.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcPopupControl.cpp 1 Jun 2005 00:13:31 -0000 1.9 --- tcPopupControl.cpp 14 Jul 2005 23:42:22 -0000 1.10 *************** *** 49,59 **** Thaw(); - /* - mpBrush->SetColor(Color(0,0,0,0)); - pGraphics->SetCompositingMode(CompositingModeSourceCopy); - pGraphics->FillRectangle(mpBrush,0,0,mnWidth,mnHeight); - pGraphics->SetCompositingMode(CompositingModeSourceOver); - */ - if (mpPanel != NULL) { --- 49,52 ---- Index: tcPlatformGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcPlatformGui.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcPlatformGui.cpp 28 Jun 2005 02:51:34 -0000 1.4 --- tcPlatformGui.cpp 14 Jul 2005 23:42:22 -0000 1.5 *************** *** 123,127 **** tcContainerSlot& slot = slots[n]; tcContainerItem* item = slot.GetItem(); ! tcLauncherContainerItem* launcherItem = dynamic_cast<tcLauncherContainerItem*>(item); bool isMouseOver = slot.IsMouseOver(); --- 123,127 ---- tcContainerSlot& slot = slots[n]; tcContainerItem* item = slot.GetItem(); ! bool isMouseOver = slot.IsMouseOver(); Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ObjectUpdater.cpp 1 Jun 2005 00:13:30 -0000 1.18 --- ObjectUpdater.cpp 14 Jul 2005 23:42:22 -0000 1.19 *************** *** 81,86 **** { osg::MatrixTransform *xform = info.transform; ! osg::Matrix matrix = xform->getMatrix(); ! double angle = info.omega * viewer->GetGameTime(); // scale rotation rate by platform speed for propeller animation type --- 81,87 ---- { osg::MatrixTransform *xform = info.transform; ! //osg::Matrix matrix = xform->getMatrix(); ! double dt = viewer->GetGameTimeStep(); ! double theta = info.omega * dt; // change in angle // scale rotation rate by platform speed for propeller animation type *************** *** 92,100 **** if (gameObject->mcKin.mfSpeed_kts < 50.0f) { ! angle *= gameObject->mcKin.mfSpeed_kts; } } ! xform->setMatrix(matrix.rotate(angle , info.axis)); } } --- 93,103 ---- if (gameObject->mcKin.mfSpeed_kts < 50.0f) { ! theta *= gameObject->mcKin.mfSpeed_kts; } } + ! xform->preMult(osg::Matrix::rotate(theta , info.axis)); ! //xform->setMatrix(matrix.rotate(angle , info.axis)); } } Index: tcContainerGui.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcContainerGui.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcContainerGui.cpp 12 Jun 2005 20:46:58 -0000 1.2 --- tcContainerGui.cpp 14 Jul 2005 23:42:22 -0000 1.3 *************** *** 307,311 **** // clear mouseover state since OnMouseMove sometimes not called before leaving window size_t nSlots = slots.size(); ! bool foundSlot = false; for (size_t n=0; n<nSlots; n++) { --- 307,311 ---- // clear mouseover state since OnMouseMove sometimes not called before leaving window size_t nSlots = slots.size(); ! for (size_t n=0; n<nSlots; n++) { Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tc3DViewer.cpp 9 Jul 2005 14:43:40 -0000 1.21 --- tc3DViewer.cpp 14 Jul 2005 23:42:22 -0000 1.22 *************** *** 940,943 **** --- 940,945 ---- Swap(); } + + lastGameTime = gameTime; } *************** *** 1027,1030 **** --- 1029,1033 ---- const unsigned int limitMask = (~PTYPE_FIXED) & 0xFFF0; + if ((objClassification & limitMask) != 0) { *************** *** 1042,1045 **** --- 1045,1050 ---- if (cameraPosition._v[2] < min_z) cameraPosition._v[2] = min_z; } + + // workaround for sky issue, deactivate sky when camera underwater if (cameraPosition._v[2] < -1.0) *************** *** 1062,1065 **** --- 1067,1071 ---- bool shakeEligible = ((objClassification & (PTYPE_AIR | PTYPE_MISSILE)) != 0) && (cameraRange < 25.0f); + if (shakeAirCamera && shakeEligible) { *************** *** 1229,1233 **** { classification = 0; - fprintf(stderr, "tc3DViewer::GetHookedObjectPositionAndType - graphics error\n"); return lastPos; } --- 1235,1238 ---- *************** *** 1239,1242 **** --- 1244,1249 ---- y = LatToY(obj->mcKin.mfLat_rad); z = obj->mcKin.mfAlt_m; + + classification = obj->mpDBObject->mnType; } else *************** *** 1249,1252 **** --- 1256,1261 ---- y = LatToY(obj->mcKin.mfLat_rad); z = obj->mcKin.mfAlt_m; + + classification = obj->mpDBObject->mnType; } else if (tcSensorMapTrack* track = *************** *** 1258,1261 **** --- 1267,1272 ---- y = LatToY(predicted.mfLat_rad); z = predicted.GetOrGuessAltitude(); + + classification = predicted.mnClassification; } else *************** *** 1264,1267 **** --- 1275,1280 ---- y = lastPos._v[1]; z = lastPos._v[2]; + + classification = 0; fprintf(stderr, "tc3DViewer::GetHookedObjectPositionAndType - graphics error\n"); } *************** *** 1304,1308 **** guiView->setDisplaySettings(displaySettings.get()); guiView->setDefaults(); ! guiView->getState()->setContextID(1); wxWindow* parent = wxWindow::GetParent(); --- 1317,1321 ---- guiView->setDisplaySettings(displaySettings.get()); guiView->setDefaults(); ! //guiView->getState()->setContextID(1); wxWindow* parent = wxWindow::GetParent(); *************** *** 1361,1365 **** sceneView->setDisplaySettings(displaySettings.get()); sceneView->setDefaults(); ! sceneView->getState()->setContextID(0); wxWindow *parent = wxWindow::GetParent(); --- 1374,1378 ---- sceneView->setDisplaySettings(displaySettings.get()); sceneView->setDefaults(); ! //sceneView->getState()->setContextID(0); wxWindow *parent = wxWindow::GetParent(); *************** *** 1431,1435 **** sceneViewFar->setDisplaySettings(displaySettings.get()); sceneViewFar->setDefaults(); ! sceneViewFar->getState()->setContextID(2); wxWindow *parent = wxWindow::GetParent(); --- 1444,1448 ---- sceneViewFar->setDisplaySettings(displaySettings.get()); sceneViewFar->setDefaults(); ! //sceneViewFar->getState()->setContextID(2); wxWindow *parent = wxWindow::GetParent(); *************** *** 1791,1795 **** { static long lastHook = -1; ! if (!simState) return; if (lastHook != hookID) --- 1804,1808 ---- { static long lastHook = -1; ! if (lastHook != hookID) *************** *** 1838,1843 **** updateVisitorFar->setTraversalNumber(frameStampFar->getFrameNumber()); - - } --- 1851,1854 ---- *************** *** 1902,1905 **** --- 1913,1917 ---- cameraLookEl = 0; gameTime = 0; + lastGameTime = 0; simState = NULL; |
|
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; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:42:32
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15641/src/scriptinterface Modified Files: tcPlatformInterface.cpp tcSimPythonInterface.cpp tcSubInterface.cpp Log Message: Fixed shaking object bug Index: tcPlatformInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcPlatformInterface.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** tcPlatformInterface.cpp 2 Jul 2005 16:51:11 -0000 1.49 --- tcPlatformInterface.cpp 14 Jul 2005 23:42:23 -0000 1.50 *************** *** 996,1000 **** tcSensorMapTrack track; ! bool found = mpSimState->GetTrack(id, mpPlatformObj->GetAlliance(), track); return track; --- 996,1000 ---- tcSensorMapTrack track; ! mpSimState->GetTrack(id, mpPlatformObj->GetAlliance(), track); return track; Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** tcSimPythonInterface.cpp 10 Jul 2005 20:32:03 -0000 1.37 --- tcSimPythonInterface.cpp 14 Jul 2005 23:42:23 -0000 1.38 *************** *** 1126,1129 **** --- 1126,1130 ---- SubInterfaceType = class_<tcSubInterface>("SubInterfaceClass") + .def("GetBatteryFraction", &tcSubInterface::GetBatteryFraction) .def("GetMaxDepth", &tcSubInterface::GetMaxDepth) .def("GoToPeriscopeDepth", &tcSubInterface::GoToPeriscopeDepth) Index: tcSubInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSubInterface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcSubInterface.cpp 10 Jul 2005 20:32:03 -0000 1.5 --- tcSubInterface.cpp 14 Jul 2005 23:42:23 -0000 1.6 *************** *** 42,72 **** namespace scriptinterface { ! tcMessageInterface* tcSubInterface::messageInterface = 0; ! tcSound* tcSubInterface::sound = 0; ! tcSimState* tcSubInterface::simState = 0; ! /** ! * @return maximum depth in meters ! */ ! float tcSubInterface::GetMaxDepth() const ! { ! if (!subObj) return 0; ! return subObj->mpDBObject->mfMaxDepth_m; ! } ! void tcSubInterface::GoToPeriscopeDepth() ! { ! if (subObj) ! { ! subObj->SetAltitude(-subObj->GetPeriscopeDepth() + 0.4f); ! } ! } ! bool tcSubInterface::IsAtPeriscopeDepth() const ! { ! if (!subObj) return false; ! return subObj->IsAtPeriscopeDepth(); ! } bool tcSubInterface::IsDieselElectric() const --- 42,98 ---- namespace scriptinterface { ! tcMessageInterface* tcSubInterface::messageInterface = 0; ! tcSound* tcSubInterface::sound = 0; ! tcSimState* tcSubInterface::simState = 0; ! /** ! * @return battery charge fraction, 0 - 1 ! */ ! float tcSubInterface::GetBatteryFraction() const ! { ! if (!subObj) return 0; ! if (subObj->IsDieselElectric()) ! { ! float batteryCapacity = subObj->mpDBObject->batteryCapacity_kJ; ! if (batteryCapacity > 0) ! { ! return subObj->GetBatteryCharge() / batteryCapacity; ! } ! else ! { ! wxASSERT(false); ! return 1.0f; ! } ! } ! else ! { ! return 1.0f; ! } ! } ! /** ! * @return maximum depth in meters ! */ ! float tcSubInterface::GetMaxDepth() const ! { ! if (!subObj) return 0; ! return subObj->mpDBObject->mfMaxDepth_m; ! } ! ! void tcSubInterface::GoToPeriscopeDepth() ! { ! if (subObj) ! { ! subObj->SetAltitude(-subObj->GetPeriscopeDepth() + 0.4f); ! } ! } ! ! bool tcSubInterface::IsAtPeriscopeDepth() const ! { ! if (!subObj) return false; ! return subObj->IsAtPeriscopeDepth(); ! } bool tcSubInterface::IsDieselElectric() const *************** *** 76,185 **** } ! bool tcSubInterface::IsPeriscopeRaised() const ! { ! if (!subObj) return false; ! return subObj->GetPeriscopeState(); ! } ! bool tcSubInterface::IsRadarMastRaised() const ! { ! if (!subObj) return false; ! return subObj->GetRadarMastState(); ! } bool tcSubInterface::IsSnorkeling() const { if (!subObj) return false; ! return subObj->GetSnorkelState(); } ! /** ! * @return true if interface is valid sub interface ! */ ! bool tcSubInterface::IsValid() const ! { ! return (subObj != 0); ! } ! void tcSubInterface::LowerPeriscope() ! { ! if (subObj) ! { ! if (subObj->GetPeriscopeState()) ! { ! subObj->SetPeriscopeState(false); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): lowering scope\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! ! } ! } ! } ! } ! void tcSubInterface::LowerRadarMast() ! { ! if (subObj) ! { ! if (subObj->GetRadarMastState()) ! { ! subObj->SetRadarMastState(false); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): lowering radar mast\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } ! void tcSubInterface::RaisePeriscope() ! { ! if (subObj) ! { ! if (!subObj->GetPeriscopeState()) ! { ! subObj->SetPeriscopeState(true); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): raising scope\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } ! void tcSubInterface::RaiseRadarMast() ! { ! if (subObj) ! { ! if (!subObj->GetRadarMastState()) ! { ! subObj->SetRadarMastState(true); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): raising radar mast\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } void tcSubInterface::SetSnorkelState(bool state) --- 102,211 ---- } ! bool tcSubInterface::IsPeriscopeRaised() const ! { ! if (!subObj) return false; ! return subObj->GetPeriscopeState(); ! } ! bool tcSubInterface::IsRadarMastRaised() const ! { ! if (!subObj) return false; ! return subObj->GetRadarMastState(); ! } bool tcSubInterface::IsSnorkeling() const { if (!subObj) return false; ! return subObj->IsSnorkeling(); } ! /** ! * @return true if interface is valid sub interface ! */ ! bool tcSubInterface::IsValid() const ! { ! return (subObj != 0); ! } ! void tcSubInterface::LowerPeriscope() ! { ! if (subObj) ! { ! if (subObj->GetPeriscopeState()) ! { ! subObj->SetPeriscopeState(false); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): lowering scope\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } ! void tcSubInterface::LowerRadarMast() ! { ! if (subObj) ! { ! if (subObj->GetRadarMastState()) ! { ! subObj->SetRadarMastState(false); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): lowering radar mast\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } ! void tcSubInterface::RaisePeriscope() ! { ! if (subObj) ! { ! if (!subObj->GetPeriscopeState()) ! { ! subObj->SetPeriscopeState(true); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): raising scope\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! } ! } ! } ! void tcSubInterface::RaiseRadarMast() ! { ! if (subObj) ! { ! if (!subObj->GetRadarMastState()) ! { ! subObj->SetRadarMastState(true); ! if (subObj->IsOwnAlliance()) ! { ! wxString s = wxString::Format("%s (%s): raising radar mast\n", ! subObj->mzUnit.mz, subObj->mzClass.mz); ! messageInterface->ChannelMessage("Info", s.c_str()); ! sound->PlayEffect("LowBeep"); ! } ! ! } ! } ! } void tcSubInterface::SetSnorkelState(bool state) *************** *** 187,191 **** if (subObj) { ! if (subObj->GetSnorkelState() == state) return; // no change subObj->SetSnorkelState(state); --- 213,217 ---- if (subObj) { ! if (subObj->IsSnorkeling() == state) return; // no change subObj->SetSnorkelState(state); *************** *** 208,237 **** } ! tcSubInterface::tcSubInterface() ! : subObj(0) ! { ! } ! tcSubInterface::tcSubInterface(tcPlatformObject* obj) ! { ! subObj = dynamic_cast<tcSubObject*>(obj); ! if (!sound) ! { ! sound = tcSound::Get(); ! } ! if (!simState) ! { ! simState = tcSimState::Get(); ! } ! if (!messageInterface) ! { ! messageInterface = tcMessageInterface::Get(); ! } ! } ! tcSubInterface::~tcSubInterface() ! { ! } --- 234,263 ---- } ! tcSubInterface::tcSubInterface() ! : subObj(0) ! { ! } ! tcSubInterface::tcSubInterface(tcPlatformObject* obj) ! { ! subObj = dynamic_cast<tcSubObject*>(obj); ! if (!sound) ! { ! sound = tcSound::Get(); ! } ! if (!simState) ! { ! simState = tcSimState::Get(); ! } ! if (!messageInterface) ! { ! messageInterface = tcMessageInterface::Get(); ! } ! } ! tcSubInterface::~tcSubInterface() ! { ! } |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:41:59
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15566/include/sim Modified Files: tcSubObject.h Log Message: Fixed shaking object bug Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tcSubObject.h 10 Jul 2005 20:32:02 -0000 1.8 --- tcSubObject.h 14 Jul 2005 23:41:50 -0000 1.9 *************** *** 62,69 **** bool GetPeriscopeState() const; bool GetRadarMastState() const; ! bool GetSnorkelState() const; virtual float GetSonarSourceLevel() const; bool IsAtPeriscopeDepth() const; bool IsDieselElectric() const; bool IsSurfaced() const; void SetPeriscopeState(bool state); --- 62,70 ---- bool GetPeriscopeState() const; bool GetRadarMastState() const; ! virtual float GetSonarSourceLevel() const; bool IsAtPeriscopeDepth() const; bool IsDieselElectric() const; + bool IsSnorkeling() const; bool IsSurfaced() const; void SetPeriscopeState(bool state); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:41:59
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15566/include/scriptinterface Modified Files: tcSubInterface.h Log Message: Fixed shaking object bug Index: tcSubInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSubInterface.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcSubInterface.h 10 Jul 2005 20:32:02 -0000 1.4 --- tcSubInterface.h 14 Jul 2005 23:41:50 -0000 1.5 *************** *** 42,45 **** --- 42,47 ---- { public: + /// 0 - 1 battery charge + float GetBatteryFraction() const; /// max depth of this sub float GetMaxDepth() const; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:41:58
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15566/include/graphics Modified Files: tc3DViewer.h tcMapView.h Log Message: Fixed shaking object bug Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tcMapView.h 1 Jun 2005 00:13:26 -0000 1.19 --- tcMapView.h 14 Jul 2005 23:41:50 -0000 1.20 *************** *** 154,162 **** */ - #define CMD_DEACTIVATE 0 - #define CMD_ACTIVATE 1 - #define CMD_KILLPLATFORM 2 - #define N_PENS 10 /** --- 154,158 ---- Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DViewer.h 30 Jun 2005 01:06:08 -0000 1.9 --- tc3DViewer.h 14 Jul 2005 23:41:50 -0000 1.10 *************** *** 131,134 **** --- 131,135 ---- osg::Vec3 GetCameraPosition(); double GetGameTime() const {return gameTime;} + double GetGameTimeStep() const {return gameTime - lastGameTime;} const osg::Vec3& GetHookedObjectPositionAndType(unsigned int& classification); bool GetTerrainActive() const {return isTerrainActive;} *************** *** 191,194 **** --- 192,196 ---- float shiftDistance; ///< reset origin if camera distance from origin exceeds this double gameTime; ///< current game time [s] + double lastGameTime; ///< game time of previous call to Frame float zmin; ///< depth buffer limits float zmax; |
|
From: Dewitt C. <ddc...@us...> - 2005-07-14 23:41:58
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15566/include/ai Modified Files: tcAIData.h Log Message: Fixed shaking object bug Index: tcAIData.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/ai/tcAIData.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcAIData.h 1 Jun 2005 00:13:25 -0000 1.1 --- tcAIData.h 14 Jul 2005 23:41:50 -0000 1.2 *************** *** 35,38 **** --- 35,43 ---- namespace ai { + /** + * This class is part of the older ai system that has been (mostly) + * replaced by the ai::Task and ai::Blackboard classes. Eventually + * this class should be refactored out of the code. + */ class tcOrder { |
|
From: Dewitt C. <ddc...@us...> - 2005-07-10 20:32:48
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5550/include/database Modified Files: tcSubDBObject.h Log Message: Diesel-electric battery and snorkeling Index: tcSubDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcSubDBObject.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tcSubDBObject.h 7 Jul 2005 01:13:23 -0000 1.1 --- tcSubDBObject.h 10 Jul 2005 20:32:01 -0000 1.2 *************** *** 51,55 **** bool isDieselElectric; ///< true if diesel electric float batteryCapacity_kJ; ///< battery capacity when fully charged ! float batteryRate_kW; ///< battery drain rate at max thrust float batteryCharge_kW; ///< charge rate when snorkeling on generators --- 51,55 ---- bool isDieselElectric; ///< true if diesel electric float batteryCapacity_kJ; ///< battery capacity when fully charged ! float batteryRate_kW; ///< battery drain rate at min thrust, scaled to 4x at max thrust float batteryCharge_kW; ///< charge rate when snorkeling on generators *************** *** 82,86 **** // calculated parameters float invCavitationSlope; ///< 1/cavitationSlope ! float batteryDrainConstant; /// [kW/mps] void CalculateParams(); --- 82,87 ---- // calculated parameters float invCavitationSlope; ///< 1/cavitationSlope ! float batteryDrainConstant; ///< [kW/mps] ! float invMaxSpeed_mps; ///< 1 / max speed in mps void CalculateParams(); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-10 20:32:41
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5550/include/sim Modified Files: tcSubObject.h Log Message: Diesel-electric battery and snorkeling Index: tcSubObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tcSubObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tcSubObject.h 7 Jul 2005 01:13:23 -0000 1.7 --- tcSubObject.h 10 Jul 2005 20:32:02 -0000 1.8 *************** *** 58,69 **** --- 58,73 ---- virtual void Serialize(tcFile& file, bool mbLoad); + float GetBatteryCharge() const; float GetPeriscopeDepth() const; bool GetPeriscopeState() const; bool GetRadarMastState() const; + bool GetSnorkelState() const; virtual float GetSonarSourceLevel() const; bool IsAtPeriscopeDepth() const; + bool IsDieselElectric() const; bool IsSurfaced() const; void SetPeriscopeState(bool state); void SetRadarMastState(bool state); + void SetSnorkelState(bool state); virtual tcCommandStream& operator<<(tcCommandStream& stream); *************** *** 85,92 **** --- 89,98 ---- bool radarMastRaised; bool periscopeRaised; + bool isSnorkeling; ///< true if diesel generator active and snorkeling (DE subs only) float periscopeDepth_m; ///< periscope depth (positive number) float invPeriscopeDepth; ///< 1/periscopeDepth_m float lastDepth_m; ///< for depth notification messages bool doneSinking; + float batteryCharge; ///< current battery charge (DE subs only) void UpdateDestroyed(double t); |
|
From: Dewitt C. <ddc...@us...> - 2005-07-10 20:32:41
|
Update of /cvsroot/gcblue/gcb_wx/include/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5550/include/scriptinterface Modified Files: tcSubInterface.h Log Message: Diesel-electric battery and snorkeling Index: tcSubInterface.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/scriptinterface/tcSubInterface.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcSubInterface.h 22 Jun 2005 01:21:26 -0000 1.3 --- tcSubInterface.h 10 Jul 2005 20:32:02 -0000 1.4 *************** *** 47,55 **** void GoToPeriscopeDepth(); /// true if at periscope depth ! bool IsAtPeriscopeDepth(); /// true if periscope is raised bool IsPeriscopeRaised() const; /// true if radar mast is raised bool IsRadarMastRaised() const; /// true if this is a valid interface bool IsValid() const; --- 47,59 ---- void GoToPeriscopeDepth(); /// true if at periscope depth ! bool IsAtPeriscopeDepth() const; ! /// true if this is a diesel-electric sub ! bool IsDieselElectric() const; /// true if periscope is raised bool IsPeriscopeRaised() const; /// true if radar mast is raised bool IsRadarMastRaised() const; + /// true if snorkeling + bool IsSnorkeling() const; /// true if this is a valid interface bool IsValid() const; *************** *** 62,65 **** --- 66,71 ---- /// raise the radar mast (must be at periscope depth or shallower) void RaiseRadarMast(); + /// start or stop snorkeling (must be at periscope depth or shallower) + void SetSnorkelState(bool state); tcSubInterface(); |