diff options
author | erwincoumans <erwin.coumans@gmail.com> | 2015-05-04 17:22:46 -0700 |
---|---|---|
committer | erwincoumans <erwin.coumans@gmail.com> | 2015-05-04 17:22:46 -0700 |
commit | 80a21678705287952200e6ae4eaad941bccec4e0 (patch) | |
tree | c8e1df9e2107a3e973ba6fd24ac7638aad884f19 | |
parent | 0f567be5493e24d5b3c178d262f335dc98c4124b (diff) | |
parent | 3da8dbce1c0fb51ac8671aec5494a3a420983e30 (diff) | |
download | bullet3-80a21678705287952200e6ae4eaad941bccec4e0.tar.gz |
Merge pull request #369 from erwincoumans/master2.83
use wall-time delta time for examples, fix btDbvt (disable memmove)
5 files changed, 23 insertions, 21 deletions
diff --git a/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp b/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp index 42086312f..9ed77f16d 100644 --- a/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp +++ b/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp @@ -364,10 +364,10 @@ void GwenUserInterface::init(int width, int height,Gwen::Renderer::Base* rendere m_data->m_explorerTreeCtrl = ctrl; ctrl->SetKeyboardInputEnabled(true); ctrl->Focus(); - ctrl->SetBounds(2, 10, 236, 400); + ctrl->SetBounds(2, 10, 236, 300); m_data->m_exampleInfoGroupBox = new Gwen::Controls::Label( m_data->m_explorerPage->GetPage() ); - m_data->m_exampleInfoGroupBox->SetPos(2, 414); + m_data->m_exampleInfoGroupBox->SetPos(2, 314); m_data->m_exampleInfoGroupBox->SetHeight( 15 ); m_data->m_exampleInfoGroupBox->SetWidth(234); m_data->m_exampleInfoGroupBox->SetText("Example Description"); @@ -376,7 +376,7 @@ void GwenUserInterface::init(int width, int height,Gwen::Renderer::Base* rendere //m_data->m_exampleInfoTextOutput->Dock( Gwen::Pos::Bottom ); - m_data->m_exampleInfoTextOutput->SetPos(2, 432); + m_data->m_exampleInfoTextOutput->SetPos(2, 332); m_data->m_exampleInfoTextOutput->SetHeight( 150 ); m_data->m_exampleInfoTextOutput->SetWidth(233); diff --git a/examples/ExampleBrowser/main.cpp b/examples/ExampleBrowser/main.cpp index f1e103e76..4fff81689 100644 --- a/examples/ExampleBrowser/main.cpp +++ b/examples/ExampleBrowser/main.cpp @@ -12,22 +12,25 @@ #include "../Utils/b3Clock.h" #include "ExampleEntries.h" - +#include "Bullet3Common/b3Logging.h" int main(int argc, char* argv[]) { b3CommandLineArgs args(argc,argv); b3Clock clock; - + + ExampleEntries examples; examples.initExampleEntries(); ExampleBrowserInterface* exampleBrowser = new DefaultBrowser(&examples); bool init = exampleBrowser->init(argc,argv); + clock.reset(); if (init) { do { - float deltaTimeInSeconds = 1./120.f; + float deltaTimeInSeconds = clock.getTimeMicroseconds()/1000000.f; + clock.reset(); exampleBrowser->update(deltaTimeInSeconds); } while (!exampleBrowser->requestedExit()); diff --git a/examples/Importers/ImportURDFDemo/ImportURDFSetup.cpp b/examples/Importers/ImportURDFDemo/ImportURDFSetup.cpp index a9143fa86..06fb8bd79 100644 --- a/examples/Importers/ImportURDFDemo/ImportURDFSetup.cpp +++ b/examples/Importers/ImportURDFDemo/ImportURDFSetup.cpp @@ -291,4 +291,4 @@ class CommonExampleInterface* ImportURDFCreateFunc(struct CommonExampleOption { return new ImportUrdfSetup(options.m_guiHelper, options.m_option,options.m_fileName); -}
\ No newline at end of file +} diff --git a/examples/Importers/ImportURDFDemo/MyURDFImporter.cpp b/examples/Importers/ImportURDFDemo/MyURDFImporter.cpp index 737477ba7..76c8a13c2 100644 --- a/examples/Importers/ImportURDFDemo/MyURDFImporter.cpp +++ b/examples/Importers/ImportURDFDemo/MyURDFImporter.cpp @@ -66,7 +66,7 @@ struct MyURDFInternalData my_shared_ptr<ModelInterface> m_robot; std::vector<my_shared_ptr<Link> > m_links; struct GUIHelperInterface* m_guiHelper; - const char* m_pathPrefix; + char m_pathPrefix[1024]; }; @@ -89,7 +89,7 @@ MyURDFImporter::MyURDFImporter(struct GUIHelperInterface* helper) m_data = new MyURDFInternalData; m_data->m_robot = 0; m_data->m_guiHelper = helper; - m_data->m_pathPrefix=0; + m_data->m_pathPrefix[0]=0; @@ -107,9 +107,8 @@ bool MyURDFImporter::loadURDF(const char* fileName) bool fileFound = fu.findFile(fileName, relativeFileName, 1024); std::string xml_string; - char pathPrefix[1024]; - pathPrefix[0] = 0; - + m_data->m_pathPrefix[0] = 0; + if (!fileFound){ std::cerr << "URDF file not found" << std::endl; return false; @@ -117,7 +116,7 @@ bool MyURDFImporter::loadURDF(const char* fileName) { int maxPathLen = 1024; - fu.extractPath(relativeFileName,pathPrefix,maxPathLen); + fu.extractPath(relativeFileName,m_data->m_pathPrefix,maxPathLen); std::fstream xml_file(relativeFileName, std::fstream::in); diff --git a/src/BulletCollision/BroadphaseCollision/btDbvt.h b/src/BulletCollision/BroadphaseCollision/btDbvt.h index f578aae01..e05e1de27 100644 --- a/src/BulletCollision/BroadphaseCollision/btDbvt.h +++ b/src/BulletCollision/BroadphaseCollision/btDbvt.h @@ -1196,23 +1196,23 @@ inline void btDbvt::collideOCL( const btDbvtNode* root, //void * memmove ( void * destination, const void * source, size_t num ); -#if DBVT_USE_MEMMOVE - memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); -#else +//#if DBVT_USE_MEMMOVE +// memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); +//#else for(int k=stack.size()-1;k>j;--k) { stack[k]=stack[k-1]; } -#endif +//#endif stack[j]=allocate(ifree,stock,nes[q]); /* Insert 1 */ j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size()); stack.push_back(0); -#if DBVT_USE_MEMMOVE - memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); -#else +//#if DBVT_USE_MEMMOVE +// memmove(&stack[j],&stack[j-1],sizeof(int)*(stack.size()-j-1)); +//#else for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1]; -#endif +//#endif stack[j]=allocate(ifree,stock,nes[1-q]); } else |