You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(153) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(48) |
Feb
(46) |
Mar
(12) |
Apr
(4) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(263) |
Mar
(235) |
Apr
(66) |
May
(42) |
Jun
(270) |
Jul
(65) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:53:59
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25098 Modified Files: Tag: projectx simulationserver.h Log Message: merge from HEAD Index: simulationserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/simulationserver.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.1.2.1 diff -C2 -d -r1.2.2.1 -r1.2.2.1.2.1 *** simulationserver.h 16 Feb 2007 15:42:57 -0000 1.2.2.1 --- simulationserver.h 17 Jun 2007 07:53:55 -0000 1.2.2.1.2.1 *************** *** 66,69 **** --- 66,72 ---- virtual float GetTime(); + /** resets the simulation time */ + virtual void ResetTime(); + /** sets the simulation time step */ virtual void SetSimStep(float deltaTime); |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:53:32
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25072 Modified Files: Tag: projectx simulationserver.cpp Log Message: merge from HEAD Index: simulationserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/simulationserver.cpp,v retrieving revision 1.3.2.2.2.1 retrieving revision 1.3.2.2.2.2 diff -C2 -d -r1.3.2.2.2.1 -r1.3.2.2.2.2 *** simulationserver.cpp 30 Mar 2007 03:23:23 -0000 1.3.2.2.2.1 --- simulationserver.cpp 17 Jun 2007 07:53:25 -0000 1.3.2.2.2.2 *************** *** 103,106 **** --- 103,111 ---- } + void SimulationServer::ResetTime() + { + mSimTime = 0.0f; + } + float SimulationServer::GetSimStep() { |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:52:04
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24310 Modified Files: Tag: projectx netmessage.cpp Log Message: merge from HEAD Index: netmessage.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/netmessage.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.2.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.2.1 *** netmessage.cpp 23 Feb 2007 19:26:28 -0000 1.1.2.2 --- netmessage.cpp 17 Jun 2007 07:51:58 -0000 1.1.2.2.2.1 *************** *** 49,54 **** --- 49,60 ---- bool NetMessage::Extract(shared_ptr<NetBuffer> buffer, std::string& msg) { + if (buffer.get() == 0) + { + return false; + } + // a message is prefixed with it's payload length const unsigned int preSz = sizeof(unsigned int); + string& data = buffer->GetData(); |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:50:38
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23900 Modified Files: Tag: projectx scriptserver.cpp Log Message: removed debug message Index: scriptserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.cpp,v retrieving revision 1.2.2.4.2.2 retrieving revision 1.2.2.4.2.3 diff -C2 -d -r1.2.2.4.2.2 -r1.2.2.4.2.3 *** scriptserver.cpp 30 Mar 2007 03:43:18 -0000 1.2.2.4.2.2 --- scriptserver.cpp 17 Jun 2007 07:50:32 -0000 1.2.2.4.2.3 *************** *** 270,274 **** return false; } - boost::scoped_array<char> buffer(new char[file->Size() + 1]); file->Read(buffer.get(), file->Size()); --- 270,273 ---- *************** *** 487,491 **** } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script" << endl; return eError; } else --- 486,490 ---- } else if (! Run(file)) { ! GetLog()->Debug() << "failed (error in script)" << endl; return eError; } else *************** *** 598,602 **** pkgdatadir += "Contents/Resources/"; #endif - std::cerr << "Getting scripts at " << pkgdatadir << "\n"; ERunScriptErrorType result = eNotFound; --- 597,600 ---- *************** *** 650,654 **** result = RunInitScriptInternal(mRelPathPrefix+relPath, fileName, validDotDir, dotDir); - if (result == eNotFound) { --- 648,651 ---- |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:49:31
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23476 Modified Files: Tag: projectx scriptserver.h Log Message: - added script error type for (not initialized) Index: scriptserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/scriptserver/scriptserver.h,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.1.2.1 diff -C2 -d -r1.2.2.1 -r1.2.2.1.2.1 *** scriptserver.h 15 Feb 2007 20:54:22 -0000 1.2.2.1 --- scriptserver.h 17 Jun 2007 07:49:25 -0000 1.2.2.1.2.1 *************** *** 64,67 **** --- 64,68 ---- enum ERunScriptErrorType { + eUninit, // not initialized eOK, // no errors eNotFound, // could not find script |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:48:28
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23425 Modified Files: Tag: projectx zeitgeist.cpp Log Message: ws only Index: zeitgeist.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/zeitgeist.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** zeitgeist.cpp 9 Feb 2007 16:18:43 -0000 1.1.2.1 --- zeitgeist.cpp 17 Jun 2007 07:48:25 -0000 1.1.2.1.2.1 *************** *** 40,44 **** return; } ! mCore->GetScriptServer()->SetInitRelPathPrefix(relPathPrefix); RunInitScript(dotName); --- 40,44 ---- return; } ! mCore->GetScriptServer()->SetInitRelPathPrefix(relPathPrefix); RunInitScript(dotName); |
|
From: Oliver O. <fr...@us...> - 2007-06-17 07:47:44
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv23034 Modified Files: Tag: projectx leaf.h Log Message: merge from HEAD Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.1.2.1.2.2 retrieving revision 1.1.2.1.2.3 diff -C2 -d -r1.1.2.1.2.2 -r1.1.2.1.2.3 *** leaf.h 8 May 2007 01:36:22 -0000 1.1.2.1.2.2 --- leaf.h 17 Jun 2007 07:47:37 -0000 1.1.2.1.2.3 *************** *** 130,134 **** if (recursive) { ! return (*i)->FindChildSupportingClass<CLASS>(recursive); } } --- 130,138 ---- if (recursive) { ! child = (*i)->FindChildSupportingClass<CLASS>(recursive); ! if (child.get() != 0) ! { ! return child; ! } } } |
|
From: Markus R. <rol...@us...> - 2007-06-15 10:42:54
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29280 Modified Files: constants.h mainframe.cpp mainframe.h rsgedit.wxg Log Message: - added buttons 'Clear' and 'Copy' to the log window to allow for clearing the log window and to copy its contents to the clipboard - added checkboxes to filter the logstream for debug, error, normal and warning channels Index: constants.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/constants.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** constants.h 15 Jun 2007 09:44:28 -0000 1.7 --- constants.h 15 Jun 2007 10:42:40 -0000 1.8 *************** *** 54,58 **** ID_CONTEXT_EDIT_SOURCE = (wxID_HIGHEST+31), ID_CONTEXT_COPY_FILENAME = (wxID_HIGHEST+32), ! ID_CONTEXT_COPY_PATH = (wxID_HIGHEST+33) }; --- 54,65 ---- ID_CONTEXT_EDIT_SOURCE = (wxID_HIGHEST+31), ID_CONTEXT_COPY_FILENAME = (wxID_HIGHEST+32), ! ID_CONTEXT_COPY_PATH = (wxID_HIGHEST+33), ! ! ID_LOG_CLEAR = (wxID_HIGHEST+34), ! ID_LOG_COPY = (wxID_HIGHEST+35), ! ID_LOG_CHANNEL_DEBUG = (wxID_HIGHEST+36), ! ID_LOG_CHANNEL_NORMAL = (wxID_HIGHEST+37), ! ID_LOG_CHANNEL_WARNING = (wxID_HIGHEST+38), ! ID_LOG_CHANNEL_ERROR = (wxID_HIGHEST+39) }; Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mainframe.h 15 Jun 2007 09:46:07 -0000 1.14 --- mainframe.h 15 Jun 2007 10:42:40 -0000 1.15 *************** *** 44,47 **** --- 44,48 ---- #include <wx/splitter.h> #include <wx/listctrl.h> + #include <wx/statline.h> #include <wx/treectrl.h> // end wxGlade *************** *** 110,113 **** --- 111,118 ---- void OnContextCopyPath(wxCommandEvent& event); + void OnLogClear(wxCommandEvent& event); + void OnLogCopy(wxCommandEvent& event); + void OnLogChannel(wxCommandEvent& event); + void OnExit(wxCommandEvent& event); void OnClose( wxCloseEvent& event ); *************** *** 136,139 **** --- 141,145 ---- void PrintSimState(); + void UpdateLogChannelState(); void InitTreeNodeProperties(); *************** *** 176,179 **** --- 182,193 ---- wxPanel* mTopPane; wxTextCtrl* mCtrLog; + wxButton* button_2; + wxButton* button_3; + wxStaticLine* static_line_1; + wxStaticText* label_2; + wxCheckBox* mCtrLogChannelDebug; + wxCheckBox* mCtrLogChannelNormal; + wxCheckBox* mCtrLogChannelWarning; + wxCheckBox* mCtrLogChannelError; wxPanel* mBottomPane; wxSplitterWindow* mCtrHorSplitter; Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rsgedit.wxg 15 Jun 2007 09:46:07 -0000 1.8 --- rsgedit.wxg 15 Jun 2007 10:42:40 -0000 1.9 *************** *** 1,4 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 11:45:09 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> --- 1,4 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 12:41:21 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> *************** *** 8,12 **** <menubar>1</menubar> <statusbar>1</statusbar> ! <size>815, 601</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> --- 8,12 ---- <menubar>1</menubar> <statusbar>1</statusbar> ! <size>1024, 770</size> <object class="wxMenuBar" name="MainFrame_menubar" base="EditMenuBar"> <menus> *************** *** 162,166 **** <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> ! <orient>wxVERTICAL</orient> <object class="sizeritem"> <flag>wxEXPAND</flag> --- 162,166 ---- <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> ! <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <flag>wxEXPAND</flag> *************** *** 171,174 **** --- 171,253 ---- </object> </object> + <object class="sizeritem"> + <border>0</border> + <option>0</option> + <object class="wxBoxSizer" name="sizer_11" base="EditBoxSizer"> + <orient>wxVERTICAL</orient> + <object class="sizeritem"> + <flag>wxALL|wxEXPAND|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxButton" name="button_2" base="EditButton"> + <label>Clear</label> + <id>ID_LOG_CLEAR</id> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxButton" name="button_3" base="EditButton"> + <label>Copy</label> + <id>ID_LOG_COPY</id> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxTOP|wxEXPAND</flag> + <border>5</border> + <option>0</option> + <object class="wxStaticLine" name="static_line_1" base="EditStaticLine"> + <style>wxLI_HORIZONTAL</style> + <attribute>1</attribute> + </object> + </object> + <object class="sizeritem"> + <flag>wxALL|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxStaticText" name="label_2" base="EditStaticText"> + <attribute>1</attribute> + <label>Log Channels</label> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxCheckBox" name="mCtrLogChannelDebug" base="EditCheckBox"> + <label>Debug</label> + <id>ID_LOG_CHANNEL_DEBUG</id> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxCheckBox" name="mCtrLogChannelNormal" base="EditCheckBox"> + <label>Normal</label> + <id>ID_LOG_CHANNEL_NORMAL</id> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxCheckBox" name="mCtrLogChannelWarning" base="EditCheckBox"> + <label>Warning</label> + <id>ID_LOG_CHANNEL_WARNING</id> + </object> + </object> + <object class="sizeritem"> + <flag>wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE</flag> + <border>5</border> + <option>0</option> + <object class="wxCheckBox" name="mCtrLogChannelError" base="EditCheckBox"> + <label>Error</label> + <id>ID_LOG_CHANNEL_ERROR</id> + </object> + </object> + </object> + </object> </object> </object> Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mainframe.cpp 15 Jun 2007 09:46:07 -0000 1.20 --- mainframe.cpp 15 Jun 2007 10:42:40 -0000 1.21 *************** *** 87,90 **** --- 87,97 ---- EVT_MENU(ID_CONTEXT_COPY_PATH, mainframe::OnContextCopyPath) + EVT_BUTTON(ID_LOG_CLEAR, mainframe::OnLogClear) + EVT_BUTTON(ID_LOG_COPY, mainframe::OnLogCopy) + EVT_CHECKBOX(ID_LOG_CHANNEL_DEBUG, mainframe::OnLogChannel) + EVT_CHECKBOX(ID_LOG_CHANNEL_NORMAL, mainframe::OnLogChannel) + EVT_CHECKBOX(ID_LOG_CHANNEL_WARNING, mainframe::OnLogChannel) + EVT_CHECKBOX(ID_LOG_CHANNEL_ERROR, mainframe::OnLogChannel) + EVT_TIMER(TI_LOG, mainframe::OnLogTimer) EVT_TIMER(TI_FPS, mainframe::OnFPSTimer) *************** *** 144,147 **** --- 151,162 ---- mCanvas = new SparkGLCanvas(mTopPane, -1); mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxNO_BORDER); + button_2 = new wxButton(mBottomPane, ID_LOG_CLEAR, wxT("Clear")); + button_3 = new wxButton(mBottomPane, ID_LOG_COPY, wxT("Copy")); + static_line_1 = new wxStaticLine(mBottomPane, -1); + label_2 = new wxStaticText(mBottomPane, -1, wxT("Log Channels")); + mCtrLogChannelDebug = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_DEBUG, wxT("Debug")); + mCtrLogChannelNormal = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_NORMAL, wxT("Normal")); + mCtrLogChannelWarning = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_WARNING, wxT("Warning")); + mCtrLogChannelError = new wxCheckBox(mBottomPane, ID_LOG_CHANNEL_ERROR, wxT("Error")); set_properties(); *************** *** 192,195 **** --- 207,211 ---- PrintSimState(); UpdateTitle(); + UpdateLogChannelState(); } *************** *** 232,236 **** // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(815, 601)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); --- 248,252 ---- // begin wxGlade: mainframe::set_properties SetTitle(wxT("RsgEdit")); ! SetSize(wxSize(1024, 770)); int MainFrame_statusbar_widths[] = { 0 }; MainFrame_statusbar->SetStatusWidths(1, MainFrame_statusbar_widths); *************** *** 249,253 **** wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_6 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); --- 265,270 ---- wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_2 = new wxBoxSizer(wxVERTICAL); ! wxBoxSizer* sizer_6 = new wxBoxSizer(wxHORIZONTAL); ! wxBoxSizer* sizer_11 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_7 = new wxBoxSizer(wxVERTICAL); *************** *** 276,279 **** --- 293,305 ---- sizer_5->SetSizeHints(mTopPane); sizer_6->Add(mCtrLog, 1, wxEXPAND, 0); + sizer_11->Add(button_2, 0, wxALL|wxEXPAND|wxADJUST_MINSIZE, 5); + sizer_11->Add(button_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxADJUST_MINSIZE, 5); + sizer_11->Add(static_line_1, 0, wxLEFT|wxRIGHT|wxTOP|wxEXPAND, 5); + sizer_11->Add(label_2, 0, wxALL|wxADJUST_MINSIZE, 5); + sizer_11->Add(mCtrLogChannelDebug, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); + sizer_11->Add(mCtrLogChannelNormal, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); + sizer_11->Add(mCtrLogChannelWarning, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); + sizer_11->Add(mCtrLogChannelError, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); + sizer_6->Add(sizer_11, 0, 0, 0); mBottomPane->SetAutoLayout(true); mBottomPane->SetSizer(sizer_6); *************** *** 999,1000 **** --- 1025,1076 ---- } } + + void mainframe::OnLogClear(wxCommandEvent& event) + { + mCtrLog->SetValue(wxString()); + } + + void mainframe::OnLogCopy(wxCommandEvent& event) + { + long from, to; + mCtrLog->GetSelection(&from,&to); + mCtrLog->SetSelection(-1,-1); + mCtrLog->Copy(); + mCtrLog->SetSelection(from,to); + } + + void mainframe::UpdateLogChannelState() + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + assert(false); + return; + } + + unsigned int mask = spark->GetLogPriority(); + + mCtrLogChannelDebug->SetValue((mask & LogServer::eDebug) != 0); + mCtrLogChannelNormal->SetValue((mask & LogServer::eNormal) != 0); + mCtrLogChannelWarning->SetValue((mask & LogServer::eWarning) != 0); + mCtrLogChannelError->SetValue((mask & LogServer::eError) != 0); + } + + void mainframe::OnLogChannel(wxCommandEvent& event) + { + shared_ptr<SimSpark> spark = wxGetApp().GetSpark(); + if (spark.get() == 0) + { + assert(false); + return; + } + + unsigned int mask = LogServer::eNone; + + mask += mCtrLogChannelDebug->GetValue() ? LogServer::eDebug : 0; + mask += mCtrLogChannelNormal->GetValue() ? LogServer::eNormal : 0; + mask += mCtrLogChannelWarning->GetValue() ? LogServer::eWarning : 0; + mask += mCtrLogChannelError->GetValue() ? LogServer::eError : 0; + + spark->SetLogPriority(mask); + } |
|
From: Markus R. <rol...@us...> - 2007-06-15 10:41:14
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28620 Modified Files: simspark.cpp simspark.h Log Message: - added methods SetLogPriority() and GetLogPriority() to acces the filter settings of the managed log stream at runtime Index: simspark.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/simspark.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** simspark.cpp 15 Mar 2007 07:26:24 -0000 1.5 --- simspark.cpp 15 Jun 2007 10:41:06 -0000 1.6 *************** *** 55,58 **** --- 55,68 ---- } + unsigned int SimSpark::GetLogPriority() + { + return GetLog()->GetPriorityMask(&mLogStream); + } + + void SimSpark::SetLogPriority(unsigned int mask) + { + GetLog()->SetPriorityMask(&mLogStream, mask); + } + void SimSpark::ResetSimulation() { Index: simspark.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/simspark.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** simspark.h 15 Mar 2007 07:26:24 -0000 1.4 --- simspark.h 15 Jun 2007 10:41:06 -0000 1.5 *************** *** 61,64 **** --- 61,70 ---- static void ClearLogBuffer(); + /** change the priority filter of the managed log stream */ + void SetLogPriority(unsigned int mask); + + /** returns the current priority filter of the managed log stream */ + unsigned int GetLogPriority(); + protected: //! the state of the current simulation |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:46:18
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5769 Modified Files: mainframe.cpp mainframe.h rsgedit.wxg Log Message: - implement ability to single step a simulation Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mainframe.h 17 May 2007 17:49:23 -0000 1.13 --- mainframe.h 15 Jun 2007 09:46:07 -0000 1.14 *************** *** 63,67 **** protected: /** start and run simulation */ ! void StartSimulation(); /** pause a running simulation */ --- 63,67 ---- protected: /** start and run simulation */ ! void StartSimulation(bool singleStep); /** pause a running simulation */ *************** *** 83,86 **** --- 83,89 ---- void OnStartSimulation(wxCommandEvent& event); + void OnUpdateStepSimulation(wxUpdateUIEvent& event); + void OnStepSimulation(wxCommandEvent& event); + void OnUpdatePauseSimulation(wxUpdateUIEvent& event); void OnPauseSimulation(wxCommandEvent& event); Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rsgedit.wxg 15 Jun 2007 09:02:51 -0000 1.7 --- rsgedit.wxg 15 Jun 2007 09:46:07 -0000 1.8 *************** *** 1,4 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 11:01:22 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> --- 1,4 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 11:45:09 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> *************** *** 45,48 **** --- 45,52 ---- <menu name="" label="&Simulation"> <item> + <label>St&ep</label> + <id>ID_SIM_STEP</id> + </item> + <item> <label>&Start</label> <id>ID_SIM_START</id> Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mainframe.cpp 15 Jun 2007 09:27:13 -0000 1.19 --- mainframe.cpp 15 Jun 2007 09:46:07 -0000 1.20 *************** *** 31,34 **** --- 31,35 ---- #include <rsgedit/res/xpm_play.xpm> + #include <rsgedit/res/xpm_step.xpm> #include <rsgedit/res/xpm_pause.xpm> #include <rsgedit/res/xpm_open.xpm> *************** *** 60,63 **** --- 61,65 ---- EVT_UPDATE_UI(ID_SIM_START, mainframe::OnUpdateStartSimulation) EVT_MENU(ID_SIM_START, mainframe::OnStartSimulation) + EVT_MENU(ID_SIM_STEP, mainframe::OnStepSimulation) EVT_UPDATE_UI(ID_SIM_PAUSE, mainframe::OnUpdatePauseSimulation) *************** *** 130,133 **** --- 132,136 ---- MainFrame_menubar->Append(wxglade_tmp_menu_2, wxT("&View")); wxMenu* wxglade_tmp_menu_3 = new wxMenu(); + wxglade_tmp_menu_3->Append(ID_SIM_STEP, wxT("St&ep"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_START, wxT("&Start"), wxT("Start simulation"), wxITEM_NORMAL); wxglade_tmp_menu_3->Append(ID_SIM_PAUSE, wxT("&Pause"), wxT("Pause Simulation"), wxITEM_NORMAL); *************** *** 154,157 **** --- 157,161 ---- mToolBar->AddTool(ID_AGENT_OPEN, wxT("Start Agent"), wxBitmap(xpm_agent)); mToolBar->AddSeparator(); + mToolBar->AddTool(ID_SIM_STEP, wxT("Step"), wxBitmap(xpm_step)); mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); *************** *** 358,362 **** void mainframe::OnStartSimulation(wxCommandEvent& /*event*/) { ! StartSimulation(); } --- 362,378 ---- void mainframe::OnStartSimulation(wxCommandEvent& /*event*/) { ! bool singleStep = false; ! StartSimulation(singleStep); ! } ! ! void mainframe::OnUpdateStepSimulation(wxUpdateUIEvent& event) ! { ! event.Enable(GetSimState() == S_PAUSED); ! } ! ! void mainframe::OnStepSimulation(wxCommandEvent& /*event*/) ! { ! bool singleStep = true; ! StartSimulation(singleStep); } *************** *** 529,533 **** } ! void mainframe::StartSimulation() { mFPSTimer.Stop(); --- 545,549 ---- } ! void mainframe::StartSimulation(bool singleStep) { mFPSTimer.Stop(); *************** *** 557,579 **** UpdateWindowUI(wxUPDATE_UI_RECURSE); ! while (! sim->WantsToQuit()) { ! if (SIM_SIMSTEP > 0.0f) ! { ! AdvanceSimulation(sim, SIM_SIMSTEP); ! } else ! { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! AdvanceSimulation(sim, tDeltaSec); ! } ! PrintSimState(); ! // pump the wxWidgets message loop ! wxGetApp().Yield(); ! } DoneSimulation(sim); --- 573,600 ---- UpdateWindowUI(wxUPDATE_UI_RECURSE); ! if (singleStep) { ! // leave simulation loop after first iteration ! sim->Quit(); ! } ! do { ! if (SIM_SIMSTEP > 0.0f) ! { ! AdvanceSimulation(sim, SIM_SIMSTEP); ! } else ! { ! wxLongLong tNow = wxGetLocalTimeMillis(); ! float tDeltaSec = (tNow - tLast).ToLong() / 1000.0; ! tLast = tNow; ! AdvanceSimulation(sim, tDeltaSec); ! } ! PrintSimState(); ! ! // pump the wxWidgets message loop ! wxGetApp().Yield(); ! } while (! sim->WantsToQuit()); DoneSimulation(sim); |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:45:00
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit/res In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5062 Added Files: xpm_step.xpm Log Message: - add an icon for simulation single stepping --- NEW FILE: xpm_step.xpm --- /* XPM */ static char *xpm_step[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", ". c Black", " c #FFFFFF", /* pixels */ " ", " .. ... ", " .. .... ", " .. ..... ", " .. .. ... ", " .. .. ... ", " .. .. ... ", " .. .. ... ", " .. .. ... ", " .. .. ... ", " .. .. ... ", " .. ..... ", " .. .... ", " .. ... ", " ", " " }; |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:44:55
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv5026 Modified Files: constants.h Log Message: - define ID_SIM_STEP Index: constants.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/constants.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** constants.h 17 May 2007 17:49:23 -0000 1.6 --- constants.h 15 Jun 2007 09:44:28 -0000 1.7 *************** *** 34,37 **** --- 34,38 ---- ID_SIM_START = (wxID_HIGHEST+10), ID_SIM_PAUSE = (wxID_HIGHEST+11), + ID_SIM_STEP = (wxID_HIGHEST+12), ID_VIEW_LOG = (wxID_HIGHEST+20), |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:27:32
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30562 Modified Files: mainframe.cpp Log Message: - print simulation state after opening or resetting a simulation Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mainframe.cpp 15 Jun 2007 09:02:50 -0000 1.18 --- mainframe.cpp 15 Jun 2007 09:27:13 -0000 1.19 *************** *** 854,857 **** --- 854,858 ---- mSimFName = fname; UpdateTitle(); + PrintSimState(); return true; } |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:26:57
|
Update of /cvsroot/simspark/simspark/spark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30155 Modified Files: spark.rb Log Message: - reset simulation time in sparkResetScene() Index: spark.rb =================================================================== RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** spark.rb 15 Mar 2007 07:26:29 -0000 1.6 --- spark.rb 15 Jun 2007 09:26:25 -0000 1.7 *************** *** 68,71 **** --- 68,75 ---- sceneServer = get($serverPath+'scene') sceneServer.setActiveScene($scenePath) + + # reset simulation time + simulationServer = get($serverPath+'simulation'); + simulationServer.resetTime() end |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:26:15
|
Update of /cvsroot/simspark/simspark/spark/oxygen/simulationserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29751 Modified Files: simulationserver.cpp simulationserver.h simulationserver_c.cpp Log Message: - added method ResetTime() to reset simulation time to 0 Index: simulationserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/simulationserver.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** simulationserver.cpp 15 Mar 2007 07:26:28 -0000 1.4 --- simulationserver.cpp 15 Jun 2007 09:25:39 -0000 1.5 *************** *** 103,106 **** --- 103,111 ---- } + void SimulationServer::ResetTime() + { + mSimTime = 0.0f; + } + float SimulationServer::GetSimStep() { Index: simulationserver.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/simulationserver.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simulationserver.h 15 Mar 2007 07:26:28 -0000 1.3 --- simulationserver.h 15 Jun 2007 09:25:39 -0000 1.4 *************** *** 66,69 **** --- 66,72 ---- virtual float GetTime(); + /** resets the simulation time */ + virtual void ResetTime(); + /** sets the simulation time step */ virtual void SetSimStep(float deltaTime); Index: simulationserver_c.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/simulationserver/simulationserver_c.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** simulationserver_c.cpp 5 Dec 2005 21:21:18 -0000 1.1 --- simulationserver_c.cpp 15 Jun 2007 09:25:39 -0000 1.2 *************** *** 55,58 **** --- 55,64 ---- } + FUNCTION(SimulationServer, resetTime) + { + obj->ResetTime(); + return true; + } + FUNCTION(SimulationServer, setSimStep) { *************** *** 104,107 **** --- 110,114 ---- DEFINE_FUNCTION(initControlNode); DEFINE_FUNCTION(getTime); + DEFINE_FUNCTION(resetTime); DEFINE_FUNCTION(setSimStep); DEFINE_FUNCTION(getSimStep); |
|
From: Markus R. <rol...@us...> - 2007-06-15 09:02:55
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20391 Modified Files: mainframe.cpp rsgedit.wxg Log Message: - tweak window border styles Index: rsgedit.wxg =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/rsgedit.wxg,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** rsgedit.wxg 17 May 2007 17:49:23 -0000 1.6 --- rsgedit.wxg 15 Jun 2007 09:02:51 -0000 1.7 *************** *** 1,4 **** <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Tue May 01 10:32:21 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> --- 1,4 ---- <?xml version="1.0"?> ! <!-- generated by wxGlade 0.4.1 on Fri Jun 15 11:01:22 2007 --> <application path="." name="" class="" option="1" language="C++" top_window="MainFrame" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.6"> *************** *** 75,84 **** <option>1</option> <object class="wxSplitterWindow" name="mCtrVertSplitter" base="EditSplitterWindow"> ! <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_VERTICAL</orientation> <window_2>mRightPane</window_2> <window_1>mLeftPane</window_1> <object class="wxPanel" name="mLeftPane" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_7" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 75,84 ---- <option>1</option> <object class="wxSplitterWindow" name="mCtrVertSplitter" base="EditSplitterWindow"> ! <style>wxSP_NOBORDER</style> <orientation>wxSPLIT_VERTICAL</orientation> <window_2>mRightPane</window_2> <window_1>mLeftPane</window_1> <object class="wxPanel" name="mLeftPane" base="EditPanel"> ! <style>wxSIMPLE_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_7" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 88,97 **** <option>1</option> <object class="wxSplitterWindow" name="window_1" base="EditSplitterWindow"> ! <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> <window_2>window_1_pane_2</window_2> <window_1>window_1_pane_1</window_1> <object class="wxPanel" name="window_1_pane_1" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_4" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 88,97 ---- <option>1</option> <object class="wxSplitterWindow" name="window_1" base="EditSplitterWindow"> ! <style>wxSP_3DBORDER|wxSP_BORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> <window_2>window_1_pane_2</window_2> <window_1>window_1_pane_1</window_1> <object class="wxPanel" name="window_1_pane_1" base="EditPanel"> ! <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_4" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 101,105 **** <option>1</option> <object class="wxListCtrl" name="mCtrPropList" base="EditListCtrl"> ! <style>wxLC_REPORT|wxSUNKEN_BORDER</style> </object> </object> --- 101,105 ---- <option>1</option> <object class="wxListCtrl" name="mCtrPropList" base="EditListCtrl"> ! <style>wxLC_REPORT|wxSIMPLE_BORDER</style> </object> </object> *************** *** 107,111 **** </object> <object class="wxPanel" name="window_1_pane_2" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_8" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 107,111 ---- </object> <object class="wxPanel" name="window_1_pane_2" base="EditPanel"> ! <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_8" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 115,119 **** <option>1</option> <object class="wxTreeCtrl" name="mCtrTree" base="EditTreeCtrl"> ! <style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER</style> <id>1</id> </object> --- 115,119 ---- <option>1</option> <object class="wxTreeCtrl" name="mCtrTree" base="EditTreeCtrl"> ! <style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSIMPLE_BORDER</style> <id>1</id> </object> *************** *** 126,130 **** </object> <object class="wxPanel" name="mRightPane" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 126,130 ---- </object> <object class="wxPanel" name="mRightPane" base="EditPanel"> ! <style>wxSIMPLE_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 134,143 **** <option>1</option> <object class="wxSplitterWindow" name="mCtrHorSplitter" base="EditSplitterWindow"> ! <style>wxSP_3D|wxSP_BORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> <window_2>mBottomPane</window_2> <window_1>mTopPane</window_1> <object class="wxPanel" name="mTopPane" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 134,143 ---- <option>1</option> <object class="wxSplitterWindow" name="mCtrHorSplitter" base="EditSplitterWindow"> ! <style>wxSP_NOBORDER</style> <orientation>wxSPLIT_HORIZONTAL</orientation> <window_2>mBottomPane</window_2> <window_1>mTopPane</window_1> <object class="wxPanel" name="mTopPane" base="EditPanel"> ! <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_5" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 156,160 **** </object> <object class="wxPanel" name="mBottomPane" base="EditPanel"> ! <style>wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> <orient>wxVERTICAL</orient> --- 156,160 ---- </object> <object class="wxPanel" name="mBottomPane" base="EditPanel"> ! <style>wxNO_BORDER|wxTAB_TRAVERSAL</style> <object class="wxBoxSizer" name="sizer_6" base="EditBoxSizer"> <orient>wxVERTICAL</orient> *************** *** 164,168 **** <option>1</option> <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> ! <style>wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL</style> </object> </object> --- 164,168 ---- <option>1</option> <object class="wxTextCtrl" name="mCtrLog" base="EditTextCtrl"> ! <style>wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxNO_BORDER</style> </object> </object> Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mainframe.cpp 17 May 2007 17:49:23 -0000 1.17 --- mainframe.cpp 15 Jun 2007 09:02:50 -0000 1.18 *************** *** 108,120 **** // begin wxGlade: mainframe::mainframe ! mCtrVertSplitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); ! mRightPane = new wxPanel(mCtrVertSplitter, -1); ! mCtrHorSplitter = new wxSplitterWindow(mRightPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); ! mBottomPane = new wxPanel(mCtrHorSplitter, -1); ! mTopPane = new wxPanel(mCtrHorSplitter, -1); ! mLeftPane = new wxPanel(mCtrVertSplitter, -1); ! window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3D|wxSP_BORDER); ! window_1_pane_2 = new wxPanel(window_1, -1); ! window_1_pane_1 = new wxPanel(window_1, -1); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); --- 108,120 ---- // begin wxGlade: mainframe::mainframe ! mCtrVertSplitter = new wxSplitterWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mRightPane = new wxPanel(mCtrVertSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! mCtrHorSplitter = new wxSplitterWindow(mRightPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER); ! mBottomPane = new wxPanel(mCtrHorSplitter, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mTopPane = new wxPanel(mCtrHorSplitter, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! mLeftPane = new wxPanel(mCtrVertSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL); ! window_1 = new wxSplitterWindow(mLeftPane, -1, wxDefaultPosition, wxDefaultSize, wxSP_3DBORDER|wxSP_BORDER); ! window_1_pane_2 = new wxPanel(window_1, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); ! window_1_pane_1 = new wxPanel(window_1, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL); MainFrame_menubar = new wxMenuBar(); SetMenuBar(MainFrame_menubar); *************** *** 137,144 **** MainFrame_menubar->Append(wxglade_tmp_menu_4, wxT("&Help")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(window_1_pane_1, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); ! mCtrTree = new wxTreeCtrl(window_1_pane_2, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSUNKEN_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); ! mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL); set_properties(); --- 137,144 ---- MainFrame_menubar->Append(wxglade_tmp_menu_4, wxT("&Help")); MainFrame_statusbar = CreateStatusBar(1, 0); ! mCtrPropList = new wxListCtrl(window_1_pane_1, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSIMPLE_BORDER); ! mCtrTree = new wxTreeCtrl(window_1_pane_2, 1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_LINES_AT_ROOT|wxTR_DEFAULT_STYLE|wxSIMPLE_BORDER); mCanvas = new SparkGLCanvas(mTopPane, -1); ! mCtrLog = new wxTextCtrl(mBottomPane, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxNO_BORDER); set_properties(); |
Update of /cvsroot/simspark/simspark/spark/oxygen/physicsserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/oxygen/physicsserver Modified Files: body.cpp body.h collider.cpp collider.h hingejoint.cpp hingejoint.h universaljoint.cpp universaljoint.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: hingejoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hingejoint.cpp 19 Feb 2006 13:15:26 -0000 1.5 --- hingejoint.cpp 15 Jun 2007 08:48:17 -0000 1.6 *************** *** 118,127 **** } ! float HingeJoint::GetAngle() { return gRadToDeg(dJointGetHingeAngle(mODEJoint)); } ! float HingeJoint::GetAngleRate() { return gRadToDeg(dJointGetHingeAngleRate(mODEJoint)); --- 118,127 ---- } ! float HingeJoint::GetAngle() const { return gRadToDeg(dJointGetHingeAngle(mODEJoint)); } ! float HingeJoint::GetAngleRate() const { return gRadToDeg(dJointGetHingeAngleRate(mODEJoint)); Index: body.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/body.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** body.cpp 31 Mar 2007 13:19:56 -0000 1.4 --- body.cpp 15 Jun 2007 08:48:17 -0000 1.5 *************** *** 159,235 **** } void Body::SetSphere(float density, float radius) { dMass ODEMass; ! dMassSetSphere(&ODEMass, density, radius); dBodySetMass(mODEBody, &ODEMass); } void Body::SetSphereTotal(float total_mass, float radius) { dMass ODEMass; ! dMassSetSphereTotal(&ODEMass, total_mass, radius); dBodySetMass(mODEBody, &ODEMass); } void Body::SetBox(float density, const Vector3f& size) { dMass ODEMass; ! dMassSetBox(&ODEMass, density, size[0], size[1], size[2]); dBodySetMass(mODEBody, &ODEMass); } ! void Body::SetBoxTotal(float total_mass, const salt::Vector3f& size) { dMass ODEMass; ! dMassSetBoxTotal(&ODEMass, total_mass, size[0], size[1], size[2]); dBodySetMass(mODEBody, &ODEMass); } ! void Body::SetCylinder (float density, float radius, float length) { dMass ODEMass; // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCylinder (&ODEMass, density, direction, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::SetCylinderTotal(float total_mass, float radius, float length) { dMass ODEMass; // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCylinderTotal(&ODEMass, total_mass, direction, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::SetCappedCylinder (float density, float radius, float length) { dMass ODEMass; // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCappedCylinder (&ODEMass, density, direction, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::SetCappedCylinderTotal(float total_mass, float radius, float length) { dMass ODEMass; // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCappedCylinderTotal(&ODEMass, total_mass, ! direction, radius, length); dBodySetMass(mODEBody, &ODEMass); } Vector3f Body::GetVelocity() const { --- 159,346 ---- } + void Body::PrepareSphere(dMass& mass, float density, float radius) const + { + dMassSetSphere(&mass, density, radius); + } + void Body::SetSphere(float density, float radius) { dMass ODEMass; ! PrepareSphere(ODEMass, density, radius); dBodySetMass(mODEBody, &ODEMass); } + void Body::Addphere(float density, float radius, const Matrix& matrix) + { + dMass ODEMass; + PrepareSphere(ODEMass, density, radius); + AddMass(ODEMass, matrix); + } + + void Body::PrepareSphereTotal(dMass& mass, float total_mass, float radius) const + { + dMassSetSphereTotal(&mass, total_mass, radius); + } + void Body::SetSphereTotal(float total_mass, float radius) { dMass ODEMass; ! PrepareSphereTotal(ODEMass, total_mass, radius); dBodySetMass(mODEBody, &ODEMass); } + void Body::AddSphereTotal(float total_mass, float radius, const Matrix& matrix) + { + dMass ODEMass; + PrepareSphereTotal(ODEMass, total_mass, radius); + AddMass(ODEMass, matrix); + } + + void Body::PrepareBox(dMass& mass, float density, const Vector3f& size) const + { + dMassSetBox(&mass, density, size[0], size[1], size[2]); + } + void Body::SetBox(float density, const Vector3f& size) { dMass ODEMass; ! PrepareBox(ODEMass, density, size); dBodySetMass(mODEBody, &ODEMass); } ! void Body::AddBox(float density, const Vector3f& size, const Matrix& matrix) { dMass ODEMass; ! PrepareBox(ODEMass, density, size); ! AddMass(ODEMass, matrix); ! } ! ! void Body::PrepareBoxTotal(dMass& mass, float total_mass, const Vector3f& size) const ! { ! dMassSetBoxTotal(&mass, total_mass, size[0], size[1], size[2]); ! } ! ! void Body::SetBoxTotal(float total_mass, const Vector3f& size) ! { ! dMass ODEMass; ! PrepareBoxTotal(ODEMass, total_mass, size); dBodySetMass(mODEBody, &ODEMass); } ! void Body::AddBoxTotal(float total_mass, const Vector3f& size, const Matrix& matrix) { dMass ODEMass; + PrepareBoxTotal(ODEMass, total_mass, size); + AddMass(ODEMass, matrix); + } + void Body::AddMass(const dMass& mass, const Matrix& matrix) + { + dMass transMass(mass); + + dMatrix3 rot; + ConvertRotationMatrix(matrix, rot); + dMassRotate(&transMass,rot); + + dMass bodyMass; + dBodyGetMass(mODEBody, &bodyMass); + dMassAdd(&bodyMass, &transMass); + dBodySetMass(mODEBody, (const dMass*)&bodyMass); + + /** ODE currently requires that the center mass is always in the + origin of the body + */ + const Vector3f& trans(matrix.Pos()); + dMassTranslate(&transMass,trans[0],trans[1],trans[2]); + } + + void Body::PrepareCylinder (dMass& mass, float density, float radius, float length) const + { // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCylinder (&mass, density, direction, radius, length); ! } ! ! void Body::SetCylinder (float density, float radius, float length) ! { ! dMass ODEMass; ! PrepareCylinder(ODEMass, density, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::AddCylinder (float density, float radius, float length, const Matrix& matrix) { dMass ODEMass; + PrepareCylinder(ODEMass, density, radius, length); + AddMass(ODEMass, matrix); + } + void Body::PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const + { // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCylinderTotal(&mass, total_mass, direction, radius, length); ! } ! ! void Body::SetCylinderTotal(float total_mass, float radius, float length) ! { ! dMass ODEMass; ! PrepareCylinderTotal(ODEMass, total_mass, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::AddCylinderTotal(float total_mass, float radius, float length, const Matrix& matrix) { dMass ODEMass; + PrepareCylinderTotal(ODEMass, total_mass, radius, length); + AddMass(ODEMass, matrix); + } + void Body::PrepareCappedCylinder (dMass& mass, float density, float radius, float length) const + { // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCappedCylinder (&mass, density, direction, radius, length); ! } ! ! void Body::SetCappedCylinder (float density, float radius, float length) ! { ! dMass ODEMass; ! PrepareCappedCylinder(ODEMass, density, radius, length); dBodySetMass(mODEBody, &ODEMass); } ! void Body::AddCappedCylinder (float density, float radius, float length, const Matrix& matrix) { dMass ODEMass; + PrepareCappedCylinder(ODEMass, density, radius, length); + AddMass(ODEMass, matrix); + } + void Body::PrepareCappedCylinderTotal(dMass& mass, float total_mass, float radius, float length) const + { // direction: (1=x, 2=y, 3=z) int direction = 3; ! dMassSetCappedCylinderTotal(&mass, total_mass, direction, radius, length); ! } ! ! void Body::SetCappedCylinderTotal(float total_mass, float radius, float length) ! { ! dMass ODEMass; ! PrepareCappedCylinderTotal(ODEMass, total_mass, radius, length); dBodySetMass(mODEBody, &ODEMass); } + void Body::AddCappedCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix) + { + dMass ODEMass; + PrepareCappedCylinderTotal(ODEMass, total_mass, radius, length); + AddMass(ODEMass, matrix); + } + Vector3f Body::GetVelocity() const { *************** *** 355,359 **** } ! void Body::TranslateMass(const salt::Vector3f& v) { dMass m; --- 466,470 ---- } ! void Body::TranslateMass(const Vector3f& v) { dMass m; Index: universaljoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/universaljoint.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** universaljoint.h 12 Feb 2006 11:36:52 -0000 1.3 --- universaljoint.h 15 Jun 2007 08:48:17 -0000 1.4 *************** *** 48,57 **** \param axis a vector describing the axis in relative coordinates */ ! void SetAxis1(salt::Vector3f & axis); /** This function sets up the second axis of the joint \param axis a vector describing the axis in local coordinates */ ! void SetAxis2(salt::Vector3f & axis); /** returns the vector describing one of the two axis --- 48,57 ---- \param axis a vector describing the axis in relative coordinates */ ! void SetAxis1(const salt::Vector3f & axis); /** This function sets up the second axis of the joint \param axis a vector describing the axis in local coordinates */ ! void SetAxis2(const salt::Vector3f & axis); /** returns the vector describing one of the two axis *************** *** 59,63 **** \param idx index of the desired axis */ ! salt::Vector3f GetAxis(EAxisIndex idx); /** returns one of the axis angles in degrees, measured between --- 59,63 ---- \param idx index of the desired axis */ ! salt::Vector3f GetAxis(EAxisIndex idx) const; /** returns one of the axis angles in degrees, measured between *************** *** 65,72 **** environment. */ ! float GetAngle(EAxisIndex idx); /** returns the time derivate of one of the hinge angles */ ! float GetAngleRate(EAxisIndex idx); /** sets a joint parameter value */ --- 65,72 ---- environment. */ ! float GetAngle(EAxisIndex idx) const; /** returns the time derivate of one of the hinge angles */ ! float GetAngleRate(EAxisIndex idx) const; /** sets a joint parameter value */ Index: body.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/body.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** body.h 31 Mar 2007 13:19:56 -0000 1.4 --- body.h 15 Jun 2007 08:48:17 -0000 1.5 *************** *** 91,94 **** --- 91,100 ---- void SetSphere(float density, float radius); + /** adds a mass representing a sphere of the given radius and + density, with the matrix determining its center and + orientation + */ + void Addphere(float density, float radius, const salt::Matrix& matrix); + /** sets the mass parameters to represent a sphere of the given radius and total mass, with the center of mass at (0,0,0) *************** *** 97,100 **** --- 103,111 ---- void SetSphereTotal(float total_mass, float radius); + /** add a mass representing a sphere of the given radius and total + mass, with the matrix determining its center and orientation + */ + void AddSphereTotal(float total_mass, float radius, const salt::Matrix& matrix); + /** Set the mass parameters to represent a box of the given dimensions and density, with the center of mass at (0,0,0) *************** *** 103,106 **** --- 114,123 ---- void SetBox(float density, const salt::Vector3f& size); + /** Add a mass representing a box of the given dimensions and + density, with the matrix determining its center and + orientation + */ + void AddBox(float density, const salt::Vector3f& size, const salt::Matrix& matrix); + /** Set the mass parameters to represent a box of the given dimensions and total mass, with the center of mass at (0,0,0) *************** *** 109,112 **** --- 126,135 ---- void SetBoxTotal(float total_mass, const salt::Vector3f& size); + /** Add a mass representing a box of the given dimensions and + total mass, with the matrix determining its center and + orientation + */ + void AddBoxTotal(float total_mass, const salt::Vector3f& size, const salt::Matrix& matrix); + /** Set the mass parameters to represent a flat-ended cylinder of the given parameters and density, with the center of mass at *************** *** 115,119 **** long axis is oriented along the body's z axis. */ ! void SetCylinder (float density, float radius, float length); /** Set the mass parameters to represent a flat-ended cylinder of --- 138,148 ---- long axis is oriented along the body's z axis. */ ! void SetCylinder(float density, float radius, float length); ! ! /** Add a mass representing a flat-ended cylinder of the given ! parameters and density, with the matrix determining its center ! and orientation ! */ ! void AddCylinder(float density, float radius, float length, const salt::Matrix& matrix); /** Set the mass parameters to represent a flat-ended cylinder of *************** *** 125,128 **** --- 154,163 ---- void SetCylinderTotal(float total_mass, float radius, float length); + /** Add a mass representing a flat-ended cylinder of the given + parameters and total mass, with the matrix determining its + center and orientation + */ + void AddCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + /* Set the mass parameters to represent a capped cylinder of the given parameters and density, with the center of mass at *************** *** 134,137 **** --- 169,178 ---- void SetCappedCylinder (float density, float radius, float length); + /* Add a mass representing a capped cylinder of the given + parameters and density, with the matrix determining its center + and orientation + */ + void AddCappedCylinder (float density, float radius, float length, const salt::Matrix& matrix); + /* Set the mass parameters to represent a capped cylinder of the given parameters and total mass, with the center of mass at *************** *** 143,146 **** --- 184,193 ---- void SetCappedCylinderTotal(float total_mass, float radius, float length); + /* Add a mass representing a capped cylinder of the given + parameters and total mass, with the matrix determining its + center and orientation + */ + void AddCappedCylinderTotal(float total_mass, float radius, float length, const salt::Matrix& matrix); + /** displace the mass center relative to the body frame */ void TranslateMass(const salt::Vector3f& v); *************** *** 184,187 **** --- 231,241 ---- void SynchronizeParent() const; + /** adds the given ode mass to this body. The given matrix is + applied to the mass center + */ + void AddMass(const dMass& mass, const salt::Matrix& matrix); + + salt::Vector3f GetMassCenter() const; + protected: /** creates the managed ODE body and moves it to the position of *************** *** 193,196 **** --- 247,304 ---- bool CreateBody(); + /** sets up an ode mass struct representing a box of the given + size and total_mass + */ + void PrepareBoxTotal(dMass& mass, float total_mass, const salt::Vector3f& size) const; + + /** sets up an ode mass struct representing a box of the given + density and size + */ + void PrepareBox(dMass& mass, float density, const salt::Vector3f& size) const; + + /** sets up an ode mass struct representing a sphere of the given + density and radius + */ + void PrepareSphere(dMass& mass, float density, float radius) const; + + /** sets up an ode mass struct representing a sphere of the given + radius and total_mass + */ + void PrepareSphereTotal(dMass& mass, float total_mass, float radius) const; + + /** sets up an ode mass struct representing a flat-ended cylinder + of the given parameters and density, with the center of mass + at (0,0,0) relative to the body. The radius of the cylinder is + radius. The length of the cylinder is length. The cylinder's + long axis is oriented along the body's z axis. + */ + void PrepareCylinder (dMass& mass, float density, float radius, float length) const; + + /** sets up an ode mass struct representing a flat-ended cylinder + of the given parameters and total mass, with the center of + mass at (0,0,0) relative to the body. The radius of the + cylinder is radius. The length of the cylinder is length. The + cylinder's long axis is oriented along the body's z axis. + */ + void PrepareCylinderTotal(dMass& mass, float total_mass, float radius, float length) const; + + /* sets up an ode mass struct representing a capped cylinder of + the given parameters and density, with the center of mass at + (0,0,0) relative to the body. The radius of the cylinder (and + the spherical cap) is radius. The length of the cylinder (not + counting the spherical cap) is length. The cylinder's long axis + is oriented along the body's z axis. + */ + void PrepareCappedCylinder (dMass& mass, float density, float radius, float length) const; + + /* sets up an ode mass struct representing a capped cylinder of + the given parameters and total mass, with the center of mass at + (0,0,0) relative to the body. The radius of the cylinder (and + the spherical cap) is radius. The length of the cylinder (not + counting the spherical cap) is length. The cylinder's long axis + is oriented along the body's z axis. + */ + void PrepareCappedCylinderTotal(dMass& mass, float total_mass, float radius, float length) const; + private: /** updates the the internal state after physics calculation, Index: collider.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** collider.cpp 1 May 2007 13:09:32 -0000 1.4 --- collider.cpp 15 Jun 2007 08:48:17 -0000 1.5 *************** *** 222,225 **** --- 222,231 ---- } + Vector3f Collider::GetPosition() const + { + const dReal* pos = dGeomGetPosition(mODEGeom); + return Vector3f(pos[0],pos[1],pos[2]); + } + dSpaceID Collider::GetParentSpaceID() { Index: universaljoint.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/universaljoint.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** universaljoint.cpp 12 Feb 2006 11:36:52 -0000 1.3 --- universaljoint.cpp 15 Jun 2007 08:48:17 -0000 1.4 *************** *** 79,83 **** } ! void UniversalJoint::SetAxis1(Vector3f & axis) { Vector3f first(GetWorldTransform().Rotate(axis)); --- 79,83 ---- } ! void UniversalJoint::SetAxis1(const Vector3f & axis) { Vector3f first(GetWorldTransform().Rotate(axis)); *************** *** 85,89 **** } ! void UniversalJoint::SetAxis2(Vector3f & axis) { Vector3f second(GetWorldTransform().Rotate(axis)); --- 85,89 ---- } ! void UniversalJoint::SetAxis2(const Vector3f & axis) { Vector3f second(GetWorldTransform().Rotate(axis)); *************** *** 91,95 **** } ! Vector3f UniversalJoint::GetAxis(EAxisIndex idx) { Vector3f vec(0,0,0); --- 91,95 ---- } ! Vector3f UniversalJoint::GetAxis(EAxisIndex idx) const { Vector3f vec(0,0,0); *************** *** 118,122 **** } ! float UniversalJoint::GetAngle(EAxisIndex idx) { switch (idx) --- 118,122 ---- } ! float UniversalJoint::GetAngle(EAxisIndex idx) const { switch (idx) *************** *** 133,137 **** } ! float UniversalJoint::GetAngleRate(EAxisIndex idx) { switch (idx) --- 133,137 ---- } ! float UniversalJoint::GetAngleRate(EAxisIndex idx) const { switch (idx) Index: hingejoint.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/hingejoint.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hingejoint.h 19 Feb 2006 13:15:26 -0000 1.5 --- hingejoint.h 15 Jun 2007 08:48:17 -0000 1.6 *************** *** 63,70 **** bodies, or between the body and the static environment. */ ! float GetAngle(); /** returns the time derivate of the hinge angle */ ! float GetAngleRate(); /** sets a joint parameter value */ --- 63,70 ---- bodies, or between the body and the static environment. */ ! float GetAngle() const; /** returns the time derivate of the hinge angle */ ! float GetAngleRate() const; /** sets a joint parameter value */ Index: collider.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/physicsserver/collider.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** collider.h 1 May 2007 13:09:32 -0000 1.4 --- collider.h 15 Jun 2007 08:48:17 -0000 1.5 *************** *** 101,104 **** --- 101,107 ---- virtual void SetPosition(const salt::Vector3f& pos); + /** returns the absolute position of the managed geom */ + salt::Vector3f GetPosition() const; + /** sets the relative orientation of the managed geom directly. If the geom is connected to a body, the orientation of the body |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:47
|
Update of /cvsroot/simspark/simspark/spark/salt In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/salt Modified Files: matrix.cpp matrix.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: matrix.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/matrix.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** matrix.cpp 5 Dec 2005 20:56:00 -0000 1.1 --- matrix.cpp 15 Jun 2007 08:48:18 -0000 1.2 *************** *** 1,4 **** /* -*- mode: c++ -*- ! this file is part of rcssserver3D Fri May 9 2003 --- 1,4 ---- /* -*- mode: c++ -*- ! this file is part of rcssserver3D Fri May 9 2003 *************** *** 9,18 **** it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. ! This program 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 this program; if not, write to the Free Software --- 9,18 ---- it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. ! This program 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 this program; if not, write to the Free Software *************** *** 27,42 **** float Matrix::mIdentity[16]= { ! 1.0, 0.0, 0.0, 0.0, ! 0.0, 1.0, 0.0, 0.0, ! 0.0, 0.0, 1.0, 0.0, ! 0.0, 0.0, 0.0, 1.0 }; void Matrix::Dump() const { ! printf("%f %f %f %f\n", m[0], m[4], m[8], m[12]); ! printf("%f %f %f %f\n", m[1], m[5], m[9], m[13]); ! printf("%f %f %f %f\n", m[2], m[6], m[10], m[14]); ! printf("%f %f %f %f\n", m[3], m[7], m[11], m[15]); } --- 27,42 ---- float Matrix::mIdentity[16]= { ! 1.0, 0.0, 0.0, 0.0, ! 0.0, 1.0, 0.0, 0.0, ! 0.0, 0.0, 1.0, 0.0, ! 0.0, 0.0, 0.0, 1.0 }; void Matrix::Dump() const { ! printf("%f %f %f %f\n", m[0], m[4], m[8], m[12]); ! printf("%f %f %f %f\n", m[1], m[5], m[9], m[13]); ! printf("%f %f %f %f\n", m[2], m[6], m[10], m[14]); ! printf("%f %f %f %f\n", m[3], m[7], m[11], m[15]); } *************** *** 44,165 **** void Matrix::LookAt(const Vector3f & inEye, const Vector3f & inDirection, const Vector3f & inUp) { ! Vector3f forward = inDirection.Normalized(); ! Vector3f up = inUp.Normalized(); ! Vector3f right = forward.Cross(up); ! right.Normalize(); ! up = right.Cross(forward); ! // Make inverse rotation matrix using right, forward, up vectors ! Set( right.x(), right.y(), right.z(), 0.0f, ! up.x(), up.y(), up.z(), 0.0f, ! forward.x(), forward.y(), forward.z(), 0.0f, ! 0.0f, 0.0f, 0.0f, 1.0f); ! ! Pos() = Rotate(-inEye); } ! /*! Calculate an attenuation matrix. ! pos = world space position of light ! radius = radius of light (used for distance attenuation) */ void Matrix::CalcAttenuationNoRotation(const Vector3f &pos, float radius) { ! Matrix tmp1, tmp2; ! ! // translate to 'light space' ... no rotation needed ! tmp1.Translation(-pos); ! ! // create proper scaling matrix ! float invrad = 0.5f / radius; ! tmp2.Identity(); ! tmp2(0,0) = invrad; ! tmp2(1,1) = invrad; ! tmp2(2,2) = invrad; ! ! Identity (); ! Translation (Vector3f(0.5f, 0.5f, 0.5f)); ! *this *= tmp2 * tmp1; } void Matrix::CalcAttenuationWithRotation(const Matrix &lightWorldMatrix, float radius) { ! Matrix tmp1, tmp2; ! ! // translate to 'light space' ... this time with rotation ! tmp1 = lightWorldMatrix; ! tmp1.InvertRotationMatrix(); ! ! // create proper scaling matrix ! float invrad = 0.5f / radius; ! tmp2.Identity(); ! tmp2(0,0) = invrad; ! tmp2(1,1) = invrad; ! tmp2(2,2) = invrad; ! ! Identity (); ! Translation (Vector3f(0.5f, 0.5f, 0.5f)); ! *this *= tmp2 * tmp1; } void Matrix::CalcInfiniteProjection(float width, float height, float fov, float zNear) { ! const float halfWidth = zNear * (float)tan(gDegToRad(fov*0.5f)); ! const float halfHeight = halfWidth * (height/width); ! CalcInfiniteFrustum(-halfWidth, halfWidth, -halfHeight, halfHeight, zNear); } void Matrix::CalcInfiniteFrustum(float left, float right, float bottom, float top, float zNear) { ! Identity(); ! ! El(0,0) = (2*zNear) / (right - left); ! El(0,2) = (right + left) / (right - left); ! ! El(1,1) = (2*zNear) / (top - bottom); ! El(1,2) = (top + bottom) / (top - bottom); ! // nudge infinity in just slightly for lsb slop const float nudge = 1 - 1.0 / (1<<23); ! El(2,2) = -1 * nudge; ! El(2,3) = -2*zNear * nudge; ! ! El(3,2) = -1; ! El(3,3) = 0; } void Matrix::CalcSpotLight(const Matrix &lightWorldTransform, float fov, float width, float height, float zNear) { ! Matrix scale, proj, space; ! Vector3f halfVector(0.5f, 0.5f, 0.5f); ! Identity (); ! Translation (halfVector); ! scale.Identity (); ! scale.Scale (halfVector); ! // create projection matrix ! proj.CalcInfiniteProjection(width, height, fov, zNear); ! space = lightWorldTransform; ! space.InvertRotationMatrix(); ! // so, we transform first into light space, then project, then scale and ! // translate (this) ! *this *= scale * proj * space; } bool Matrix::IsEqual(const Matrix& matrix) const { ! for (int i=0; i<16; ++i) ! if (matrix.m[i] != m[i]) return false; ! return true; } --- 44,303 ---- void Matrix::LookAt(const Vector3f & inEye, const Vector3f & inDirection, const Vector3f & inUp) { ! Vector3f forward = inDirection.Normalized(); ! Vector3f up = inUp.Normalized(); ! Vector3f right = forward.Cross(up); ! right.Normalize(); ! up = right.Cross(forward); ! // Make inverse rotation matrix using right, forward, up vectors ! Set( right.x(), right.y(), right.z(), 0.0f, ! up.x(), up.y(), up.z(), 0.0f, ! forward.x(), forward.y(), forward.z(), 0.0f, ! 0.0f, 0.0f, 0.0f, 1.0f); ! ! Pos() = Rotate(-inEye); } ! /*! Calculate an attenuation matrix. ! pos = world space position of light ! radius = radius of light (used for distance attenuation) */ void Matrix::CalcAttenuationNoRotation(const Vector3f &pos, float radius) { ! Matrix tmp1, tmp2; ! // translate to 'light space' ... no rotation needed ! tmp1.Translation(-pos); ! // create proper scaling matrix ! float invrad = 0.5f / radius; ! ! tmp2.Identity(); ! tmp2(0,0) = invrad; ! tmp2(1,1) = invrad; ! tmp2(2,2) = invrad; ! ! Identity (); ! Translation (Vector3f(0.5f, 0.5f, 0.5f)); ! ! *this *= tmp2 * tmp1; } void Matrix::CalcAttenuationWithRotation(const Matrix &lightWorldMatrix, float radius) { ! Matrix tmp1, tmp2; ! // translate to 'light space' ... this time with rotation ! tmp1 = lightWorldMatrix; ! tmp1.InvertRotationMatrix(); ! // create proper scaling matrix ! float invrad = 0.5f / radius; ! ! tmp2.Identity(); ! tmp2(0,0) = invrad; ! tmp2(1,1) = invrad; ! tmp2(2,2) = invrad; ! ! Identity (); ! Translation (Vector3f(0.5f, 0.5f, 0.5f)); ! ! *this *= tmp2 * tmp1; } void Matrix::CalcInfiniteProjection(float width, float height, float fov, float zNear) { ! const float halfWidth = zNear * (float)tan(gDegToRad(fov*0.5f)); ! const float halfHeight = halfWidth * (height/width); ! CalcInfiniteFrustum(-halfWidth, halfWidth, -halfHeight, halfHeight, zNear); } void Matrix::CalcInfiniteFrustum(float left, float right, float bottom, float top, float zNear) { ! Identity(); ! ! El(0,0) = (2*zNear) / (right - left); ! El(0,2) = (right + left) / (right - left); ! ! El(1,1) = (2*zNear) / (top - bottom); ! El(1,2) = (top + bottom) / (top - bottom); ! // nudge infinity in just slightly for lsb slop const float nudge = 1 - 1.0 / (1<<23); ! El(2,2) = -1 * nudge; ! El(2,3) = -2*zNear * nudge; ! ! El(3,2) = -1; ! El(3,3) = 0; } void Matrix::CalcSpotLight(const Matrix &lightWorldTransform, float fov, float width, float height, float zNear) { ! Matrix scale, proj, space; ! Vector3f halfVector(0.5f, 0.5f, 0.5f); ! Identity (); ! Translation (halfVector); ! scale.Identity (); ! scale.Scale (halfVector); ! // create projection matrix ! proj.CalcInfiniteProjection(width, height, fov, zNear); ! space = lightWorldTransform; ! space.InvertRotationMatrix(); ! // so, we transform first into light space, then project, then scale and ! // translate (this) ! *this *= scale * proj * space; } bool Matrix::IsEqual(const Matrix& matrix) const { ! for (int i=0; i<16; ++i) ! if (matrix.m[i] != m[i]) return false; ! return true; ! } ! ! void Matrix::InvertMatrix() ! { ! float x00, x01, x02; ! float x10, x11, x12; ! float x20, x21, x22; ! float x30, x31, x32; ! float rcp; ! float y01, y02, y03, y12, y13, y23; ! float z02, z03, z12, z13, z22, z23, z32, z33; ! ! #define x03 x01 ! #define x13 x11 ! #define x23 x21 ! #define x33 x31 ! #define z00 x02 ! #define z10 x12 ! #define z20 x22 ! #define z30 x32 ! #define z01 x03 ! #define z11 x13 ! #define z21 x23 ! #define z31 x33 ! ! /* read 1st two columns of matrix into registers */ ! // col, row ! x00 = El(0,0); // src.xx ! x01 = El(0,1); // src.xy; 2nd column ! x10 = El(1,0); // src.yx; 1st column ! x11 = El(1,1); // src.yy; 2nd column ! x20 = El(2,0); // src.zx; 1st column ! x21 = El(2,1); // src.zy; 2nd column ! x30 = El(3,0); // src.wx; 1st column ! x31 = El(3,1); // src.wy; 2nd column ! ! /* compute all six 2x2 determinants of 1st two columns */ ! y01 = x00*x11 - x10*x01; ! y02 = x00*x21 - x20*x01; ! y03 = x00*x31 - x30*x01; ! y12 = x10*x21 - x20*x11; ! y13 = x10*x31 - x30*x11; ! y23 = x20*x31 - x30*x21; ! ! /* read 2nd two columns of matrix into registers */ ! x02 = El(0,2);// src.xz; ! x03 = El(0,3);// src.xw; ! x12 = El(1,2);// src.yz; ! x13 = El(1,3);// src.yw; ! x22 = El(2,2);// src.zz; ! x23 = El(2,3);// src.zw; ! x32 = El(3,2);// src.wz; ! x33 = El(3,3);// src.ww; ! ! /* compute all 3x3 cofactOMLs for 2nd two columns */ ! z33 = x02*y12 - x12*y02 + x22*y01; ! z23 = x12*y03 - x32*y01 - x02*y13; ! z13 = x02*y23 - x22*y03 + x32*y02; ! z03 = x22*y13 - x32*y12 - x12*y23; ! z32 = x13*y02 - x23*y01 - x03*y12; ! z22 = x03*y13 - x13*y03 + x33*y01; ! z12 = x23*y03 - x33*y02 - x03*y23; ! z02 = x13*y23 - x23*y13 + x33*y12; ! ! /* compute all six 2x2 determinants of 2nd two columns */ ! y01 = x02*x13 - x12*x03; ! y02 = x02*x23 - x22*x03; ! y03 = x02*x33 - x32*x03; ! y12 = x12*x23 - x22*x13; ! y13 = x12*x33 - x32*x13; ! y23 = x22*x33 - x32*x23; ! ! /* read 1st two columns of matrix into registers */ ! x00 = El(0,0);// src.xx ! x01 = El(0,1);// src.xy ! x10 = El(1,0);// src.yx ! x11 = El(1,1);// src.yy ! x20 = El(2,0);// src.zx ! x21 = El(2,1);// src.zy ! x30 = El(3,0);// src.wx ! x31 = El(3,1);// src.wy ! ! /* compute all 3x3 cofactOMLs for 1st column */ ! z30 = x11*y02 - x21*y01 - x01*y12; ! z20 = x01*y13 - x11*y03 + x31*y01; ! z10 = x21*y03 - x31*y02 - x01*y23; ! z00 = x11*y23 - x21*y13 + x31*y12; ! ! /* compute 4x4 determinant & its reciprocal */ ! rcp = x30*z30 + x20*z20 + x10*z10 + x00*z00; ! if (rcp == 0.0f) ! { ! /* the matrix can't be inverted */ ! return; ! } ! ! rcp = 1.0f/rcp; ! ! /* compute all 3x3 cofactOMLs for 2nd column */ ! z31 = x00*y12 - x10*y02 + x20*y01; ! z21 = x10*y03 - x30*y01 - x00*y13; ! z11 = x00*y23 - x20*y03 + x30*y02; ! z01 = x20*y13 - x30*y12 - x10*y23; ! ! Matrix invert; ! ! /* multiply all 3x3 cofactOMLs by reciprocal */ ! /* inverse.xx */ invert(0,0) = (z00*rcp); ! /* inverse.yx */ invert(1,0) = (z01*rcp); ! /* inverse.xy */ invert(0,1) = (z10*rcp); ! /* inverse.zx */ invert(2,0) = (z02*rcp); ! /* inverse.xz */ invert(0,2) = (z20*rcp); ! /* inverse.wx */ invert(3,0) = (z03*rcp); ! /* inverse.xw */ invert(0,3) = (z30*rcp); ! /* inverse.yy */ invert(1,1) = (z11*rcp); ! /* inverse.zy */ invert(2,1) = (z12*rcp); ! /* inverse.yz */ invert(1,2) = (z21*rcp); ! /* inverse.wy */ invert(3,1) = (z13*rcp); ! /* inverse.yw */ invert(1,3) = (z31*rcp); ! /* inverse.zz */ invert(2,2) = (z22*rcp); ! /* inverse.wz */ invert(3,2) = (z23*rcp); ! /* inverse.zw */ invert(2,3) = (z32*rcp); ! /* inverse.ww */ invert(3,3) = (z33*rcp); ! ! (*this) = invert; ! ! #undef x03 ! #undef x13 ! #undef x23 ! #undef x33 ! #undef z00 ! #undef z10 ! #undef z20 ! #undef z30 ! #undef z01 ! #undef z11 ! #undef z21 ! #undef z31 } Index: matrix.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/salt/matrix.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** matrix.h 5 Dec 2005 20:56:00 -0000 1.1 --- matrix.h 15 Jun 2007 08:48:18 -0000 1.2 *************** *** 141,144 **** --- 141,147 ---- f_inline void InvertRotationMatrix(); + /** inverts a matrix */ + void InvertMatrix(); + /** multiplies the matrix with inVector */ f_inline Vector3f Transform(const Vector3f & inVector) const; |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:47
|
Update of /cvsroot/simspark/simspark/spark/zeitgeist In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/zeitgeist Modified Files: leaf.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: leaf.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/zeitgeist/leaf.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** leaf.h 17 May 2007 17:46:45 -0000 1.3 --- leaf.h 15 Jun 2007 08:48:18 -0000 1.4 *************** *** 130,134 **** if (recursive) { ! return (*i)->FindChildSupportingClass<CLASS>(recursive); } } --- 130,138 ---- if (recursive) { ! child = (*i)->FindChildSupportingClass<CLASS>(recursive); ! if (child.get() != 0) ! { ! return child; ! } } } |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:47
|
Update of /cvsroot/simspark/simspark/spark/plugin/rosimporter In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/plugin/rosimporter Modified Files: roselements.cpp roselements.h rosimporter.cpp rosimporter.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: roselements.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/roselements.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roselements.h 23 Feb 2006 13:40:23 -0000 1.5 --- roselements.h 15 Jun 2007 08:48:17 -0000 1.6 *************** *** 61,64 **** --- 61,65 ---- // PhysicalAttributes #define RA_VALUE "value" + #define RA_CANCOLLIDE "canCollide" // Use *************** *** 69,72 **** --- 70,77 ---- #define RA_VERTEXLIST "vertexList" + // Axis Deflection + #define RA_MIN "min" + #define RA_MAX "max" + class RosElements { *************** *** 108,113 **** --- 113,123 ---- RE_HINGE, + RE_UNIVERSAL, + RE_SLIDER, RE_ANCHORPOINT, RE_AXIS, + RE_AXIS1, + RE_AXIS2, + RE_DEFLECTION, RE_GLOBALPHYSICALPARAMETERS, *************** *** 120,124 **** RE_DEFAULTAPPEARANCE, RE_AMBIENTLIGHTCOLOR, ! RE_COLOR }; --- 130,136 ---- RE_DEFAULTAPPEARANCE, RE_AMBIENTLIGHTCOLOR, ! RE_COLOR, ! ! RE_INTERACTIVEBUTTON }; Index: roselements.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/roselements.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roselements.cpp 23 Feb 2006 13:40:23 -0000 1.5 --- roselements.cpp 15 Jun 2007 08:48:17 -0000 1.6 *************** *** 80,85 **** --- 80,90 ---- ROS_DEFINE_ELEMENT(RE_HINGE,"Hinge"); + ROS_DEFINE_ELEMENT(RE_SLIDER,"Slider"); + ROS_DEFINE_ELEMENT(RE_UNIVERSAL,"UniversalJoint"); ROS_DEFINE_ELEMENT(RE_ANCHORPOINT,"AnchorPoint"); ROS_DEFINE_ELEMENT(RE_AXIS,"Axis"); + ROS_DEFINE_ELEMENT(RE_AXIS1,"Axis1"); + ROS_DEFINE_ELEMENT(RE_AXIS2,"Axis2"); + ROS_DEFINE_ELEMENT(RE_DEFLECTION,"Deflection"); ROS_DEFINE_ELEMENT(RE_GLOBALPHYSICALPARAMETERS,"GlobalPhysicalParameters"); *************** *** 94,97 **** --- 99,103 ---- ROS_DEFINE_ELEMENT(RE_COLOR, "Color"); + ROS_DEFINE_ELEMENT(RE_INTERACTIVEBUTTON,"InteractiveButton"); } Index: rosimporter.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** rosimporter.cpp 15 Mar 2007 07:26:28 -0000 1.10 --- rosimporter.cpp 15 Jun 2007 08:48:17 -0000 1.11 *************** *** 26,29 **** --- 26,30 ---- #include <oxygen/sceneserver/basenode.h> #include <oxygen/sceneserver/transform.h> + #include <oxygen/physicsserver/transformcollider.h> #include <oxygen/physicsserver/boxcollider.h> #include <oxygen/physicsserver/spherecollider.h> *************** *** 32,35 **** --- 33,38 ---- #include <oxygen/physicsserver/body.h> [...1990 lines suppressed...] + if (ja.axis2.setDeflection) + { + universal->SetParameter(dParamLoStop2, ja.axis2.loStop); + universal->SetParameter(dParamHiStop2, ja.axis2.hiStop); + universal->SetParameter(dParamLoStop2, ja.axis2.loStop); + } + + return; + } + + shared_ptr<SliderJoint> slider = shared_dynamic_cast<SliderJoint>(ja.joint); + if (slider.get() != 0) + { + // slider axis is set via parent transform node + // slider->SetAxis(ja.axis1); + return; + } + + assert(false); + } Index: rosimporter.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rosimporter.h 23 Feb 2006 13:40:23 -0000 1.8 --- rosimporter.h 15 Jun 2007 08:48:17 -0000 1.9 *************** *** 25,28 **** --- 25,29 ---- #include <map> #include <boost/shared_array.hpp> + #include <salt/matrix.h> #include <oxygen/sceneserver/sceneimporter.h> #include <oxygen/geometryserver/trimesh.h> *************** *** 34,40 **** --- 35,43 ---- class BaseNode; class Transform; + class TransformCollider; class ContactJointHandler; class Body; class Transform; + class Joint; } *************** *** 47,75 **** { public: ! enum ENodeContext { ! /** the node is read within a <Elements> tag, where no ! physical bodies are created ! */ ! NC_ELEMENTS, ! /** the node is read within a <Movable> tag or a joint ! node, where physical bodies are created ! */ ! NC_MOVABLE, ! }; ! struct Trans { public: ! salt::Vector3f translate; ! salt::Vector3f rotate; public: ! Trans() ! : translate(0.0, 0.0, 0.0), rotate (0.0, 0.0, 0.0) {} }; struct Appearance { --- 50,154 ---- { public: ! struct Trans ! { ! public: ! salt::Matrix matrix; ! ! public: ! Trans() { ! matrix.Identity(); ! } ! }; ! /** JointAxis describes a single joint axis along with associated ! joint parameters ! */ ! struct JointAxis ! { ! public: ! salt::Vector3f dir; ! //! true, iff loStop and hiStop angle are valid ! bool setDeflection; ! ! //! low stop angle (rad) ! double loStop; ! ! //! high stop angle (rad) ! double hiStop; ! ! public: ! JointAxis() ! : dir(0.0,0.0,0.0), setDeflection(false), ! loStop(0.0), hiStop(0.0) ! { ! } ! }; ! ! /** JointAttach describes how a joint connects two bodies along ! with the associated axis parameters ! */ ! struct JointAttach { public: ! boost::shared_ptr<oxygen::Joint> joint; ! boost::shared_ptr<oxygen::Body> body1; ! boost::shared_ptr<oxygen::Body> body2; ! JointAxis axis1; ! JointAxis axis2; public: ! JointAttach() ! { ! } ! }; ! ! /** RosContext refers to the current Transform parent node that is ! used to construct associated visual, geometric and physical ! nodes. It further describes mass and mass center of composite ! bodies. ! */ ! struct RosContext ! { ! public: ! boost::shared_ptr<oxygen::Transform> transform; ! boost::shared_ptr<oxygen::Body> body; ! bool adjustedPos; ! salt::Vector3f massCenter; ! double totalMass; ! bool movable; ! ! public: ! RosContext() ! : adjustedPos(false), massCenter(0.0,0.0,0.0), ! totalMass(0.0), movable(false) ! { ! } ! ! /** moves the Transform parent node in order to put the Body ! into the mass center of a composite body ! */ ! void AdjustPos(); + /** accumulates mass and adjusts the mass center */ + void AddMass(double mass, const Trans& trans); }; + /** declare a stack of RosContext nodes */ + typedef std::vector<RosContext > TRosStack; + + /** RosJointContext holds the child Body node that is connected to + the Body refered to in the current RosContext + */ + struct RosJointContext + { + boost::shared_ptr<oxygen::Body> body; + }; + + /** declare a stack of RosContext nodes */ + typedef std::vector<RosJointContext> TRosJointStack; + + /** Appearance holds a material definition */ struct Appearance { *************** *** 78,81 **** --- 157,163 ---- }; + /** Physical holds physical properties of the current + RosContext. + */ struct Physical { *************** *** 83,95 **** bool valid; double mass; salt::Vector3f massCenter; public: Physical() ! : valid(false), mass(0.0), massCenter(0.0, 0.0, 0.0) {} }; /** define a registry of macros; a macro is a XML subtree with the ! <Macro> node a the root element */ typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; --- 165,179 ---- bool valid; double mass; + bool canCollide; salt::Vector3f massCenter; public: Physical() ! : valid(false), mass(0.0), ! canCollide(true), massCenter(0.0, 0.0, 0.0) {} }; /** define a registry of macros; a macro is a XML subtree with the ! <Macro> node as the root element */ typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; *************** *** 101,107 **** salt::Vector3f vec; ! //! the index into an associated flat vertex array as used in ! //the TriMesh class int idx; public: TVertex() : idx(-1) {} --- 185,193 ---- salt::Vector3f vec; ! /** the index into an associated flat vertex array as used in ! the TriMesh class ! */ int idx; + public: TVertex() : idx(-1) {} *************** *** 150,153 **** --- 236,240 ---- }; + /** define a complex geom and it's associated vertices */ struct ComplexGeom { *************** *** 172,182 **** virtual bool ParseScene(const std::string& scene, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); protected: virtual bool ParseScene(const char* scene, int size, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); --- 259,280 ---- virtual bool ParseScene(const std::string& scene, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); protected: + void PushContext(); + void PopContext(); + void PushJointContext(); + void PopJointContext(); + RosContext& GetContext(); + RosJointContext& RosImporter::GetJointContext(); + boost::shared_ptr<oxygen::Transform> GetContextTransform(boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); + boost::shared_ptr<oxygen::Transform> CreateTransform(boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); + boost::shared_ptr<oxygen::Body> GetContextBody(boost::shared_ptr<oxygen::BaseNode> parent); + void SetJointBody(boost::shared_ptr<oxygen::Body> body); + virtual bool ParseScene(const char* scene, int size, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); *************** *** 185,189 **** bool IgnoreNode(const TiXmlNode* node) const; - bool HasBody(const Physical& physical, ENodeContext context); RosElements::ERosElement GetType(const TiXmlElement* element) const; --- 283,286 ---- *************** *** 192,196 **** void ApplyTransform(boost::shared_ptr<oxygen::Transform> transform, const Trans& trans); ! boost::shared_ptr<oxygen::Transform> CreateTransform (boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); --- 289,293 ---- void ApplyTransform(boost::shared_ptr<oxygen::Transform> transform, const Trans& trans); ! boost::shared_ptr<oxygen::TransformCollider> CreateTransformCollider (boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); *************** *** 209,219 **** bool ReadMacro(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUse(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadChildElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCompound(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadMovable(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadTrans(TiXmlElement* element, Trans& trans); --- 306,316 ---- bool ReadMacro(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUse(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadChildElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCompound(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadMovable(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadTrans(TiXmlElement* element, Trans& trans); *************** *** 222,242 **** bool ReadAppearance(TiXmlElement* element, Appearance& appear); ! bool ReadPhysical(TiXmlElement* element, Physical& physical, ENodeContext context); ! bool ReadBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadAnchorPoint(TiXmlElement* element, salt::Vector3f& anchor); ! bool ReadAxis(TiXmlElement* element, salt::Vector3f& axis); ! boost::shared_ptr<oxygen::Body> RosImporter::GetJointParentBody(boost::shared_ptr<oxygen::BaseNode> parent); boost::shared_ptr<oxygen::Body> RosImporter::GetJointChildBody(boost::shared_ptr<oxygen::BaseNode> parent); ! bool ReadHinge(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadVertexList(TiXmlElement* element); ! bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadGraphicalRep(TiXmlElement* element, boost::shared_ptr<oxygen::TriMesh> mesh, const Appearance& appear); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); --- 319,341 ---- bool ReadAppearance(TiXmlElement* element, Appearance& appear); ! bool ReadPhysical(TiXmlElement* element, Physical& physical); ! bool ReadBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadAnchorPoint(TiXmlElement* element, salt::Vector3f& anchor); ! bool ReadAxis(TiXmlElement* element, RosElements::ERosElement type, JointAxis& axis); ! boost::shared_ptr<oxygen::Body> RosImporter::GetJointParentBody(); boost::shared_ptr<oxygen::Body> RosImporter::GetJointChildBody(boost::shared_ptr<oxygen::BaseNode> parent); ! bool ReadHinge(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSlider(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUniversal(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadVertexList(TiXmlElement* element); ! bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadGraphicalRep(TiXmlElement* element, boost::shared_ptr<oxygen::TriMesh> mesh, const Appearance& appear); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); *************** *** 245,254 **** void BuildPolygon(oxygen::IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom); ! bool ReadPhysicalRep(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); ! bool ReadSimpleBox(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); ! bool ReadSimpleSphere(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); ! bool ReadSimpleCappedCylinder(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); protected: /** the last supplied fileName */ std::string mFileName; --- 344,404 ---- void BuildPolygon(oxygen::IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom); ! bool ReadPhysicalRep(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! ! void Attach(boost::shared_ptr<oxygen::Joint> joint, boost::shared_ptr<oxygen::Body> body1, boost::shared_ptr<oxygen::Body> body2, ! const JointAxis& axis1, const JointAxis& axis2 = JointAxis()); ! void AttachJoint(const JointAttach& ja); ! ! private: ! /** RosContextScope is a helper class that creates a new ! RosContext and destroys it when it goes ot ouf scope ! */ ! struct RosContextScope ! { ! public: ! RosContextScope(RosImporter* i) ! : importer(i) ! { ! importer->PushContext(); ! } ! ! ~RosContextScope() ! { ! importer->PopContext(); ! } ! ! protected: ! RosImporter* importer; ! }; ! ! /** RosJointScope is a helper class that creates a new joint scope ! and destroys it when it goes out of scope ! */ ! struct RosJointScope ! { ! RosJointScope(RosImporter* i) ! : importer(i) ! { ! importer->PushJointContext(); ! } ! ! ~RosJointScope() ! { ! importer->PopJointContext(); ! } ! ! protected: ! RosImporter* importer; ! }; protected: + /** reference to the parent node under wich the imported scene is + constructed + */ + boost::shared_ptr<oxygen::BaseNode> mSceneParent; + /** the last supplied fileName */ std::string mFileName; *************** *** 268,273 **** /** the static macro registry is shared across RosImporter instances ! */ static TMacroMap mMacroMap; }; --- 418,429 ---- /** the static macro registry is shared across RosImporter instances ! */ static TMacroMap mMacroMap; + + /** the stack of RosContext instances */ + TRosStack mStack; + + /* the stack of JointContext instances */ + TRosJointStack mJointStack; }; |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:42
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/contrib/rsgedit Modified Files: property.cpp property.h sparkglrender.cpp sparkglrender.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: property.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** property.cpp 17 May 2007 17:49:23 -0000 1.9 --- property.cpp 15 Jun 2007 08:48:16 -0000 1.10 *************** *** 36,39 **** --- 36,41 ---- #include <oxygen/physicsserver/body.h> #include <oxygen/physicsserver/joint.h> + #include <oxygen/physicsserver/hingejoint.h> + #include <oxygen/physicsserver/universaljoint.h> #include <oxygen/physicsserver/world.h> #include <oxygen/physicsserver/collisionhandler.h> *************** *** 108,111 **** --- 110,115 ---- mClassMap[_T("/classes/oxygen/Body")] = CL_BODY; mClassMap[_T("/classes/oxygen/Joint")] = CL_JOINT; + mClassMap[_T("/classes/oxygen/HingeJoint")] = CL_HINGEJOINT; + mClassMap[_T("/classes/oxygen/UniversalJoint")] = CL_UNIVERSALJOINT; mClassMap[_T("/classes/oxygen/World")] = CL_WORLD; mClassMap[_T("/classes/oxygen/CollisionHandler")] = CL_COLLISIONHANDLER; *************** *** 201,204 **** --- 205,224 ---- } + void Property::GenHingeEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + const HingeJoint& hinge = *shared_static_cast<HingeJoint>(leaf); + entries.push_back(Entry(_T("GetAngle"),FormatFloat(hinge.GetAngle()))); + entries.push_back(Entry(_T("GetAngleRate"),FormatFloat(hinge.GetAngleRate()))); + } + + void Property::GenUniversalEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const + { + const UniversalJoint& universal = *shared_static_cast<UniversalJoint>(leaf); + entries.push_back(Entry(_T("GetAngle(0)"),FormatFloat(universal.GetAngle(Joint::AI_FIRST)))); + entries.push_back(Entry(_T("GetAngle(1)"),FormatFloat(universal.GetAngle(Joint::AI_SECOND)))); + entries.push_back(Entry(_T("GetAngleRate(0)"),FormatFloat(universal.GetAngleRate(Joint::AI_FIRST)))); + entries.push_back(Entry(_T("GetAngleRate(1)"),FormatFloat(universal.GetAngleRate(Joint::AI_SECOND)))); + } + void Property::GenJointEntries(shared_ptr<Leaf> leaf, TEntryList& entries) const { *************** *** 383,386 **** --- 403,414 ---- break; + case CL_HINGEJOINT: + GenHingeEntries(leaf, entries); + break; + + case CL_UNIVERSALJOINT: + GenUniversalEntries(leaf, entries); + break; + case CL_JOINT: GenJointEntries(leaf, entries); Index: sparkglrender.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sparkglrender.h 15 Apr 2007 12:19:12 -0000 1.6 --- sparkglrender.h 15 Jun 2007 08:48:16 -0000 1.7 *************** *** 44,47 **** --- 44,54 ---- class SparkGLRender { + protected: + struct RenderSelectionContext + { + RenderSelectionContext(boost::shared_ptr<oxygen::BaseNode> node); + ~RenderSelectionContext(); + }; + public: SparkGLRender(); Index: sparkglrender.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglrender.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sparkglrender.cpp 15 Apr 2007 12:19:12 -0000 1.5 --- sparkglrender.cpp 15 Jun 2007 08:48:16 -0000 1.6 *************** *** 20,23 **** --- 20,25 ---- #include "sparkglrender.h" #include <zeitgeist/logserver/logserver.h> + #include <oxygen/physicsserver/body.h> + #include <oxygen/physicsserver/joint.h> #include <oxygen/sceneserver/camera.h> #include <oxygen/sceneserver/sceneserver.h> *************** *** 36,39 **** --- 38,57 ---- using namespace kerosin; + // ---- SparkGLRender::RenderSelectionContext + + SparkGLRender::RenderSelectionContext::RenderSelectionContext(shared_ptr<BaseNode> node) + { + assert(node.get() != 0); + glPushMatrix(); + glMultMatrixf(node->GetWorldTransform().m); + } + + SparkGLRender::RenderSelectionContext::~RenderSelectionContext() + { + glPopMatrix(); + } + + // ---- SparkGLRender + SparkGLRender::SparkGLRender() { *************** *** 110,116 **** --- 128,136 ---- if (sMatNode.get() != 0) { + shared_ptr<Material> material = sMatNode->GetMaterial(); sMatNode->SetMaterial("matSelected"); + RenderSelectionContext context(sMatNode); sMatNode->RenderInternal(); *************** *** 128,138 **** if (renderNode.get() != 0) { renderNode->RenderInternal(); return; } const salt::AABB3& bb = node->GetWorldBoundingBox(); float size = std::max<float>(GLRENDER_MIN_AXIS_WIDTH, bb.GetRadius()); ! Axis::RenderAxis(size); } --- 148,193 ---- if (renderNode.get() != 0) { + RenderSelectionContext context(renderNode); renderNode->RenderInternal(); return; } + shared_ptr<Joint> jointNode = + shared_dynamic_cast<Joint>(node); + + if (jointNode.get() != 0) + { + for ( + int i=Joint::BI_FIRST; + i<=Joint::BI_SECOND; + ++i + ) + { + shared_ptr<Body> body = + jointNode->GetBody(static_cast<Joint::EBodyIndex>(i)); + + if (body.get() == 0) + { + continue; + } + + RenderNodeSelection(body); + } + + { + RenderSelectionContext context(jointNode); + Axis::RenderAxis(0.5); + } + + return; + } + const salt::AABB3& bb = node->GetWorldBoundingBox(); float size = std::max<float>(GLRENDER_MIN_AXIS_WIDTH, bb.GetRadius()); ! ! { ! RenderSelectionContext context(node); ! Axis::RenderAxis(size); ! } } *************** *** 150,158 **** glDisable(GL_DEPTH_TEST); - glPushMatrix(); - glMultMatrixf(node->GetWorldTransform().m); - RenderNodeSelection(node); - - glPopMatrix(); } --- 205,208 ---- Index: property.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/property.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** property.h 15 Mar 2007 07:26:24 -0000 1.6 --- property.h 15 Jun 2007 08:48:16 -0000 1.7 *************** *** 47,50 **** --- 47,52 ---- CL_BODY, CL_JOINT, + CL_HINGEJOINT, + CL_UNIVERSALJOINT, CL_WORLD, CL_COLLISIONHANDLER, *************** *** 86,89 **** --- 88,93 ---- void GenTransformEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenBodyEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenHingeEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; + void GenUniversalEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenJointEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; void GenWorldEntries(boost::shared_ptr<zeitgeist::Leaf> leaf, TEntryList& entries) const; |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:42
|
Update of /cvsroot/simspark/simspark/spark/oxygen/geometryserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/oxygen/geometryserver Modified Files: geometryserver.cpp Log Message: - merged ROSIMPORTER_XLAB bracnh Index: geometryserver.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/geometryserver/geometryserver.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** geometryserver.cpp 23 Feb 2006 13:38:36 -0000 1.2 --- geometryserver.cpp 15 Jun 2007 08:48:16 -0000 1.3 *************** *** 125,129 **** shared_ptr<TriMesh> mesh = importer->ImportMesh(name,parameter); ! if (mesh.get() == 0) { continue; --- 125,129 ---- shared_ptr<TriMesh> mesh = importer->ImportMesh(name,parameter); ! if (mesh.get() == 0 || mesh->GetVertexCount() == 0) { continue; |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:23
|
Update of /cvsroot/simspark/simspark/spark/oxygen/sceneserver In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark/oxygen/sceneserver Modified Files: basenode.cpp basenode.h transform.cpp transform.h Log Message: - merged ROSIMPORTER_XLAB bracnh Index: transform.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/transform.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** transform.cpp 18 Feb 2006 19:48:06 -0000 1.2 --- transform.cpp 15 Jun 2007 08:48:17 -0000 1.3 *************** *** 85,90 **** mOldLocalTransform = mLocalTransform; ! mLocalTransform = transform; ! parent->SetWorldTransform(mIdentityMatrix); } --- 85,91 ---- mOldLocalTransform = mLocalTransform; ! mLocalTransform = (parent->GetWorldTransform()); ! mLocalTransform.InvertMatrix(); ! mLocalTransform = mLocalTransform * transform; } *************** *** 98,101 **** --- 99,107 ---- } + const salt::Vector3f& Transform::GetLocalPos() + { + return mLocalTransform.Pos(); + } + void Transform::SetLocalRotationRad(const salt::Vector3f &rot) { Index: basenode.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/basenode.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** basenode.h 5 Dec 2005 21:21:17 -0000 1.1 --- basenode.h 15 Jun 2007 08:48:17 -0000 1.2 *************** *** 111,115 **** /** returns the corresponding local coordinates to the given world coordinates */ ! salt::Vector3f GetLocalPos(const salt::Vector3f& worldPos); /** updates internal state before physics calculation */ --- 111,115 ---- /** returns the corresponding local coordinates to the given world coordinates */ ! salt::Vector3f GetLocalPos(const salt::Vector3f& worldPos) const; /** updates internal state before physics calculation */ Index: transform.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/transform.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** transform.h 18 Feb 2006 19:48:06 -0000 1.2 --- transform.h 15 Jun 2007 08:48:17 -0000 1.3 *************** *** 71,74 **** --- 71,77 ---- void SetLocalPos(const salt::Vector3f &pos); + /** returns the local position of this node */ + const salt::Vector3f& GetLocalPos(); + /** sets the local rotation of this node in rad */ void SetLocalRotationRad(const salt::Vector3f &rot); Index: basenode.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/oxygen/sceneserver/basenode.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** basenode.cpp 15 Feb 2006 01:00:19 -0000 1.2 --- basenode.cpp 15 Jun 2007 08:48:17 -0000 1.3 *************** *** 201,205 **** } ! salt::Vector3f BaseNode::GetLocalPos(const salt::Vector3f& worldPos) { Matrix invWorld = GetWorldTransform(); --- 201,205 ---- } ! salt::Vector3f BaseNode::GetLocalPos(const salt::Vector3f& worldPos) const { Matrix invWorld = GetWorldTransform(); |
|
From: Markus R. <rol...@us...> - 2007-06-15 08:48:22
|
Update of /cvsroot/simspark/simspark/spark In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14965/spark Modified Files: simspark.sln Log Message: - merged ROSIMPORTER_XLAB bracnh Index: simspark.sln =================================================================== RCS file: /cvsroot/simspark/simspark/spark/simspark.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** simspark.sln 17 May 2007 17:49:23 -0000 1.3 --- simspark.sln 15 Jun 2007 08:48:18 -0000 1.4 *************** *** 115,118 **** --- 115,128 ---- EndProjectSection EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rosimporter", "plugin\rosimporter\rosimporter.vcproj", "{B08F8842-DD81-4674-BCF8-B6188149CEFB}" + ProjectSection(ProjectDependencies) = postProject + {38291F56-23B6-4B5D-8810-D2AD2A379EE9} = {38291F56-23B6-4B5D-8810-D2AD2A379EE9} + {B3FAF507-1CEB-437C-8272-30C8DC236192} = {B3FAF507-1CEB-437C-8272-30C8DC236192} + {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} = {17DECC5C-BD53-4ECE-8E4F-707C52D4987C} + {87C2BFBA-8299-432F-B2E6-08E650E74230} = {87C2BFBA-8299-432F-B2E6-08E650E74230} + {DAB59CC4-E184-40CC-A858-27C432A53AAB} = {DAB59CC4-E184-40CC-A858-27C432A53AAB} + {001EB793-1243-46C2-B693-B23BD1D3D1B5} = {001EB793-1243-46C2-B693-B23BD1D3D1B5} + EndProjectSection + EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution *************** *** 224,227 **** --- 234,243 ---- {AE03EAFA-DFD9-43B3-8777-13A27167A692}.VCRelease|Win32.ActiveCfg = VCRelease|Win32 {AE03EAFA-DFD9-43B3-8777-13A27167A692}.VCRelease|Win32.Build.0 = VCRelease|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.Debug|Win32.ActiveCfg = Debug|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.Debug|Win32.Build.0 = Debug|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.Release|Win32.ActiveCfg = VCRelease|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.Release|Win32.Build.0 = VCRelease|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.VCRelease|Win32.ActiveCfg = VCRelease|Win32 + {B08F8842-DD81-4674-BCF8-B6188149CEFB}.VCRelease|Win32.Build.0 = VCRelease|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution *************** *** 242,245 **** --- 258,262 ---- {9E5D17FC-5665-48A8-9298-747A3D690787} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {AE03EAFA-DFD9-43B3-8777-13A27167A692} = {9FA74610-97C1-48A3-BD56-3C086F819A90} + {B08F8842-DD81-4674-BCF8-B6188149CEFB} = {9FA74610-97C1-48A3-BD56-3C086F819A90} {A1E81A09-EF57-41FE-AA50-05FF6B1597FC} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} {38B680B0-B535-40F0-B5DB-FC307C40C7D6} = {29CFB1A3-30E1-4B18-8BB9-8E1DBAF69B1F} |
|
From: Markus R. <rol...@us...> - 2007-06-13 13:24:32
|
Update of /cvsroot/simspark/simspark/spark/plugin/rosimporter In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26292 Modified Files: Tag: ROSIMPORTER_XLAB rosimporter.cpp rosimporter.h Log Message: - roughly working version of RosImporter plugin Index: rosimporter.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.cpp,v retrieving revision 1.10.4.1 retrieving revision 1.10.4.2 diff -C2 -d -r1.10.4.1 -r1.10.4.2 *** rosimporter.cpp 20 May 2007 16:31:53 -0000 1.10.4.1 --- rosimporter.cpp 13 Jun 2007 13:24:29 -0000 1.10.4.2 *************** *** 33,36 **** --- 33,37 ---- #include <oxygen/physicsserver/body.h> #include <oxygen/physicsserver/hingejoint.h> + #include <oxygen/physicsserver/sliderjoint.h> #include <oxygen/physicsserver/universaljoint.h> #include <oxygen/geometryserver/geometryserver.h> *************** *** 55,59 **** static const string S_FROMSTRING("<from string>"); static const string S_BODY("body_"); [...1960 lines suppressed...] + if (ja.axis2.setDeflection) + { + universal->SetParameter(dParamLoStop2, ja.axis2.loStop); + universal->SetParameter(dParamHiStop2, ja.axis2.hiStop); + universal->SetParameter(dParamLoStop2, ja.axis2.loStop); + } + + return; + } + + shared_ptr<SliderJoint> slider = shared_dynamic_cast<SliderJoint>(ja.joint); + if (slider.get() != 0) + { + // slider axis is set via parent transform node + // slider->SetAxis(ja.axis1); + return; + } + + assert(false); + } Index: rosimporter.h =================================================================== RCS file: /cvsroot/simspark/simspark/spark/plugin/rosimporter/rosimporter.h,v retrieving revision 1.8.8.1 retrieving revision 1.8.8.2 diff -C2 -d -r1.8.8.1 -r1.8.8.2 *** rosimporter.h 20 May 2007 16:31:53 -0000 1.8.8.1 --- rosimporter.h 13 Jun 2007 13:24:29 -0000 1.8.8.2 *************** *** 39,42 **** --- 39,43 ---- class Body; class Transform; + class Joint; } *************** *** 49,65 **** { public: - enum ENodeContext - { - /** the node is read within a <Elements> tag, where no - physical bodies are created - */ - NC_ELEMENTS, - - /** the node is read within a <Movable> tag or a joint - node, where physical bodies are created - */ - NC_MOVABLE, - }; - struct Trans { --- 50,53 ---- *************** *** 74,77 **** --- 62,154 ---- }; + /** JointAxis describes a single joint axis along with associated + joint parameters + */ + struct JointAxis + { + public: + salt::Vector3f dir; + + //! true, iff loStop and hiStop angle are valid + bool setDeflection; + + //! low stop angle (rad) + double loStop; + + //! high stop angle (rad) + double hiStop; + + public: + JointAxis() + : dir(0.0,0.0,0.0), setDeflection(false), + loStop(0.0), hiStop(0.0) + { + } + }; + + /** JointAttach describes how a joint connects two bodies along + with the associated axis parameters + */ + struct JointAttach + { + public: + boost::shared_ptr<oxygen::Joint> joint; + boost::shared_ptr<oxygen::Body> body1; + boost::shared_ptr<oxygen::Body> body2; + JointAxis axis1; + JointAxis axis2; + + public: + JointAttach() + { + } + }; + + /** RosContext refers to the current Transform parent node that is + used to construct associated visual, geometric and physical + nodes. It further describes mass and mass center of composite + bodies. + */ + struct RosContext + { + public: + boost::shared_ptr<oxygen::Transform> transform; + boost::shared_ptr<oxygen::Body> body; + bool adjustedPos; + salt::Vector3f massCenter; + double totalMass; + bool movable; + + public: + RosContext() + : adjustedPos(false), massCenter(0.0,0.0,0.0), + totalMass(0.0), movable(false) + { + } + + /** moves the Transform parent node in order to put the Body + into the mass center of a composite body + */ + void AdjustPos(); + + /** accumulates mass and adjusts the mass center */ + void AddMass(double mass, const Trans& trans); + }; + + /** declare a stack of RosContext nodes */ + typedef std::vector<RosContext > TRosStack; + + /** RosJointContext holds the child Body node that is connected to + the Body refered to in the current RosContext + */ + struct RosJointContext + { + boost::shared_ptr<oxygen::Body> body; + }; + + /** declare a stack of RosContext nodes */ + typedef std::vector<RosJointContext> TRosJointStack; + + /** Appearance holds a material definition */ struct Appearance { *************** *** 80,83 **** --- 157,163 ---- }; + /** Physical holds physical properties of the current + RosContext. + */ struct Physical { *************** *** 85,97 **** bool valid; double mass; salt::Vector3f massCenter; public: Physical() ! : valid(false), mass(0.0), massCenter(0.0, 0.0, 0.0) {} }; /** define a registry of macros; a macro is a XML subtree with the ! <Macro> node a the root element */ typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; --- 165,179 ---- bool valid; double mass; + bool canCollide; salt::Vector3f massCenter; public: Physical() ! : valid(false), mass(0.0), ! canCollide(true), massCenter(0.0, 0.0, 0.0) {} }; /** define a registry of macros; a macro is a XML subtree with the ! <Macro> node as the root element */ typedef std::map<std::string, boost::shared_ptr<TiXmlElement> > TMacroMap; *************** *** 103,109 **** salt::Vector3f vec; ! //! the index into an associated flat vertex array as used in ! //the TriMesh class int idx; public: TVertex() : idx(-1) {} --- 185,193 ---- salt::Vector3f vec; ! /** the index into an associated flat vertex array as used in ! the TriMesh class ! */ int idx; + public: TVertex() : idx(-1) {} *************** *** 152,155 **** --- 236,240 ---- }; + /** define a complex geom and it's associated vertices */ struct ComplexGeom { *************** *** 174,184 **** virtual bool ParseScene(const std::string& scene, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); protected: virtual bool ParseScene(const char* scene, int size, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); --- 259,280 ---- virtual bool ParseScene(const std::string& scene, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); protected: + void PushContext(); + void PopContext(); + void PushJointContext(); + void PopJointContext(); + RosContext& GetContext(); + RosJointContext& RosImporter::GetJointContext(); + boost::shared_ptr<oxygen::Transform> GetContextTransform(boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); + boost::shared_ptr<oxygen::Transform> CreateTransform(boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); + boost::shared_ptr<oxygen::Body> GetContextBody(boost::shared_ptr<oxygen::BaseNode> parent); + void SetJointBody(boost::shared_ptr<oxygen::Body> body); + virtual bool ParseScene(const char* scene, int size, ! boost::shared_ptr<oxygen::BaseNode> parent, ! boost::shared_ptr<zeitgeist::ParameterList> parameter); *************** *** 187,191 **** bool IgnoreNode(const TiXmlNode* node) const; - bool HasBody(const Physical& physical, ENodeContext context); RosElements::ERosElement GetType(const TiXmlElement* element) const; --- 283,286 ---- *************** *** 194,200 **** void ApplyTransform(boost::shared_ptr<oxygen::Transform> transform, const Trans& trans); - boost::shared_ptr<oxygen::Transform> CreateTransform - (boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); - boost::shared_ptr<oxygen::TransformCollider> CreateTransformCollider (boost::shared_ptr<oxygen::BaseNode> parent, const Trans& trans); --- 289,292 ---- *************** *** 214,224 **** bool ReadMacro(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUse(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadChildElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCompound(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadMovable(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadTrans(TiXmlElement* element, Trans& trans); --- 306,316 ---- bool ReadMacro(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUse(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadChildElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadElements(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCompound(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadMovable(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadTrans(TiXmlElement* element, Trans& trans); *************** *** 227,248 **** bool ReadAppearance(TiXmlElement* element, Appearance& appear); ! bool ReadPhysical(TiXmlElement* element, Physical& physical, ENodeContext context); ! bool ReadBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadAnchorPoint(TiXmlElement* element, salt::Vector3f& anchor); ! bool ReadAxis(TiXmlElement* element, RosElements::ERosElement type, salt::Vector3f& axis); ! boost::shared_ptr<oxygen::Body> RosImporter::GetJointParentBody(boost::shared_ptr<oxygen::BaseNode> parent); boost::shared_ptr<oxygen::Body> RosImporter::GetJointChildBody(boost::shared_ptr<oxygen::BaseNode> parent); ! bool ReadHinge(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); ! bool ReadUniversal(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadVertexList(TiXmlElement* element); ! bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element, ENodeContext context); bool ReadGraphicalRep(TiXmlElement* element, boost::shared_ptr<oxygen::TriMesh> mesh, const Appearance& appear); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); --- 319,341 ---- bool ReadAppearance(TiXmlElement* element, Appearance& appear); ! bool ReadPhysical(TiXmlElement* element, Physical& physical); ! bool ReadBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadAnchorPoint(TiXmlElement* element, salt::Vector3f& anchor); ! bool ReadAxis(TiXmlElement* element, RosElements::ERosElement type, JointAxis& axis); ! boost::shared_ptr<oxygen::Body> RosImporter::GetJointParentBody(); boost::shared_ptr<oxygen::Body> RosImporter::GetJointChildBody(boost::shared_ptr<oxygen::BaseNode> parent); ! bool ReadHinge(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSlider(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadUniversal(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadVertexList(TiXmlElement* element); ! bool ReadComplexShape(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); bool ReadGraphicalRep(TiXmlElement* element, boost::shared_ptr<oxygen::TriMesh> mesh, const Appearance& appear); bool ReadComplexElements(TiXmlElement* element, TComplexGeomList& geomList); *************** *** 251,263 **** void BuildPolygon(oxygen::IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom); ! bool ReadPhysicalRep(boost::shared_ptr<oxygen::Transform> transform, TiXmlElement* element, ENodeContext context); ! bool ReadSimpleBox(boost::shared_ptr<oxygen::Transform> transform, boost::shared_ptr<oxygen::Body> body, ! TiXmlElement* element, ENodeContext context); ! bool ReadSimpleSphere(boost::shared_ptr<oxygen::Transform> transform, boost::shared_ptr<oxygen::Body> body, ! TiXmlElement* element, ENodeContext context); ! bool ReadSimpleCappedCylinder(boost::shared_ptr<oxygen::Transform> transform, boost::shared_ptr<oxygen::Body> body, ! TiXmlElement* element, ENodeContext context); protected: /** the last supplied fileName */ std::string mFileName; --- 344,404 ---- void BuildPolygon(oxygen::IndexBuffer& ibuffer, TVertexList& vertexList, const ComplexGeom& geom); ! bool ReadPhysicalRep(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleBox(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleSphere(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! bool ReadSimpleCappedCylinder(boost::shared_ptr<oxygen::BaseNode> parent, TiXmlElement* element); ! ! void Attach(boost::shared_ptr<oxygen::Joint> joint, boost::shared_ptr<oxygen::Body> body1, boost::shared_ptr<oxygen::Body> body2, ! const JointAxis& axis1, const JointAxis& axis2 = JointAxis()); ! void AttachJoint(const JointAttach& ja); ! ! private: ! /** RosContextScope is a helper class that creates a new ! RosContext and destroys it when it goes ot ouf scope ! */ ! struct RosContextScope ! { ! public: ! RosContextScope(RosImporter* i) ! : importer(i) ! { ! importer->PushContext(); ! } ! ! ~RosContextScope() ! { ! importer->PopContext(); ! } ! ! protected: ! RosImporter* importer; ! }; ! ! /** RosJointScope is a helper class that creates a new joint scope ! and destroys it when it goes out of scope ! */ ! struct RosJointScope ! { ! RosJointScope(RosImporter* i) ! : importer(i) ! { ! importer->PushJointContext(); ! } ! ! ~RosJointScope() ! { ! importer->PopJointContext(); ! } ! ! protected: ! RosImporter* importer; ! }; protected: + /** reference to the parent node under wich the imported scene is + constructed + */ + boost::shared_ptr<oxygen::BaseNode> mSceneParent; + /** the last supplied fileName */ std::string mFileName; *************** *** 277,282 **** /** the static macro registry is shared across RosImporter instances ! */ static TMacroMap mMacroMap; }; --- 418,429 ---- /** the static macro registry is shared across RosImporter instances ! */ static TMacroMap mMacroMap; + + /** the stack of RosContext instances */ + TRosStack mStack; + + /* the stack of JointContext instances */ + TRosJointStack mJointStack; }; |