From 030d723db6a386e97471ff59685130e43f165045 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 1 Jun 2017 16:48:07 -0700 Subject: [PATCH] fix some warnings --- .../OpenGLWindow/GLInstancingRenderer.cpp | 48 +++++++++---------- examples/OpenGLWindow/GLInstancingRenderer.h | 4 +- .../PhysicsServerCommandProcessor.h | 6 +-- .../SharedMemory/PhysicsServerSharedMemory.h | 4 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/OpenGLWindow/GLInstancingRenderer.cpp b/examples/OpenGLWindow/GLInstancingRenderer.cpp index 5a5cca73d..b73b9c823 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.cpp +++ b/examples/OpenGLWindow/GLInstancingRenderer.cpp @@ -413,10 +413,10 @@ bool GLInstancingRenderer::readSingleInstanceTransformToCPU(float* position, flo return false; } -void GLInstancingRenderer::writeSingleInstanceTransformToCPU(const float* position, const float* orientation, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceTransformToCPU(const float* position, const float* orientation, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); if (pg==0) @@ -439,9 +439,9 @@ void GLInstancingRenderer::writeSingleInstanceTransformToCPU(const float* positi } -void GLInstancingRenderer::readSingleInstanceTransformFromCPU(int bodyUniqueId, float* position, float* orientation) +void GLInstancingRenderer::readSingleInstanceTransformFromCPU(int srcIndex2, float* position, float* orientation) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -457,9 +457,9 @@ void GLInstancingRenderer::readSingleInstanceTransformFromCPU(int bodyUniqueId, orientation[2] = m_data->m_instance_quaternion_ptr[srcIndex*4+2]; orientation[3] = m_data->m_instance_quaternion_ptr[srcIndex*4+3]; } -void GLInstancingRenderer::writeSingleInstanceColorToCPU(const double* color, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceColorToCPU(const double* color, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -469,9 +469,9 @@ void GLInstancingRenderer::writeSingleInstanceColorToCPU(const double* color, in m_data->m_instance_colors_ptr[srcIndex*4+3]=float(color[3]); } -void GLInstancingRenderer::writeSingleInstanceColorToCPU(const float* color, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceColorToCPU(const float* color, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -481,9 +481,9 @@ void GLInstancingRenderer::writeSingleInstanceColorToCPU(const float* color, int m_data->m_instance_colors_ptr[srcIndex*4+3]=color[3]; } -void GLInstancingRenderer::writeSingleInstanceScaleToCPU(const float* scale, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceScaleToCPU(const float* scale, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -492,11 +492,11 @@ void GLInstancingRenderer::writeSingleInstanceScaleToCPU(const float* scale, int m_data->m_instance_scale_ptr[srcIndex*3+2]=scale[2]; } -void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const double* specular, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); - int srcIndex = pg->m_internalInstanceIndex; + int graphicsIndex = pg->m_internalInstanceIndex; int totalNumInstances = 0; @@ -505,7 +505,7 @@ void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const double* s for (int i=0;im_numGraphicsInstances; - if (srcIndexm_materialSpecularColor[2] = specular[2]; } } -void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const float* specular, int bodyUniqueId) +void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex2) { - b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -531,7 +531,7 @@ void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const float* sp for (int i=0;im_numGraphicsInstances; - if (srcIndexm_publicGraphicsInstances.getHandle(bodyUniqueId); + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -765,8 +765,8 @@ void GLInstancingRenderer::rebuildGraphicsInstances() for (int i=0;im_publicGraphicsInstances.getHandle(bodyUniqueId); + int srcIndex2 = usedObjects[i]; + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); b3Assert(pg); int srcIndex = pg->m_internalInstanceIndex; @@ -793,9 +793,9 @@ void GLInstancingRenderer::rebuildGraphicsInstances() } for (int i=0;im_publicGraphicsInstances.getHandle(bodyUniqueId); - m_graphicsInstances[pg->m_shapeIndex]->m_tempObjectUids.push_back(bodyUniqueId); + int srcIndex2 = usedObjects[i]; + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); + m_graphicsInstances[pg->m_shapeIndex]->m_tempObjectUids.push_back(srcIndex2); } int curOffset = 0; diff --git a/examples/OpenGLWindow/GLInstancingRenderer.h b/examples/OpenGLWindow/GLInstancingRenderer.h index 3233c32cf..3716b32a6 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.h +++ b/examples/OpenGLWindow/GLInstancingRenderer.h @@ -103,8 +103,8 @@ public: virtual void writeSingleInstanceColorToCPU(const float* color, int srcIndex); virtual void writeSingleInstanceColorToCPU(const double* color, int srcIndex); - virtual void writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex); - virtual void writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex); + virtual void writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex2); + virtual void writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex2); virtual void writeSingleInstanceScaleToCPU(const float* scale, int srcIndex); virtual void writeSingleInstanceScaleToCPU(const double* scale, int srcIndex); diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.h b/examples/SharedMemory/PhysicsServerCommandProcessor.h index 2280242e6..2108477f2 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.h +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.h @@ -94,7 +94,7 @@ public: void logObjectStates(btScalar timeStep); void processCollisionForces(btScalar timeStep); - virtual void stepSimulationRealTime(double dtInSec, const struct b3VRControllerEvent* vrEvents, int numVREvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents); + virtual void stepSimulationRealTime(double dtInSec, const struct b3VRControllerEvent* vrControllerEvents, int numVRControllerEvents, const struct b3KeyboardEvent* keyEvents, int numKeyEvents); virtual void enableRealTimeSimulation(bool enableRealTimeSim); virtual bool isRealTimeSimulationEnabled() const; @@ -103,10 +103,10 @@ public: virtual void setTimeOut(double timeOutInSeconds); virtual const btVector3& getVRTeleportPosition() const; - virtual void setVRTeleportPosition(const btVector3& vrReleportPos); + virtual void setVRTeleportPosition(const btVector3& vrTeleportPos); virtual const btQuaternion& getVRTeleportOrientation() const; - virtual void setVRTeleportOrientation(const btQuaternion& vrReleportOrn); + virtual void setVRTeleportOrientation(const btQuaternion& vrTeleportOrn); }; #endif //PHYSICS_SERVER_COMMAND_PROCESSOR_H diff --git a/examples/SharedMemory/PhysicsServerSharedMemory.h b/examples/SharedMemory/PhysicsServerSharedMemory.h index 0fcd534b4..b53df5537 100644 --- a/examples/SharedMemory/PhysicsServerSharedMemory.h +++ b/examples/SharedMemory/PhysicsServerSharedMemory.h @@ -41,10 +41,10 @@ public: virtual void removePickingConstraint(); virtual const btVector3& getVRTeleportPosition() const; - virtual void setVRTeleportPosition(const btVector3& vrReleportPos); + virtual void setVRTeleportPosition(const btVector3& vrTeleportPos); virtual const btQuaternion& getVRTeleportOrientation() const; - virtual void setVRTeleportOrientation(const btQuaternion& vrReleportOrn); + virtual void setVRTeleportOrientation(const btQuaternion& vrTeleportOrn);