From 0fe6d343bcab964d9fe0c4e7e7196664a148ed43 Mon Sep 17 00:00:00 2001 From: erwin coumans Date: Thu, 23 Jul 2015 10:51:09 -0700 Subject: [PATCH] move m_updateFlags to command, and make it 64bit --- examples/SharedMemory/PhysicsServer.cpp | 2 +- examples/SharedMemory/RobotControlExample.cpp | 2 +- examples/SharedMemory/SharedMemoryCommands.h | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/SharedMemory/PhysicsServer.cpp b/examples/SharedMemory/PhysicsServer.cpp index 7f6c77bb9..7614a7632 100644 --- a/examples/SharedMemory/PhysicsServer.cpp +++ b/examples/SharedMemory/PhysicsServer.cpp @@ -563,7 +563,7 @@ void PhysicsServerSharedMemory::processClientCommands() case CMD_SEND_PHYSICS_SIMULATION_PARAMETERS: { - if (clientCmd.m_physSimParamArgs.m_updateFlags&SIM_PARAM_UPDATE_GRAVITY) + if (clientCmd.m_updateFlags&SIM_PARAM_UPDATE_GRAVITY) { btVector3 grav(clientCmd.m_physSimParamArgs.m_gravityAcceleration[0], clientCmd.m_physSimParamArgs.m_gravityAcceleration[1], diff --git a/examples/SharedMemory/RobotControlExample.cpp b/examples/SharedMemory/RobotControlExample.cpp index 73d757816..418972fba 100644 --- a/examples/SharedMemory/RobotControlExample.cpp +++ b/examples/SharedMemory/RobotControlExample.cpp @@ -104,7 +104,7 @@ void MyCallback2(int buttonId, bool buttonState, void* userPtr) command.m_physSimParamArgs.m_gravityAcceleration[0] = 0; command.m_physSimParamArgs.m_gravityAcceleration[1] = 0; command.m_physSimParamArgs.m_gravityAcceleration[2] = -10; - command.m_physSimParamArgs.m_updateFlags = SIM_PARAM_UPDATE_GRAVITY; + command.m_updateFlags = SIM_PARAM_UPDATE_GRAVITY; cl->enqueueCommand(command); break; diff --git a/examples/SharedMemory/SharedMemoryCommands.h b/examples/SharedMemory/SharedMemoryCommands.h index a2921e69c..2c7dd04e4 100644 --- a/examples/SharedMemory/SharedMemoryCommands.h +++ b/examples/SharedMemory/SharedMemoryCommands.h @@ -132,9 +132,6 @@ enum EnumUpdateFlags ///The control mode determines the state variables used for motor control. struct SendPhysicsSimulationParameters { - //a bit fields to tell which parameters need updating, see SIM_PARAM_UPDATE_DELTA_TIME etc. - //for example m_updateFlags = SIM_PARAM_UPDATE_DELTA_TIME | SIM_PARAM_UPDATE_NUM_SOLVER_ITERATIONS; - int m_updateFlags; double m_deltaTime; double m_gravityAcceleration[3]; @@ -169,9 +166,11 @@ struct SendActualStateArgs struct SharedMemoryCommand { int m_type; - - smUint64_t m_timeStamp; int m_sequenceNumber; + smUint64_t m_timeStamp; + //a bit fields to tell which parameters need updating + //for example m_updateFlags = SIM_PARAM_UPDATE_DELTA_TIME | SIM_PARAM_UPDATE_NUM_SOLVER_ITERATIONS; + smUint64_t m_updateFlags; union {