From 2e7c0cef38b751a3ca1d82efc75251b1e2806e33 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Thu, 14 Sep 2017 15:39:22 -0700 Subject: [PATCH] pybullet/C-API: fix width/height when getCameraImage has a fallback from OpenGL hardware to TinyRenderer --- .../PhysicsServerCommandProcessor.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp index db318f056..1a1b13275 100644 --- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp +++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp @@ -3477,21 +3477,12 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm - if ((clientCmd.m_updateFlags & ER_BULLET_HARDWARE_OPENGL)!=0) - { - //m_data->m_guiHelper->copyCameraImageData(clientCmd.m_requestPixelDataArguments.m_viewMatrix,clientCmd.m_requestPixelDataArguments.m_projectionMatrix,0,0,0,0,0,width,height,0); - } - else - { - if ((clientCmd.m_requestPixelDataArguments.m_startPixelIndex==0) && + if ((clientCmd.m_requestPixelDataArguments.m_startPixelIndex==0) && (clientCmd.m_updateFlags & REQUEST_PIXEL_ARGS_SET_PIXEL_WIDTH_HEIGHT)!=0) - { + { m_data->m_visualConverter.setWidthAndHeight(clientCmd.m_requestPixelDataArguments.m_pixelWidth, clientCmd.m_requestPixelDataArguments.m_pixelHeight); - } - m_data->m_visualConverter.getWidthAndHeight(width,height); - } - + } int numTotalPixels = width*height;