gcblue-commits Mailing List for Global Conflict Blue (Page 68)
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: <ddc...@us...> - 2004-01-20 03:02:55
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv12457/include/graphics Modified Files: tcwindow.h Removed Files: tcrendersurface.h Log Message: Index: tcwindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcwindow.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcwindow.h 3 Jan 2004 00:45:12 -0000 1.13 --- tcwindow.h 20 Jan 2004 03:02:52 -0000 1.14 *************** *** 124,127 **** --- 124,128 ---- void OnPaint(wxPaintEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); + virtual void OnShow(wxShowEvent& event); virtual void OnSize(wxSizeEvent& event); void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame --- tcrendersurface.h DELETED --- |
From: <ddc...@us...> - 2004-01-20 03:02:55
|
Update of /cvsroot/gcblue/gcb_wx/include/common In directory sc8-pr-cvs1:/tmp/cvs-serv12457/include/common Modified Files: simmath.h Log Message: Index: simmath.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/common/simmath.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** simmath.h 8 Jan 2004 23:54:26 -0000 1.6 --- simmath.h 20 Jan 2004 03:02:52 -0000 1.7 *************** *** 155,158 **** --- 155,159 ---- + float CalculateCollisionPoint(const tcKinematics& collider, float& dxi, float& dyi, float& dzi); void Clear() {mfLon_rad=0;mfLat_rad=0;mfAlt_m=0; mfHeading_rad=0;mfClimbAngle_rad=0;mfSpeed_kts=0; |
From: <ddc...@us...> - 2004-01-20 03:02:55
|
Update of /cvsroot/gcblue/gcb_wx In directory sc8-pr-cvs1:/tmp/cvs-serv12457 Modified Files: GCblue.vcproj Log Message: Index: GCblue.vcproj =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/GCblue.vcproj,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GCblue.vcproj 10 Jan 2004 21:55:30 -0000 1.33 --- GCblue.vcproj 20 Jan 2004 03:02:52 -0000 1.34 *************** *** 39,43 **** Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23_d.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib Producerd.lib Gdiplus.lib GLaux.lib OpenAL32d.lib ALutd.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib osgd.lib osgProducerd.lib osgDBd.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" --- 39,43 ---- Name="VCLinkerTool" IgnoreImportLibrary="FALSE" ! AdditionalDependencies="python23_d.lib boost_python_debug.lib winmm.lib opengl32.lib glu32.lib Producerd.lib Gdiplus.lib GLaux.lib OpenAL32d.lib ALutd.lib comctl32.lib rpcrt4.lib wsock32.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib osgd.lib osgDBd.lib osgTextd.lib osgUtild.lib DemeterDebug.lib DemeterOSGDebug.lib ogg_static_d.lib vorbis_static_d.lib vorbisfile_static_d.lib" ShowProgress="0" OutputFile="$(ProjectDir)/bin/GCblueD.exe" *************** *** 99,103 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib winmm.LIB opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32.lib ALut.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib Producer.lib osg.lib osgProducer.lib osgDB.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" --- 99,103 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="boost_python.lib python23.lib winmm.LIB opengl32.lib glu32.lib Gdiplus.lib GLaux.lib OpenAL32.lib ALut.lib comctl32.lib rpcrt4.lib wsock32.lib wxmsw.lib png.lib zlib.lib jpeg.lib tiff.lib osg.lib osgProducer.lib osgDB.lib osgUtil.lib osgText.lib Demeter.lib DemeterOSG.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib" OutputFile="$(ProjectDir)/bin/$(ProjectName).exe" LinkIncremental="1" *************** *** 238,244 **** </File> <File - RelativePath="src\graphics\tcrendersurface.cpp"> - </File> - <File RelativePath="src\graphics\tcwindow.cpp"> </File> --- 238,241 ---- *************** *** 559,565 **** </File> <File - RelativePath="include\graphics\tcrendersurface.h"> - </File> - <File RelativePath="include\graphics\tcwindow.h"> </File> --- 556,559 ---- |
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv29520/src/sim Modified Files: Tag: v0_5_0 Game.cpp tc3DViewer.cpp tcCreditView.cpp tcMapView.cpp tcObjectControl.cpp Log Message: Fixed some bugs: popup menu loc, briefing view symbol placement, block artifacts Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.52 retrieving revision 1.52.2.1 diff -C2 -d -r1.52 -r1.52.2.1 *** Game.cpp 9 Jan 2004 21:48:40 -0000 1.52 --- Game.cpp 19 Jan 2004 21:20:58 -0000 1.52.2.1 *************** *** 91,94 **** --- 91,96 ---- gameDateZulu(2000,4,10,5,0,0) { + wxWindow::Show(false); + SetBackgroundColour(*wxBLACK); viewer = NULL; infoConsole = NULL; *************** *** 373,376 **** --- 375,380 ---- meGameMode = GM_START; meScreenMode = START; + + wxWindow::Show(true); } catch(std::string s) *************** *** 756,759 **** --- 760,764 ---- popupControl->AttachPythonInterface(pythonInterface); popupControl->SetActive(false); + popupControl->Show(true); // to prevent artifact at first view popupControl->SetBlend(true); popupControl->SetSkipCount(0); *************** *** 1020,1023 **** --- 1025,1029 ---- } + viewer->SetActive(false); viewer->Update(gameDateZulu); mpGraphicsEngine->RenderAll(); *************** *** 1291,1302 **** viewer->Update(gameDateZulu); ! mpGraphicsEngine->RenderAll(); ! if (mcOptions.debugLevel > 1) ! { ! wxMessageBox("pre Frame()\n"); ! } ! ! viewer->Frame(); if (mcOptions.debugLevel > 1) --- 1297,1311 ---- viewer->Update(gameDateZulu); ! if (directorTime >= 0.1f) ! { ! mpGraphicsEngine->RenderAll(); ! if (mcOptions.debugLevel > 1) ! { ! wxMessageBox("pre Frame()\n"); ! } ! ! viewer->Frame(); ! } if (mcOptions.debugLevel > 1) Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.24 retrieving revision 1.24.2.1 diff -C2 -d -r1.24 -r1.24.2.1 *** tc3DViewer.cpp 3 Jan 2004 00:45:13 -0000 1.24 --- tc3DViewer.cpp 19 Jan 2004 21:20:58 -0000 1.24.2.1 *************** *** 167,171 **** void tc3DViewer::OnRButtonDown(wxMouseEvent& event) { ! event.Skip(); } --- 167,171 ---- void tc3DViewer::OnRButtonDown(wxMouseEvent& event) { ! // event.Skip(); } *************** *** 873,879 **** tc3DViewer::tc3DViewer(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW , name), mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { lonToGridX = C_RADTOM; latToGridY = C_RADTOM; --- 873,882 ---- tc3DViewer::tc3DViewer(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE , name), mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { + SetBackgroundColour(*wxBLACK); + wxWindow::Show(false); + lonToGridX = C_RADTOM; latToGridY = C_RADTOM; Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCreditView.cpp,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** tcCreditView.cpp 13 Jan 2004 00:07:40 -0000 1.6.2.1 --- tcCreditView.cpp 19 Jan 2004 21:20:58 -0000 1.6.2.2 *************** *** 76,81 **** AddCredit(s, 60.0f, false); ! s = "Testers\n...\n"; ! AddCredit(s, 60.0f, false); s = "Some 2D art courtesy of U.S. Navy, www.news.navy.mil/view_galleries.asp \n"; --- 76,81 ---- AddCredit(s, 60.0f, false); ! // s = "Testers\n...\n"; ! // AddCredit(s, 60.0f, false); s = "Some 2D art courtesy of U.S. Navy, www.news.navy.mil/view_galleries.asp \n"; *************** *** 131,135 **** s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; ! AddCredit(s, 50.0f, false); --- 131,135 ---- s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; ! AddCredit(s, 120.0f, false); *************** *** 140,144 **** AddCredit(s, 20.0f, false); ! s = "www.gcblue.sourceforge.net"; AddCredit(s, 20.0f, false); --- 140,144 ---- AddCredit(s, 20.0f, false); ! s = "www.gcblue.com"; AddCredit(s, 20.0f, false); Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcMapView.cpp,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** tcMapView.cpp 9 Jan 2004 21:48:40 -0000 1.15 --- tcMapView.cpp 19 Jan 2004 21:20:58 -0000 1.15.2.1 *************** *** 163,166 **** --- 163,167 ---- // mnWidth and mnHeight updated by tcWindow::OnSize terrainView->SetSize(wxRect(pos.x,pos.y,mnWidth,mnHeight)); + CalcViewParameters(); } *************** *** 539,543 **** else if (mnGameMode == GAMEMODE_PAUSED) { ! sText.Format("%s (PAUSED)",dateTime.c_str()); mpBrush->SetColor(Color(254,125,125,255)); } --- 540,544 ---- else if (mnGameMode == GAMEMODE_PAUSED) { ! sText.Format("%s ",dateTime.c_str()); mpBrush->SetColor(Color(254,125,125,255)); } Index: tcObjectControl.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcObjectControl.cpp,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** tcObjectControl.cpp 4 Jan 2004 22:24:53 -0000 1.9 --- tcObjectControl.cpp 19 Jan 2004 21:20:58 -0000 1.9.2.1 *************** *** 1357,1360 **** --- 1357,1361 ---- } + /******************************************************************************/ void tcObjectControl::InitControls() |
From: <ddc...@us...> - 2004-01-19 21:21:01
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv29520/src/graphics Modified Files: Tag: v0_5_0 tcwindow.cpp Log Message: Fixed some bugs: popup menu loc, briefing view symbol placement, block artifacts Index: tcwindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcwindow.cpp,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** tcwindow.cpp 3 Jan 2004 00:45:12 -0000 1.14 --- tcwindow.cpp 19 Jan 2004 21:20:58 -0000 1.14.2.1 *************** *** 51,56 **** --- 51,64 ---- EVT_LEAVE_WINDOW(tcWindow::OnLeaveWindow) EVT_SIZE(tcWindow::OnSize) + EVT_SHOW(tcWindow::OnShow) END_EVENT_TABLE() + + void tcWindow::OnShow(wxShowEvent& event) + { + fprintf(stdout, "Show event: [%s]\n",GetName()); + return; + } + /** * This override along with use of Freeze() Thaw() prevents *************** *** 107,116 **** void tcWindow::OnLButtonDown(wxMouseEvent& event) { ! event.Skip(); } void tcWindow::OnLButtonUp(wxMouseEvent& event) { ! event.Skip(); } --- 115,124 ---- void tcWindow::OnLButtonDown(wxMouseEvent& event) { ! SkipMouseEvent(event); } void tcWindow::OnLButtonUp(wxMouseEvent& event) { ! SkipMouseEvent(event); } *************** *** 137,141 **** void tcWindow::OnRButtonDown(wxMouseEvent& event) { ! event.Skip(); } --- 145,149 ---- void tcWindow::OnRButtonDown(wxMouseEvent& event) { ! SkipMouseEvent(event); } *************** *** 231,241 **** if (abActive) { ! wxWindow::Enable(true); ! //wxWindow::Move(wxPoint(mrectWindow.left,mrectWindow.top)); } else { wxWindow::Enable(false); - //wxWindow::Move(wxPoint(10000,10000)); } mbActive=abActive; --- 239,251 ---- if (abActive) { ! wxWindow::Enable(true); ! if (!wxWindow::IsShown()) ! { ! wxWindow::Show(true); ! } } else { wxWindow::Enable(false); } mbActive=abActive; *************** *** 568,574 **** tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW , name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { mbCloned = false; --- 578,586 ---- tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW | wxNO_FULL_REPAINT_ON_RESIZE , name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { + wxWindow::Show(false); + SetBackgroundColour(*wxBLACK); mbCloned = false; |
From: <ddc...@us...> - 2004-01-19 21:21:01
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv29520/scripts Modified Files: Tag: v0_5_0 Menu.py Log Message: Fixed some bugs: popup menu loc, briefing view symbol placement, block artifacts Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Menu.py 2 Nov 2003 20:04:01 -0000 1.2 --- Menu.py 19 Jan 2004 21:20:58 -0000 1.2.2.1 *************** *** 53,57 **** UnitMenu.BeginSubMenu() UnitMenu.AddItem('Add patrol order','AddPatrolOrder') - UnitMenu.AddItem('Crash dive', 'AddCrashOrder') UnitMenu.AddItemUI('Add waypoint order', 'AddWaypointOrder', 'Datum') UnitMenu.AddItem('Clear orders','ClearOrders') --- 53,56 ---- |
From: <ddc...@us...> - 2004-01-19 21:21:01
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1:/tmp/cvs-serv29520/include/sim Modified Files: Tag: v0_5_0 tc3DViewer.h Log Message: Fixed some bugs: popup menu loc, briefing view symbol placement, block artifacts Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** tc3DViewer.h 3 Jan 2004 00:45:12 -0000 1.18 --- tc3DViewer.h 19 Jan 2004 21:20:57 -0000 1.18.2.1 *************** *** 110,114 **** bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); ! void SetActive(bool b) {isActive = b;wxWindow::Enable(b);} void SetCameraMode(bool lookAt, bool moveWith); void SetGameTime(double t); --- 110,114 ---- bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); ! void SetActive(bool b) {isActive = b;wxWindow::Enable(b);wxWindow::Show(b);} void SetCameraMode(bool lookAt, bool moveWith); void SetGameTime(double t); |
From: <ddc...@us...> - 2004-01-19 21:21:01
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv29520/include/graphics Modified Files: Tag: v0_5_0 tcwindow.h Log Message: Fixed some bugs: popup menu loc, briefing view symbol placement, block artifacts Index: tcwindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcwindow.h,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** tcwindow.h 3 Jan 2004 00:45:12 -0000 1.13 --- tcwindow.h 19 Jan 2004 21:20:57 -0000 1.13.2.1 *************** *** 114,118 **** virtual void OnChar(wxKeyEvent& event); virtual void OnEnterWindow(wxMouseEvent& event); ! void OnEraseBackground(wxEraseEvent& event); virtual void OnKeyDown(wxKeyEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); --- 114,118 ---- virtual void OnChar(wxKeyEvent& event); virtual void OnEnterWindow(wxMouseEvent& event); ! virtual void OnEraseBackground(wxEraseEvent& event); virtual void OnKeyDown(wxKeyEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); *************** *** 122,127 **** virtual void OnMouseWheel(wxMouseEvent& event); virtual void OnMove(wxMoveEvent& event); ! void OnPaint(wxPaintEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); virtual void OnSize(wxSizeEvent& event); void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame --- 122,128 ---- virtual void OnMouseWheel(wxMouseEvent& event); virtual void OnMove(wxMoveEvent& event); ! virtual void OnPaint(wxPaintEvent& event); virtual void OnRButtonDown(wxMouseEvent& event); + virtual void OnShow(wxShowEvent& event); virtual void OnSize(wxSizeEvent& event); void SkipMouseEvent(wxMouseEvent& event); ///< adjusts position to parent frame |
From: <ddc...@us...> - 2004-01-18 18:42:45
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv28162/src/sim Modified Files: Game.cpp tc3DViewer.cpp tcOOBView.cpp Log Message: Changes to reduce block artifacts at screen transitions--planning to eliiminate Producer to fix gray background screen issue Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Game.cpp 14 Jan 2004 01:13:22 -0000 1.53 --- Game.cpp 18 Jan 2004 18:42:41 -0000 1.54 *************** *** 86,90 **** */ tcGame::tcGame(const wxPoint& pos, const wxSize& size) : ! wxFrame((wxFrame *)NULL, -1, "Global Conflict", pos, size, 0*wxTRANSPARENT_WINDOW), // | wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN framePos(pos.x, pos.y), frameSize(size.GetWidth(), size.GetHeight()), mnWidth(size.GetWidth()), mnHeight(size.GetHeight()), --- 86,90 ---- */ tcGame::tcGame(const wxPoint& pos, const wxSize& size) : ! wxFrame((wxFrame *)NULL, -1, "Global Conflict", pos, size, wxNO_FULL_REPAINT_ON_RESIZE), // | wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN framePos(pos.x, pos.y), frameSize(size.GetWidth(), size.GetHeight()), mnWidth(size.GetWidth()), mnHeight(size.GetHeight()), *************** *** 103,106 **** --- 103,108 ---- popupControl = NULL; director = NULL; + SetBackgroundColour(*wxBLACK); + Show(FALSE); pythonInterface = new tcSimPythonInterface(); *************** *** 396,401 **** viewer->SetActive(false); ! ! mb3DActive = true; size3D = MODE3D_SMALL; } --- 398,404 ---- viewer->SetActive(false); ! viewer->Show(FALSE); ! viewer->Freeze(); ! mb3DActive = false; size3D = MODE3D_SMALL; } *************** *** 939,944 **** --- 942,949 ---- tacticalMap->Freeze(); // call Freeze() to prevent flicker on resize + wxWindow::Freeze(); tacticalMap->SetSize(wxRect(w,0,mnWidth-w,mnHeight-mnBottomMargin)); tacticalMapSize = mapSize; + wxWindow::Thaw(); } *************** *** 1019,1023 **** break; } ! viewer->Update(gameDateZulu); mpGraphicsEngine->RenderAll(); --- 1024,1028 ---- break; } ! viewer->SetActive(false); viewer->Update(gameDateZulu); mpGraphicsEngine->RenderAll(); *************** *** 1291,1303 **** viewer->Update(gameDateZulu); ! mpGraphicsEngine->RenderAll(); - if (mcOptions.debugLevel > 1) - { - wxMessageBox("pre Frame()\n"); - } - - viewer->Frame(); if (mcOptions.debugLevel > 1) { --- 1296,1311 ---- viewer->Update(gameDateZulu); ! if (directorTime > 0.1f) ! { ! mpGraphicsEngine->RenderAll(); + if (mcOptions.debugLevel > 1) + { + wxMessageBox("pre Frame()\n"); + } + + viewer->Frame(); + } if (mcOptions.debugLevel > 1) { Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tc3DViewer.cpp 16 Jan 2004 00:04:14 -0000 1.26 --- tc3DViewer.cpp 18 Jan 2004 18:42:41 -0000 1.27 *************** *** 448,452 **** void tc3DViewer::Frame() { ! if (isFrozen) { wxWindow::Thaw(); --- 448,452 ---- void tc3DViewer::Frame() { ! if (isFrozen && isActive) { wxWindow::Thaw(); *************** *** 454,461 **** } if (isActive && camera_group.valid()) - // if (isActive && camera_group) { camera_group->frame(); - //camera_group->sync(); } else --- 454,459 ---- *************** *** 726,731 **** sv->setCullingMode( osg::CullStack::FAR_PLANE_CULLING | ! osg::CullStack::NEAR_PLANE_CULLING | ! osg::CullStack::SMALL_FEATURE_CULLING ); --- 724,730 ---- sv->setCullingMode( osg::CullStack::FAR_PLANE_CULLING | ! osg::CullStack::NEAR_PLANE_CULLING ! //osg::CullStack::VIEW_FRUSTUM_CULLING ! // osg::CullStack::SMALL_FEATURE_CULLING ); *************** *** 867,873 **** tc3DViewer::tc3DViewer(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW , name), mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { lonToGridX = C_RADTOM; latToGridY = C_RADTOM; --- 866,875 ---- tc3DViewer::tc3DViewer(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW, name), mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { + SetBackgroundColour(*wxBLACK); + Show(FALSE); + lonToGridX = C_RADTOM; latToGridY = C_RADTOM; Index: tcOOBView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcOOBView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcOOBView.cpp 30 Nov 2003 17:23:52 -0000 1.4 --- tcOOBView.cpp 18 Jan 2004 18:42:41 -0000 1.5 *************** *** 187,191 **** static int nFrameCount = 0; ! if ((nFrameCount++ % 4)==0) {return 1;} // draw every fourth call if (!GetGraphics(pGraphics)) { --- 187,191 ---- static int nFrameCount = 0; ! //if ((nFrameCount++ % 4)!=0) {return 1;} // draw every fourth call if (!GetGraphics(pGraphics)) { |
From: <ddc...@us...> - 2004-01-18 18:42:44
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv28162/src/graphics Modified Files: tc3DModel.cpp tc3DTerrain.cpp tcwindow.cpp Log Message: Changes to reduce block artifacts at screen transitions--planning to eliiminate Producer to fix gray background screen issue Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tc3DModel.cpp 16 Jan 2004 00:04:14 -0000 1.3 --- tc3DModel.cpp 18 Jan 2004 18:42:41 -0000 1.4 *************** *** 148,154 **** public: ! inline ModelCopyOp(tc3DModel *model): osg::CopyOp(SHALLOW_COPY), ! _model(model) {} --- 148,156 ---- public: ! inline ModelCopyOp(tc3DModel *model, bool rebindAnimations, float detailThreshold): osg::CopyOp(SHALLOW_COPY), ! _model(model), ! _rebindAnimations(rebindAnimations), ! _detailThreshold(detailThreshold) {} *************** *** 156,160 **** virtual osg::Node* operator() (const osg::Node* node) const { ! if (const osg::Transform *xform = node->asTransform()) { size_t nAnimations = _model->animationInfo.size(); --- 158,163 ---- virtual osg::Node* operator() (const osg::Node* node) const { ! const osg::Transform *xform = node->asTransform(); ! if ((_rebindAnimations)&&(xform)) { size_t nAnimations = _model->animationInfo.size(); *************** *** 170,174 **** } ! osg::Object *obj = (node->clone(ModelCopyOp(_model))); osg::Node* ret_node = dynamic_cast<osg::Node*>(obj); --- 173,178 ---- } ! osg::Object *obj ! = (node->clone(ModelCopyOp(_model, _rebindAnimations, _detailThreshold))); osg::Node* ret_node = dynamic_cast<osg::Node*>(obj); *************** *** 190,195 **** else { ! osg::Node* ret_node = CopyOp::operator()(node); ! return ret_node; } } --- 194,209 ---- else { ! // shallow copy node if larger than detail threshold ! const BoundingSphere& bs = node->getBound(); ! if (bs.radius() >= _detailThreshold) ! { ! osg::Node* ret_node = CopyOp::operator()(node); // shallow copy of node ! return ret_node; ! } ! else ! { ! return NULL; // osg::Group will not add null child ! } ! } } *************** *** 200,205 **** if (attr) { ! ret_attr = dynamic_cast<osg::StateAttribute*> ! (attr->clone(CopyOp(osg::CopyOp::DEEP_COPY_STATEATTRIBUTES))); } else --- 214,226 ---- if (attr) { ! if (_rebindAnimations) ! { ! ret_attr = dynamic_cast<osg::StateAttribute*> ! (attr->clone(CopyOp(osg::CopyOp::DEEP_COPY_STATEATTRIBUTES))); ! } ! else ! { ! ret_attr = CopyOp::operator()(attr); // shallow copy ! } } else *************** *** 212,215 **** --- 233,238 ---- protected: tc3DModel *_model; + bool _rebindAnimations; ///< set true if transforms should be deep copied and re-bound to animations + float _detailThreshold; ///< do not copy nodes smaller than this value }; *************** *** 231,240 **** void tc3DModel::DetachFromParent() { ! modelGroup->getParent(0)->removeChild(modelGroup.get()); } osg::ref_ptr<osg::Node> tc3DModel::GetNode() { ! osg::ref_ptr<osg::Node> node = modelGroup.get(); return node; } --- 254,263 ---- void tc3DModel::DetachFromParent() { ! modelTransform->getParent(0)->removeChild(modelTransform.get()); } osg::ref_ptr<osg::Node> tc3DModel::GetNode() { ! osg::ref_ptr<osg::Node> node = modelTransform.get(); return node; } *************** *** 242,247 **** unsigned int tc3DModel::GetNumParents() { ! wxASSERT(modelGroup.valid()); ! return modelGroup->getNumParents(); } --- 265,270 ---- unsigned int tc3DModel::GetNumParents() { ! wxASSERT(modelTransform.valid()); ! return modelTransform->getNumParents(); } *************** *** 342,349 **** - modelGroup = new osg::Group; modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); ! modelGroup->addChild(modelTransform.get()); animationInfo.clear(); --- 365,373 ---- modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); ! modelGroup = new osg::LOD; ! ! modelTransform->addChild(modelGroup.get()); animationInfo.clear(); *************** *** 354,360 **** } ! modelNode = dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this))); ! modelTransform->addChild(modelNode.get()); --- 378,396 ---- } ! modelNode = dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this,true,0))); ! // add children with varying level of detail ! modelGroup->addChild(modelNode.get(),0,200.0); ! modelGroup->addChild( ! dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this,false,2.0f))) ! , 200.0, 500.0); ! modelGroup->addChild( ! dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this,false,5.0f))) ! , 500.0, 10000.0); ! modelGroup->addChild( ! dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this,false,10.0f))) ! , 10000.0, 20000.0); ! ! unsigned nRanges = modelGroup->getNumRanges(); Index: tc3DTerrain.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DTerrain.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tc3DTerrain.cpp 16 Dec 2003 00:02:47 -0000 1.8 --- tc3DTerrain.cpp 18 Jan 2004 18:42:41 -0000 1.9 *************** *** 193,197 **** terrainNode->addDrawable(pDrawable); terrainNode->setCullingActive(false); // disables small feature and view frustrum culling ! float detailThreshold = 5.0f; terrain->SetDetailThreshold(detailThreshold); } --- 193,197 ---- terrainNode->addDrawable(pDrawable); terrainNode->setCullingActive(false); // disables small feature and view frustrum culling ! float detailThreshold = 6.0f; terrain->SetDetailThreshold(detailThreshold); } Index: tcwindow.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcwindow.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tcwindow.cpp 3 Jan 2004 00:45:12 -0000 1.14 --- tcwindow.cpp 18 Jan 2004 18:42:41 -0000 1.15 *************** *** 232,241 **** { wxWindow::Enable(true); ! //wxWindow::Move(wxPoint(mrectWindow.left,mrectWindow.top)); } else { wxWindow::Enable(false); ! //wxWindow::Move(wxPoint(10000,10000)); } mbActive=abActive; --- 232,241 ---- { wxWindow::Enable(true); ! wxWindow::Show(TRUE); } else { wxWindow::Enable(false); ! wxWindow::Show(FALSE); } mbActive=abActive; *************** *** 568,575 **** tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW , name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { ! mbCloned = false; mbActive = false; --- 568,576 ---- tcWindow::tcWindow(wxWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name) : ! wxWindow(parent, -1, pos, size, wxTRANSPARENT_WINDOW| wxNO_FULL_REPAINT_ON_RESIZE, name), //| wxNO_FULL_REPAINT_ON_RESIZE |wxCLIP_CHILDREN mnHeight(size.GetHeight()), mnWidth(size.GetWidth()) { ! SetBackgroundColour(*wxBLACK); ! Show(FALSE); mbCloned = false; mbActive = false; |
From: <ddc...@us...> - 2004-01-18 18:42:44
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1:/tmp/cvs-serv28162/include/sim Modified Files: tc3DViewer.h Log Message: Changes to reduce block artifacts at screen transitions--planning to eliiminate Producer to fix gray background screen issue Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tc3DViewer.h 16 Jan 2004 00:04:14 -0000 1.20 --- tc3DViewer.h 18 Jan 2004 18:42:41 -0000 1.21 *************** *** 111,115 **** bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); ! void SetActive(bool b) {isActive = b;wxWindow::Enable(b);} void SetCameraMode(bool lookAt, bool moveWith); void SetGameTime(double t); --- 111,115 ---- bool IsActive() {return isActive;} void LoadModel(tcGameObject *obj); ! void SetActive(bool b) {isActive = b;wxWindow::Enable(b);wxWindow::Show(b);} void SetCameraMode(bool lookAt, bool moveWith); void SetGameTime(double t); |
From: <ddc...@us...> - 2004-01-18 18:42:44
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv28162/include/graphics Modified Files: tc3DModel.h Log Message: Changes to reduce block artifacts at screen transitions--planning to eliiminate Producer to fix gray background screen issue Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tc3DModel.h 16 Jan 2004 00:04:13 -0000 1.3 --- tc3DModel.h 18 Jan 2004 18:42:41 -0000 1.4 *************** *** 26,29 **** --- 26,30 ---- #include <osg/ref_ptr> #include <osg/Group> + #include <osg/LOD> #include <osg/MatrixTransform> *************** *** 77,81 **** ~tc3DModel(); private: ! osg::ref_ptr<osg::Group> modelGroup; ///< top level group for model, not shared osg::ref_ptr<osg::MatrixTransform> modelTransform; ///< positions object in world, not shared osg::ref_ptr<osg::Node> modelNode; ///< shared between instances of model --- 78,82 ---- ~tc3DModel(); private: ! osg::ref_ptr<osg::LOD> modelGroup; ///< top level group for model, not shared osg::ref_ptr<osg::MatrixTransform> modelTransform; ///< positions object in world, not shared osg::ref_ptr<osg::Node> modelNode; ///< shared between instances of model |
From: <ddc...@us...> - 2004-01-16 00:04:17
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv26093/src/sim Modified Files: tc3DViewer.cpp tcPlatformObject.cpp Log Message: animation Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tc3DViewer.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** tc3DViewer.cpp 10 Jan 2004 21:55:31 -0000 1.25 --- tc3DViewer.cpp 16 Jan 2004 00:04:14 -0000 1.26 *************** *** 894,898 **** cameraLookAz = 0; cameraLookEl = 0; ! simState = NULL; --- 894,898 ---- cameraLookAz = 0; cameraLookEl = 0; ! gameTime = 0; simState = NULL; Index: tcPlatformObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcPlatformObject.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tcPlatformObject.cpp 5 Jan 2004 02:48:03 -0000 1.9 --- tcPlatformObject.cpp 16 Jan 2004 00:04:14 -0000 1.10 *************** *** 28,31 **** --- 28,32 ---- #include "tcRadarSensorState.h" #include "tcESMSensorState.h" + #include "tc3DModel.h" using namespace AI; *************** *** 455,458 **** --- 456,460 ---- } } + model->SetupAnimation(this); } /******************************************************************************/ |
From: <ddc...@us...> - 2004-01-16 00:04:17
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv26093/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp Log Message: animation Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectUpdater.cpp 14 Jan 2004 01:13:22 -0000 1.4 --- ObjectUpdater.cpp 16 Jan 2004 00:04:14 -0000 1.5 *************** *** 38,44 **** for(size_t n=0;n<nAnimations;n++) { ! osg::MatrixTransform *xform = model->animationInfo[n].transform; ! osg::Matrix matrix = xform->getMatrix(); ! xform->setMatrix(matrix * matrix.rotate(0.5f, model->animationInfo[n].axis)); } } --- 38,50 ---- for(size_t n=0;n<nAnimations;n++) { ! tcAnimationInfo& info = model->animationInfo[n]; ! int isActive = (info.switchVariable) ? *info.switchVariable : true; ! if (isActive) ! { ! osg::MatrixTransform *xform = info.transform; ! osg::Matrix matrix = xform->getMatrix(); ! double angle = info.omega * viewer->GetGameTime(); ! xform->setMatrix(matrix.rotate(angle , info.axis)); ! } } } Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DModel.cpp 14 Jan 2004 01:13:22 -0000 1.2 --- tc3DModel.cpp 16 Jan 2004 00:04:14 -0000 1.3 *************** *** 30,33 **** --- 30,34 ---- #include "tc3DModel.h" #include "tcGameObject.h" + #include "tcPlatformObject.h" #include "ObjectUpdater.h" #include "tcGenericDBObject.h" *************** *** 41,45 **** #endif ! // started with CSP AnimationProcessor class /** * A visitor for model prototypes to attach animation --- 42,46 ---- #endif ! // started with CSP ModelProcessor class /** * A visitor for model prototypes to attach animation *************** *** 55,73 **** std::vector<tcAnimationInfo>& animationInfo; // vector of animation state info to update std::vector<animationDBInfo>& databaseInfo; ///< database info to find and configure animations - //simdata::Link<Animation>::vector const *m_Animations; public: - //AnimationProcessor(): NodeVisitor(TRAVERSE_ALL_CHILDREN), m_Animations(0) { } AnimationProcessor(std::vector<tcAnimationInfo>& ai, std::vector<animationDBInfo>& adb) : NodeVisitor(TRAVERSE_ALL_CHILDREN) , animationInfo(ai), databaseInfo(adb) { } ! /* ! virtual void apply(osg::Transform &node) ! { ! std::string name = node.getName(); ! std::cout << "MODEL TRANSFORM: " << name << "\n"; ! traverse(node); ! } ! */ virtual void apply(osg::Node &node) { --- 56,65 ---- std::vector<tcAnimationInfo>& animationInfo; // vector of animation state info to update std::vector<animationDBInfo>& databaseInfo; ///< database info to find and configure animations public: AnimationProcessor(std::vector<tcAnimationInfo>& ai, std::vector<animationDBInfo>& adb) : NodeVisitor(TRAVERSE_ALL_CHILDREN) , animationInfo(ai), databaseInfo(adb) { } ! virtual void apply(osg::Node &node) { *************** *** 118,126 **** tcAnimationInfo ai; ! ai.axis = (info.animationType == "propeller") ? ! osg::Vec3(0,1.0f,0) : osg::Vec3(0,0,1.0f); ! ai.omega = 1; ai.switchVariable = NULL; ai.transform = rotateTransform; animationInfo.push_back(ai); std::cout << "added animation info for: " << name <<"\n"; --- 110,129 ---- tcAnimationInfo ai; ! if (info.animationType == "propeller") ! { ! ai.axis = osg::Vec3(0,1.0f,0); ! ai.animationType = 0; ! ai.omega = 10.0f; ! } ! else ! { ! ai.axis = osg::Vec3(0,0,1.0f); ! ai.animationType = 1; ! ai.omega = 0.2f; ! ai.param = info.param; ! } ai.switchVariable = NULL; ai.transform = rotateTransform; + animationInfo.push_back(ai); std::cout << "added animation info for: " << name <<"\n"; *************** *** 137,142 **** }; /** ! * Custom copy op for cloning models with animation */ class ModelCopyOp : public osg::CopyOp --- 140,146 ---- }; + // TODO Move this to its own file /** ! * Custom copy op for cloning models with animation. */ class ModelCopyOp : public osg::CopyOp *************** *** 271,275 **** --- 275,318 ---- /** + * Called once per instance with animations to bind + * animation variables. + * SetupUpdate must be called first to attach game object + */ + void tc3DModel::SetupAnimation(tcGameObject *obj) + { + wxASSERT(obj); + size_t nAnimations = animationInfo.size(); + for(size_t n=0;n<nAnimations;n++) + { + tcAnimationInfo& info = animationInfo[n]; + info.switchVariable = NULL; + if (info.animationType == 0) // propeller + { + } + else if (info.animationType == 1) // sensor + { + if (tcPlatformObject *plat = dynamic_cast<tcPlatformObject*>(obj)) + { + if (info.param >= (int)plat->mapSensorState.size()) + { + std::cerr << "sensor animation param out of range\n"; + wxASSERT(0); + return; + } + info.switchVariable = &plat->mapSensorState[info.param]->mbActive; + float tscan = plat->mapSensorState[info.param]->mfCurrentScanPeriod_s; + info.omega = (tscan) ? C_TWOPI/tscan : 0; + } + } + else + { + wxASSERT(0); + } + } + } + + /** * Called once per instance to set and configure update callback. + * Bind switchVariable for animations */ void tc3DModel::SetupUpdate(tcGameObject *obj) |
From: <ddc...@us...> - 2004-01-16 00:04:17
|
Update of /cvsroot/gcblue/gcb_wx/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv26093/scripts Modified Files: Menu.py Log Message: animation Index: Menu.py =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/scripts/Menu.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Menu.py 2 Nov 2003 20:04:01 -0000 1.2 --- Menu.py 16 Jan 2004 00:04:14 -0000 1.3 *************** *** 53,57 **** UnitMenu.BeginSubMenu() UnitMenu.AddItem('Add patrol order','AddPatrolOrder') - UnitMenu.AddItem('Crash dive', 'AddCrashOrder') UnitMenu.AddItemUI('Add waypoint order', 'AddWaypointOrder', 'Datum') UnitMenu.AddItem('Clear orders','ClearOrders') --- 53,56 ---- |
From: <ddc...@us...> - 2004-01-16 00:04:16
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1:/tmp/cvs-serv26093/include/sim Modified Files: tc3DViewer.h Log Message: animation Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** tc3DViewer.h 14 Jan 2004 01:13:22 -0000 1.19 --- tc3DViewer.h 16 Jan 2004 00:04:14 -0000 1.20 *************** *** 107,110 **** --- 107,111 ---- void Freeze(); Producer::Vec3 GetCameraPosition(); + double GetGameTime() const {return gameTime;} Producer::Vec3 GetObjectPosition(tcGameObject *obj); bool IsActive() {return isActive;} |
From: <ddc...@us...> - 2004-01-16 00:04:16
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv26093/include/graphics Modified Files: tc3DModel.h Log Message: animation Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DModel.h 14 Jan 2004 01:13:21 -0000 1.2 --- tc3DModel.h 16 Jan 2004 00:04:13 -0000 1.3 *************** *** 45,50 **** osg::Vec3 axis; float omega; ///< radians per second ! void *switchVariable; ///< rotate if *switchVariable is non-zero osg::MatrixTransform* transform; ///< transform to rotate }; --- 45,53 ---- osg::Vec3 axis; float omega; ///< radians per second ! int *switchVariable; ///< rotate if switchVariable is NULL or *switchVariable is non-zero ! float *controlVariable; osg::MatrixTransform* transform; ///< transform to rotate + int animationType; ///< 0 - propeller, 1 - sensor mast + int param; ///< sensor number }; *************** *** 67,70 **** --- 70,74 ---- void Load(std::string model_name); void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); + void SetupAnimation(tcGameObject *obj); void SetupUpdate(tcGameObject *obj); |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv10758/src/sim Modified Files: Game.cpp tcCreditView.cpp Log Message: more animation work Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Game.cpp 9 Jan 2004 21:48:40 -0000 1.52 --- Game.cpp 14 Jan 2004 01:13:22 -0000 1.53 *************** *** 337,341 **** // warning, this erroneously puts a copy of air DB objects into the generic file // need to fix DB obj structure so that only leaf classes are used by game objects ! //mcDatabase.SaveDBCSV("_out"); tcGameObject::SetGameObjectDatabase(&mcDatabase); // added to allow objects to init themselves --- 337,341 ---- // warning, this erroneously puts a copy of air DB objects into the generic file // need to fix DB obj structure so that only leaf classes are used by game objects ! mcDatabase.SaveDBCSV("_out"); tcGameObject::SetGameObjectDatabase(&mcDatabase); // added to allow objects to init themselves Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCreditView.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcCreditView.cpp 8 Dec 2003 17:13:34 -0000 1.6 --- tcCreditView.cpp 14 Jan 2004 01:13:22 -0000 1.7 *************** *** 82,85 **** --- 82,92 ---- AddCredit(s, 60.0f, false); + s = "3D sky code\n"; + AddCredit(s, 25.0f, false); + + s = "Combat Simulator Project, csp.sourceforge.net \n"; + AddCredit(s, 60.0f, true); + + s = "Map data based on GTOPO30 archive distributed by the \nLand Processes Distributed Active Archive Center (LP DAAC)\nlpdaac.usgs.gov \n"; AddCredit(s, 100.0f, false); *************** *** 117,131 **** AddCredit(s, 30.0f, false); ! s = "And\n"; AddCredit(s, 30.0f, false); - - s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; - AddCredit(s, 50.0f, false); ! s = "And\n"; AddCredit(s, 30.0f, false); ! s = "To those who should be but aren't yet on this list"; ! AddCredit(s, 150.0f, false); --- 124,135 ---- AddCredit(s, 30.0f, false); ! s = "Seawolves Surface Division, www.seawolves.org/fc\n"; AddCredit(s, 30.0f, false); ! s = "and\n"; AddCredit(s, 30.0f, false); ! s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; ! AddCredit(s, 50.0f, false); *************** *** 139,143 **** AddCredit(s, 20.0f, false); ! s = "Copyright (C) 2002, 2003, All rights reserved.\n"; AddCredit(s, 60.0f, false); --- 143,147 ---- AddCredit(s, 20.0f, false); ! s = "Copyright (C) 2002-2004, All rights reserved.\n"; AddCredit(s, 60.0f, false); |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv10758/src/graphics Modified Files: ObjectUpdater.cpp tc3DModel.cpp Log Message: more animation work Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectUpdater.cpp 12 Jan 2004 03:01:36 -0000 1.3 --- ObjectUpdater.cpp 14 Jan 2004 01:13:22 -0000 1.4 *************** *** 31,37 **** { size_t nAnimations = model->animationInfo.size(); for(size_t n=0;n<nAnimations;n++) { ! osg::MatrixTransform *xform = model->animationInfo[n].transform.get(); osg::Matrix matrix = xform->getMatrix(); xform->setMatrix(matrix * matrix.rotate(0.5f, model->animationInfo[n].axis)); --- 31,42 ---- { size_t nAnimations = model->animationInfo.size(); + if (nAnimations == 0) return; + + // do not update animations if camera is beyond animation LOD distance + //if (distanceFromCamera > 10000.0f) return; + for(size_t n=0;n<nAnimations;n++) { ! osg::MatrixTransform *xform = model->animationInfo[n].transform; osg::Matrix matrix = xform->getMatrix(); xform->setMatrix(matrix * matrix.rotate(0.5f, model->animationInfo[n].axis)); *************** *** 46,50 **** float yawCorrection = 0; - UpdateAnimations(); tcGameObject *gameObject = model->GetGameObj(); if (gameObject) --- 51,54 ---- *************** *** 87,91 **** } } ! osg::Matrix m = --- 91,99 ---- } } ! ! // not correct for child objects ! Producer::Vec3 cp = viewer->GetCameraPosition(); ! osg::Vec3 cameraDelta = osg::Vec3(x,y,z) - osg::Vec3(cp.x(),cp.y(),cp.z()); ! distanceFromCamera = cameraDelta.length(); osg::Matrix m = *************** *** 100,103 **** --- 108,114 ---- } } + + UpdateAnimations(); + // must call any nested node callbacks and continue subgraph traversal. NodeCallback::traverse(node,nv); Index: tc3DModel.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DModel.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DModel.cpp 12 Jan 2004 03:01:36 -0000 1.1 --- tc3DModel.cpp 14 Jan 2004 01:13:22 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- #include "tcGameObject.h" #include "ObjectUpdater.h" + #include "tcGenericDBObject.h" #include <osg/MatrixTransform> #include <osgDB/ReadFile> *************** *** 40,44 **** #endif ! /** * A visitor for model prototypes to attach animation --- 41,45 ---- #endif ! // started with CSP AnimationProcessor class /** * A visitor for model prototypes to attach animation *************** *** 49,94 **** * animation callbacks. */ ! class ModelProcessor: public osg::NodeVisitor { osg::ref_ptr<osg::Node> m_Root; ! std::vector<tcAnimationInfo>& animationInfo; //simdata::Link<Animation>::vector const *m_Animations; public: ! //ModelProcessor(): NodeVisitor(TRAVERSE_ALL_CHILDREN), m_Animations(0) { } ! ModelProcessor(std::vector<tcAnimationInfo>& ai) : NodeVisitor(TRAVERSE_ALL_CHILDREN) ! , animationInfo(ai) { } /* - void setAnimations(simdata::Link<Animation>::vector const *animations) { - m_Animations = animations; - } - */ virtual void apply(osg::Transform &node) { - //if (!m_Animations) return; std::string name = node.getName(); std::cout << "MODEL TRANSFORM: " << name << "\n"; ! /* ! if (name.substr(0,6) == "ANIM: ") { ! simdata::Key id = name.substr(6); ! simdata::Link<Animation>::vector::const_iterator i = m_Animations->begin(); ! std::cout << "SEARCHING FOR " << name.substr(6) << " (" << id.asString() << ")\n"; ! for (; i != m_Animations->end(); ++i) { ! std::cout << "COMPARING TO " << (*i)->getModelID().asString() << "\n"; ! if ((*i)->getModelID() == id) { ! node.setUserData(new AnimationBinding(i->get())); ! std::cout << "FOUND\n"; ! break; ! } ! } ! } ! */ } virtual void apply(osg::Node &node) { std::string name = node.getName(); std::cout << "MODEL NODE: " << name << "\n"; ! if (name == "pr1") { // insert a ModelTransform between this node and its parent --- 50,96 ---- * animation callbacks. */ ! class AnimationProcessor: public osg::NodeVisitor { osg::ref_ptr<osg::Node> m_Root; ! std::vector<tcAnimationInfo>& animationInfo; // vector of animation state info to update ! std::vector<animationDBInfo>& databaseInfo; ///< database info to find and configure animations //simdata::Link<Animation>::vector const *m_Animations; public: ! //AnimationProcessor(): NodeVisitor(TRAVERSE_ALL_CHILDREN), m_Animations(0) { } ! AnimationProcessor(std::vector<tcAnimationInfo>& ai, std::vector<animationDBInfo>& adb) : NodeVisitor(TRAVERSE_ALL_CHILDREN) ! , animationInfo(ai), databaseInfo(adb) { } /* virtual void apply(osg::Transform &node) { std::string name = node.getName(); std::cout << "MODEL TRANSFORM: " << name << "\n"; ! traverse(node); } + */ virtual void apply(osg::Node &node) { std::string name = node.getName(); std::cout << "MODEL NODE: " << name << "\n"; ! /* ! if (node.getNumParents()) ! { ! osg::Node *parent = node.getParent(0); ! std::cout << " parent: " << parent->getName() << "\n"; ! } ! */ ! // search database for entry matching this node ! bool animateNode = false; ! animationDBInfo info; ! size_t nAnimations = databaseInfo.size(); ! for(size_t n=0;(n<nAnimations)&&(!animateNode);n++) ! { ! info = databaseInfo[n]; ! if (info.objectName == name) animateNode = true; ! } ! ! ! if (animateNode) { // insert a ModelTransform between this node and its parent *************** *** 107,124 **** osg::ref_ptr<osg::Node> temp = &node; osg::Group *parent = node.getParent(0); ! parent->removeChild(&node); untranslateTransform->addChild(&node); rotateTransform->addChild(untranslateTransform); translateTransform->addChild(rotateTransform); ! parent->addChild(translateTransform); tcAnimationInfo ai; ! ai.axis = osg::Vec3(0,1.0f,0); ai.omega = 1; ai.switchVariable = NULL; ai.transform = rotateTransform; animationInfo.push_back(ai); ! std::cout << "added animation info\n"; } else --- 109,128 ---- 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); ! tcAnimationInfo ai; ! ai.axis = (info.animationType == "propeller") ? ! osg::Vec3(0,1.0f,0) : osg::Vec3(0,0,1.0f); ai.omega = 1; ai.switchVariable = NULL; ai.transform = rotateTransform; animationInfo.push_back(ai); ! std::cout << "added animation info for: " << name <<"\n"; } else *************** *** 133,136 **** --- 137,212 ---- }; + /** + * Custom copy op for cloning models with animation + */ + class ModelCopyOp : public osg::CopyOp + { + public: + + inline ModelCopyOp(tc3DModel *model): + osg::CopyOp(SHALLOW_COPY), + _model(model) + {} + + + virtual osg::Node* operator() (const osg::Node* node) const + { + if (const osg::Transform *xform = node->asTransform()) + { + size_t nAnimations = _model->animationInfo.size(); + tcAnimationInfo *info = NULL; + bool foundAnimation = false; + for (size_t n=0;(n<nAnimations)&&(!foundAnimation);n++) + { + info = &_model->animationInfo[n]; + if (info->transform == xform) + { + foundAnimation = true; + } + } + + osg::Object *obj = (node->clone(ModelCopyOp(_model))); + osg::Node* ret_node = dynamic_cast<osg::Node*>(obj); + + if (foundAnimation) + { + std::cout << " Found matching animation\n"; + osg::MatrixTransform* mt = dynamic_cast<osg::MatrixTransform*>(ret_node->asTransform()); + if (mt) + { + info->transform = mt; + } + else + { + std::cerr << "Error binding animation in model \n"; + } + } + return ret_node; + } + else + { + osg::Node* ret_node = CopyOp::operator()(node); + return ret_node; + } + } + + virtual osg::StateAttribute* operator() (const osg::StateAttribute* attr) const + { + osg::StateAttribute* ret_attr; + if (attr) + { + ret_attr = dynamic_cast<osg::StateAttribute*> + (attr->clone(CopyOp(osg::CopyOp::DEEP_COPY_STATEATTRIBUTES))); + } + else + { + ret_attr = NULL; + } + return ret_attr; + } + + protected: + tc3DModel *_model; + }; /** *************** *** 184,193 **** modelNode->accept(smoothingVisitor); } - ModelProcessor mp(animationInfo); - modelNode->accept(mp); fprintf(stdout,"tc3DModel--Loaded 3D model: %s\n", model_name.c_str()); } /** * Called once per instance to set and configure update callback. --- 260,273 ---- modelNode->accept(smoothingVisitor); } fprintf(stdout,"tc3DModel--Loaded 3D model: %s\n", model_name.c_str()); } + void tc3DModel::ProcessAnimations(std::vector<animationDBInfo>& animDBInfo) + { + AnimationProcessor animationProcessor(animationInfo, animDBInfo); + modelNode->accept(animationProcessor); + } + /** * Called once per instance to set and configure update callback. *************** *** 217,227 **** { wxASSERT(source->modelNode.valid()); // error if modelNode not loaded yet ! modelNode = source->modelNode; modelGroup = new osg::Group; modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); - - modelTransform->addChild(modelNode.get()); modelGroup->addChild(modelTransform.get()); --- 297,305 ---- { wxASSERT(source->modelNode.valid()); // error if modelNode not loaded yet ! modelGroup = new osg::Group; modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); modelGroup->addChild(modelTransform.get()); *************** *** 232,235 **** --- 310,320 ---- animationInfo.push_back(source->animationInfo[n]); } + + modelNode = dynamic_cast<osg::Node*>(source->modelNode->clone(ModelCopyOp(this))); + + modelTransform->addChild(modelNode.get()); + + + } |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/include/sim In directory sc8-pr-cvs1:/tmp/cvs-serv10758/include/sim Modified Files: tc3DViewer.h Log Message: more animation work Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/sim/tc3DViewer.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** tc3DViewer.h 3 Jan 2004 00:45:12 -0000 1.18 --- tc3DViewer.h 14 Jan 2004 01:13:22 -0000 1.19 *************** *** 106,110 **** void Frame(); void Freeze(); ! Producer::Vec3 GetCameraPosition(); Producer::Vec3 GetObjectPosition(tcGameObject *obj); bool IsActive() {return isActive;} --- 106,110 ---- void Frame(); void Freeze(); ! Producer::Vec3 GetCameraPosition(); Producer::Vec3 GetObjectPosition(tcGameObject *obj); bool IsActive() {return isActive;} |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/src/database In directory sc8-pr-cvs1:/tmp/cvs-serv10758/src/database Modified Files: tcGenericDBObject.cpp Log Message: more animation work Index: tcGenericDBObject.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/database/tcGenericDBObject.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGenericDBObject.cpp 4 Jan 2004 22:24:52 -0000 1.4 --- tcGenericDBObject.cpp 14 Jan 2004 01:13:22 -0000 1.5 *************** *** 26,30 **** #include "randfn.h" #include "CsvTranslator.h" ! using namespace std; --- 26,30 ---- #include "randfn.h" #include "CsvTranslator.h" ! #include "tc3DModel.h" using namespace std; *************** *** 33,36 **** --- 33,46 ---- { + /** + * Search 3D model for animation nodes. Configure + * animation data for matching nodes. + */ + void tcGenericDBObject::Animate3DModel() + { + //if (animationInfo.size()==0) return; // no animation in this model + model->ProcessAnimations(animationInfo); + } + void tcGenericDBObject::RandInit() { *************** *** 121,124 **** --- 131,135 ---- file.Read(&maSensorClass[i],sizeof(tcDBString)); } + Animate3DModel(); } else *************** *** 201,204 **** --- 212,228 ---- } } + for(i=0;i<MAXANIMATIONS;i++) + { + animationDBInfo ai; + *csv >> ai.objectName; + *csv >> ai.animationType; + *csv >> ai.param; + + if (ai.objectName.size() > 0) + { + animationInfo.push_back(ai); + } + } + Animate3DModel(); } else *************** *** 247,250 **** --- 271,291 ---- } } + size_t nAnimations = animationInfo.size(); + for(size_t i=0;i<MAXANIMATIONS;i++) + { + if (i < nAnimations) + { + animationDBInfo& ai = animationInfo[i]; + *csv << ai.objectName; + *csv << ai.animationType; + *csv << (long)ai.param; + } + else + { + *csv << ""; + *csv << ""; + *csv << ""; + } + } csv->WriteLine(); } *************** *** 287,290 **** --- 328,341 ---- *csv << s.GetBuffer(); } + for(i=0;i<MAXANIMATIONS;i++) + { + tcString s; + s.Format("Animation%d-obj",i+1); + *csv << s.GetBuffer(); + s.Format("Animation%d-type",i+1); + *csv << s.GetBuffer(); + s.Format("Animation%d-param",i+1); + *csv << s.GetBuffer(); + } csv->WriteLine(); return 1; *************** *** 312,315 **** --- 363,367 ---- mnNumSensors = 0; flightportClass = ""; + animationInfo.clear(); } *************** *** 347,350 **** --- 399,408 ---- } flightportClass = obj.flightportClass; + animationInfo.clear(); + size_t nAn = obj.animationInfo.size(); + for(size_t n=0;n<nAn;n++) + { + animationInfo.push_back(obj.animationInfo[n]); + } } |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv10758/include/graphics Modified Files: ObjectUpdater.h tc3DModel.h Log Message: more animation work Index: ObjectUpdater.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/ObjectUpdater.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectUpdater.h 12 Jan 2004 03:01:36 -0000 1.4 --- ObjectUpdater.h 14 Jan 2004 01:13:21 -0000 1.5 *************** *** 30,33 **** --- 30,34 ---- static tc3DViewer *viewer; tc3DModel *model; ///< tc3DModel has method to access sim tcGameObject + float distanceFromCamera; ///< model distance from camera, calculated by update void UpdateAnimations(); Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tc3DModel.h 12 Jan 2004 03:01:36 -0000 1.1 --- tc3DModel.h 14 Jan 2004 01:13:21 -0000 1.2 *************** *** 30,33 **** --- 30,43 ---- class tcGameObject; + /** + * animation description stored in CSV database entry + */ + struct animationDBInfo + { + std::string objectName; ///< name of object within model to animate + std::string animationType; ///< "propeller" + int param; ///< sensor number for radar animations + }; + class tcAnimationInfo { *************** *** 36,40 **** float omega; ///< radians per second void *switchVariable; ///< rotate if *switchVariable is non-zero ! osg::ref_ptr<osg::MatrixTransform> transform; ///< transform to rotate }; --- 46,50 ---- float omega; ///< radians per second void *switchVariable; ///< rotate if *switchVariable is non-zero ! osg::MatrixTransform* transform; ///< transform to rotate }; *************** *** 49,53 **** public: std::vector<tcAnimationInfo> animationInfo; ///< animation transforms to update at model level - void AddChild(tc3DModel *child); tc3DModel* Clone(); --- 59,62 ---- *************** *** 57,60 **** --- 66,70 ---- unsigned int GetNumParents(); void Load(std::string model_name); + void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); void SetupUpdate(tcGameObject *obj); |
From: <ddc...@us...> - 2004-01-14 01:13:25
|
Update of /cvsroot/gcblue/gcb_wx/include/database In directory sc8-pr-cvs1:/tmp/cvs-serv10758/include/database Modified Files: tcGenericDBObject.h Log Message: more animation work Index: tcGenericDBObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/database/tcGenericDBObject.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcGenericDBObject.h 4 Jan 2004 22:24:52 -0000 1.4 --- tcGenericDBObject.h 14 Jan 2004 01:13:21 -0000 1.5 *************** *** 26,29 **** --- 26,32 ---- #include "tcDatabaseObject.h" + #include <vector> + + struct animationDBInfo; namespace Database *************** *** 41,45 **** { MAXLAUNCHERS = 8, ! MAXSENSORS = 8 }; float mfRcs_dbsm; ///< radar cross section, [dBsm] --- 44,49 ---- { MAXLAUNCHERS = 8, ! MAXSENSORS = 8, ! MAXANIMATIONS = 4 }; float mfRcs_dbsm; ///< radar cross section, [dBsm] *************** *** 65,69 **** --- 69,75 ---- float sensorAz[MAXSENSORS]; ///< pointing angles of sensors in degrees tcDBString flightportClass; ///< database class name of flightport (or empty if none) + std::vector<animationDBInfo> animationInfo; + void Animate3DModel(); void RandInit(); virtual void PrintToFile(tcFile& file); |
From: <ddc...@us...> - 2004-01-13 00:07:42
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1:/tmp/cvs-serv31458/src/sim Modified Files: Tag: v0_5_0 tcCreditView.cpp Log Message: Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcCreditView.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** tcCreditView.cpp 8 Dec 2003 17:13:34 -0000 1.6 --- tcCreditView.cpp 13 Jan 2004 00:07:40 -0000 1.6.2.1 *************** *** 82,85 **** --- 82,92 ---- AddCredit(s, 60.0f, false); + s = "3D sky code\n"; + AddCredit(s, 25.0f, false); + + s = "Combat Simulator Project, csp.sourceforge.net \n"; + AddCredit(s, 60.0f, true); + + s = "Map data based on GTOPO30 archive distributed by the \nLand Processes Distributed Active Archive Center (LP DAAC)\nlpdaac.usgs.gov \n"; AddCredit(s, 100.0f, false); *************** *** 117,131 **** AddCredit(s, 30.0f, false); ! s = "And\n"; AddCredit(s, 30.0f, false); - - s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; - AddCredit(s, 50.0f, false); ! s = "And\n"; AddCredit(s, 30.0f, false); ! s = "To those who should be but aren't yet on this list"; ! AddCredit(s, 150.0f, false); --- 124,135 ---- AddCredit(s, 30.0f, false); ! s = "Seawolves Surface Division, www.seawolves.org/fc\n"; AddCredit(s, 30.0f, false); ! s = "and\n"; AddCredit(s, 30.0f, false); ! s = "To those who offered advice through e-mail and \nthe global_conflict discussion group"; ! AddCredit(s, 50.0f, false); *************** *** 139,143 **** AddCredit(s, 20.0f, false); ! s = "Copyright (C) 2002, 2003, All rights reserved.\n"; AddCredit(s, 60.0f, false); --- 143,147 ---- AddCredit(s, 20.0f, false); ! s = "Copyright (C) 2002-2004, All rights reserved.\n"; AddCredit(s, 60.0f, false); |
From: <ddc...@us...> - 2004-01-12 03:01:39
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs1:/tmp/cvs-serv7013/src/graphics Modified Files: ObjectUpdater.cpp Added Files: tc3DModel.cpp Log Message: animation test code --- NEW FILE: tc3DModel.cpp --- /** @file tc3DModel.cpp */ /* ** Copyright (C) 2003 Dewitt "Cole" Colclough (de...@tw...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #ifdef WIN32 #include "wx/msw/private.h" // for MS Windows specific definitions #endif #endif #include "tc3DModel.h" #include "tcGameObject.h" #include "ObjectUpdater.h" #include <osg/MatrixTransform> #include <osgDB/ReadFile> #include <osgUtil/SmoothingVisitor> #ifdef _DEBUG #define new DEBUG_NEW #endif /** * A visitor for model prototypes to attach animation * bindings to the appropriate nodes. Each prototype * only needs to be processed once, immediately after * loading the model. The bindings are used when the * model is later cloned by SceneModel to attach * animation callbacks. */ class ModelProcessor: public osg::NodeVisitor { osg::ref_ptr<osg::Node> m_Root; std::vector<tcAnimationInfo>& animationInfo; //simdata::Link<Animation>::vector const *m_Animations; public: //ModelProcessor(): NodeVisitor(TRAVERSE_ALL_CHILDREN), m_Animations(0) { } ModelProcessor(std::vector<tcAnimationInfo>& ai) : NodeVisitor(TRAVERSE_ALL_CHILDREN) , animationInfo(ai) { } /* void setAnimations(simdata::Link<Animation>::vector const *animations) { m_Animations = animations; } */ virtual void apply(osg::Transform &node) { //if (!m_Animations) return; std::string name = node.getName(); std::cout << "MODEL TRANSFORM: " << name << "\n"; /* if (name.substr(0,6) == "ANIM: ") { simdata::Key id = name.substr(6); simdata::Link<Animation>::vector::const_iterator i = m_Animations->begin(); std::cout << "SEARCHING FOR " << name.substr(6) << " (" << id.asString() << ")\n"; for (; i != m_Animations->end(); ++i) { std::cout << "COMPARING TO " << (*i)->getModelID().asString() << "\n"; if ((*i)->getModelID() == id) { node.setUserData(new AnimationBinding(i->get())); std::cout << "FOUND\n"; break; } } } */ } virtual void apply(osg::Node &node) { std::string name = node.getName(); std::cout << "MODEL NODE: " << name << "\n"; if (name == "pr1") { // insert a ModelTransform between this node and its parent 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); parent->removeChild(&node); untranslateTransform->addChild(&node); rotateTransform->addChild(untranslateTransform); translateTransform->addChild(rotateTransform); parent->addChild(translateTransform); tcAnimationInfo ai; ai.axis = osg::Vec3(0,1.0f,0); ai.omega = 1; ai.switchVariable = NULL; ai.transform = rotateTransform; animationInfo.push_back(ai); std::cout << "added animation info\n"; } else { std::cerr << "animation node does not have 1 parent\n"; } } traverse(node); } }; /** * Adds child to modelTransform of this model. */ void tc3DModel::AddChild(tc3DModel *child) { modelTransform->addChild(child->GetNode().get()); } tc3DModel* tc3DModel::Clone() { tc3DModel *clonedModel = new tc3DModel(this); return clonedModel; } void tc3DModel::DetachFromParent() { modelGroup->getParent(0)->removeChild(modelGroup.get()); } osg::ref_ptr<osg::Node> tc3DModel::GetNode() { osg::ref_ptr<osg::Node> node = modelGroup.get(); return node; } unsigned int tc3DModel::GetNumParents() { wxASSERT(modelGroup.valid()); return modelGroup->getNumParents(); } void tc3DModel::Load(std::string model_name) { if (modelNode.valid()) return; // model already loaded std::cout << "Loading 3D model: " << model_name << " \n"; std::cerr << "Loading 3D model: " << model_name << " \n"; model_name = model_name + ".3ds"; modelNode = osgDB::readNodeFile(model_name.c_str()); if (!modelNode.valid()) { std::cout << "Load of 3D model: " << model_name << " failed.\n"; std::cerr << "Load of 3D model: " << model_name << " failed.\n"; return; } if (useSmoothing) { osgUtil::SmoothingVisitor smoothingVisitor; modelNode->accept(smoothingVisitor); } ModelProcessor mp(animationInfo); modelNode->accept(mp); fprintf(stdout,"tc3DModel--Loaded 3D model: %s\n", model_name.c_str()); } /** * Called once per instance to set and configure update callback. */ void tc3DModel::SetupUpdate(tcGameObject *obj) { wxASSERT(modelTransform->getUpdateCallback() == NULL); gameObj = obj; modelTransform->setUpdateCallback(new ObjectUpdater(this)); } /** * This constructor is used for the source/factory, notionally * stored as part of the database object. * Skips initialization of members used in scene graph. */ tc3DModel::tc3DModel() { useSmoothing = true; } /** * SetupUpdate should be called after this to set update callback * for model. */ tc3DModel::tc3DModel(const tc3DModel* source) { wxASSERT(source->modelNode.valid()); // error if modelNode not loaded yet modelNode = source->modelNode; modelGroup = new osg::Group; modelTransform = new osg::MatrixTransform; modelTransform->setDataVariance(osg::Object::DYNAMIC); modelTransform->addChild(modelNode.get()); modelGroup->addChild(modelTransform.get()); animationInfo.clear(); size_t nAnimations = source->animationInfo.size(); for(size_t n=0;n<nAnimations;n++) { animationInfo.push_back(source->animationInfo[n]); } } tc3DModel::~tc3DModel() { } Index: ObjectUpdater.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/ObjectUpdater.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectUpdater.cpp 29 Oct 2003 01:56:40 -0000 1.2 --- ObjectUpdater.cpp 12 Jan 2004 03:01:36 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- #include "ObjectUpdater.h" #include "tcGameObject.h" + #include "tc3DModel.h" #include "tc3DViewer.h" #include <osg/MatrixTransform> *************** *** 27,30 **** --- 28,41 ---- }; + void ObjectUpdater::UpdateAnimations() + { + size_t nAnimations = model->animationInfo.size(); + for(size_t n=0;n<nAnimations;n++) + { + osg::MatrixTransform *xform = model->animationInfo[n].transform.get(); + osg::Matrix matrix = xform->getMatrix(); + xform->setMatrix(matrix * matrix.rotate(0.5f, model->animationInfo[n].axis)); + } + } void ObjectUpdater::operator()(Node* node, NodeVisitor* nv) *************** *** 35,38 **** --- 46,51 ---- float yawCorrection = 0; + UpdateAnimations(); + tcGameObject *gameObject = model->GetGameObj(); if (gameObject) { *************** *** 94,103 **** ObjectUpdater::ObjectUpdater() { ! gameObject = NULL; useRelativeChildPos = true; } ! ObjectUpdater::ObjectUpdater(tcGameObject *obj) : ! gameObject(obj) { useRelativeChildPos = true; --- 107,116 ---- ObjectUpdater::ObjectUpdater() { ! model = NULL; useRelativeChildPos = true; } ! ObjectUpdater::ObjectUpdater(tc3DModel *mod) : ! model(mod) { useRelativeChildPos = true; |