From 2e7949bb3e898a1dfc9bc81b1103dc0a70a888ab Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Wed, 26 Aug 2015 15:26:53 -0700 Subject: [PATCH] fix some warnings --- .../GwenGUISupport/gwenUserInterface.cpp | 1 - examples/SharedMemory/PhysicsClient.cpp | 14 ++++++-------- examples/SharedMemory/PhysicsServer.cpp | 5 ++++- examples/SharedMemory/SharedMemoryBlock.h | 2 +- examples/SharedMemory/SharedMemoryCommands.h | 1 - examples/SimpleOpenGL3/main.cpp | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp b/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp index 678bae4cc..4f8ef5dd0 100644 --- a/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp +++ b/examples/ExampleBrowser/GwenGUISupport/gwenUserInterface.cpp @@ -589,7 +589,6 @@ bool GwenUserInterface::keyboardCallback(int bulletKey, int state) } }; - bool bDown = (state == 1); if (gwenKey>=0) { diff --git a/examples/SharedMemory/PhysicsClient.cpp b/examples/SharedMemory/PhysicsClient.cpp index b9be5dfdf..e33d1dbc6 100644 --- a/examples/SharedMemory/PhysicsClient.cpp +++ b/examples/SharedMemory/PhysicsClient.cpp @@ -29,7 +29,6 @@ struct PhysicsClientSharedMemoryInternalData btAlignedObjectArray m_debugLinesTo; btAlignedObjectArray m_debugLinesColor; - int m_counter; bool m_serverLoadUrdfOK; bool m_isConnected; @@ -218,11 +217,10 @@ bool PhysicsClientSharedMemory::processServerStatus(SharedMemoryStatus& serverSt { { b3JointInfo info; - info.m_flags = 0; - info.m_qIndex = qOffset; - info.m_uIndex = uOffset; - info.m_linkIndex = link; - + info.m_flags = 0; + info.m_qIndex = (0 < mb->m_links[link].m_posVarCount) ? qOffset : -1; + info.m_uIndex = (0 < mb->m_links[link].m_dofCount) ? uOffset : -1; + if (mb->m_links[link].m_linkName) { if (m_data->m_verboseOutput) @@ -267,8 +265,8 @@ bool PhysicsClientSharedMemory::processServerStatus(SharedMemoryStatus& serverSt { b3JointInfo info; info.m_flags = 0; - info.m_qIndex = qOffset; - info.m_uIndex = uOffset; + info.m_qIndex = (0 < mb->m_links[link].m_posVarCount) ? qOffset : -1; + info.m_uIndex = (0 < mb->m_links[link].m_dofCount) ? uOffset : -1; if (mb->m_links[link].m_linkName) { diff --git a/examples/SharedMemory/PhysicsServer.cpp b/examples/SharedMemory/PhysicsServer.cpp index 2ebca4f81..4b6a0ad08 100644 --- a/examples/SharedMemory/PhysicsServer.cpp +++ b/examples/SharedMemory/PhysicsServer.cpp @@ -975,6 +975,10 @@ void PhysicsServerSharedMemory::processClientCommands() case CMD_SEND_PHYSICS_SIMULATION_PARAMETERS: { + if (clientCmd.m_updateFlags&SIM_PARAM_UPDATE_DELTA_TIME) + { + m_data->m_physicsDeltaTime = clientCmd.m_physSimParamArgs.m_deltaTime; + } if (clientCmd.m_updateFlags&SIM_PARAM_UPDATE_GRAVITY) { btVector3 grav(clientCmd.m_physSimParamArgs.m_gravityAcceleration[0], @@ -1010,7 +1014,6 @@ void PhysicsServerSharedMemory::processClientCommands() } - case CMD_RESET_SIMULATION: { //clean up all data diff --git a/examples/SharedMemory/SharedMemoryBlock.h b/examples/SharedMemory/SharedMemoryBlock.h index f922a4f26..b3d2709d0 100644 --- a/examples/SharedMemory/SharedMemoryBlock.h +++ b/examples/SharedMemory/SharedMemoryBlock.h @@ -30,7 +30,7 @@ struct SharedMemoryBlock }; -static void InitSharedMemoryBlock(struct SharedMemoryBlock* sharedMemoryBlock) +inline void InitSharedMemoryBlock(struct SharedMemoryBlock* sharedMemoryBlock) { sharedMemoryBlock->m_numClientCommands = 0; sharedMemoryBlock->m_numServerCommands = 0; diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h index 52af0ca8a..6f5c6fd3e 100644 --- a/examples/SharedMemory/SharedMemoryCommands.h +++ b/examples/SharedMemory/SharedMemoryCommands.h @@ -287,7 +287,6 @@ struct b3JointInfo int m_jointType; int m_qIndex; int m_uIndex; - int m_linkIndex; /// int m_flags; }; diff --git a/examples/SimpleOpenGL3/main.cpp b/examples/SimpleOpenGL3/main.cpp index 1dc80f31b..68dc00366 100644 --- a/examples/SimpleOpenGL3/main.cpp +++ b/examples/SimpleOpenGL3/main.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) b3CommandLineArgs myArgs(argc,argv); - SimpleOpenGL3App* app = new SimpleOpenGL3App("SimpleOpenGL3App",1024,768); + SimpleOpenGL3App* app = new SimpleOpenGL3App("SimpleOpenGL3App",1024,768,true); app->m_instancingRenderer->getActiveCamera()->setCameraDistance(13); app->m_instancingRenderer->getActiveCamera()->setCameraPitch(0); app->m_instancingRenderer->getActiveCamera()->setCameraTargetPosition(0,0,0);