revert accidently renaming of m_depthvalues4

This commit is contained in:
Erwin Coumans 2016-08-12 13:55:37 -07:00
parent 4abe083388
commit c75bebcafe
5 changed files with 6 additions and 6 deletions

View File

@ -736,7 +736,7 @@ void PhysicsClientExample::stepSimulation(float deltaTime)
if (m_canvasDepthIndex >=0) if (m_canvasDepthIndex >=0)
{ {
int depthPixelIndex = (xIndex+yIndex*imageData.m_pixelWidth); int depthPixelIndex = (xIndex+yIndex*imageData.m_pixelWidth);
float depthValue = imageData.m_depthValues4[depthPixelIndex]; float depthValue = imageData.m_depthValues[depthPixelIndex];
//todo: rescale the depthValue to [0..255] //todo: rescale the depthValue to [0..255]
if (depthValue>-1e20) if (depthValue>-1e20)
{ {
@ -770,7 +770,7 @@ void PhysicsClientExample::stepSimulation(float deltaTime)
if (m_canvasDepthIndex >=0) if (m_canvasDepthIndex >=0)
{ {
int depthPixelIndex = (xIndex+yIndex*imageData.m_pixelWidth); int depthPixelIndex = (xIndex+yIndex*imageData.m_pixelWidth);
float depthValue = imageData.m_depthValues4[depthPixelIndex]; float depthValue = imageData.m_depthValues[depthPixelIndex];
//todo: rescale the depthValue to [0..255] //todo: rescale the depthValue to [0..255]
if (depthValue>-1e20) if (depthValue>-1e20)
{ {

View File

@ -712,7 +712,7 @@ void PhysicsClientSharedMemory::getCachedCameraImage(struct b3CameraImageData* c
{ {
cameraData->m_pixelWidth = m_data->m_cachedCameraPixelsWidth; cameraData->m_pixelWidth = m_data->m_cachedCameraPixelsWidth;
cameraData->m_pixelHeight = m_data->m_cachedCameraPixelsHeight; cameraData->m_pixelHeight = m_data->m_cachedCameraPixelsHeight;
cameraData->m_depthValues4 = m_data->m_cachedCameraDepthBuffer.size() ? &m_data->m_cachedCameraDepthBuffer[0] : 0; cameraData->m_depthValues = m_data->m_cachedCameraDepthBuffer.size() ? &m_data->m_cachedCameraDepthBuffer[0] : 0;
cameraData->m_rgbColorData = m_data->m_cachedCameraPixelsRGBA.size() ? &m_data->m_cachedCameraPixelsRGBA[0] : 0; cameraData->m_rgbColorData = m_data->m_cachedCameraPixelsRGBA.size() ? &m_data->m_cachedCameraPixelsRGBA[0] : 0;
cameraData->m_segmentationMaskValues = m_data->m_cachedSegmentationMaskBuffer.size()?&m_data->m_cachedSegmentationMaskBuffer[0] : 0; cameraData->m_segmentationMaskValues = m_data->m_cachedSegmentationMaskBuffer.size()?&m_data->m_cachedSegmentationMaskBuffer[0] : 0;
} }

View File

@ -464,7 +464,7 @@ void PhysicsDirect::getCachedCameraImage(b3CameraImageData* cameraData)
{ {
cameraData->m_pixelWidth = m_data->m_cachedCameraPixelsWidth; cameraData->m_pixelWidth = m_data->m_cachedCameraPixelsWidth;
cameraData->m_pixelHeight = m_data->m_cachedCameraPixelsHeight; cameraData->m_pixelHeight = m_data->m_cachedCameraPixelsHeight;
cameraData->m_depthValues4 = m_data->m_cachedCameraDepthBuffer.size() ? &m_data->m_cachedCameraDepthBuffer[0] : 0; cameraData->m_depthValues = m_data->m_cachedCameraDepthBuffer.size() ? &m_data->m_cachedCameraDepthBuffer[0] : 0;
cameraData->m_rgbColorData = m_data->m_cachedCameraPixelsRGBA.size() ? &m_data->m_cachedCameraPixelsRGBA[0] : 0; cameraData->m_rgbColorData = m_data->m_cachedCameraPixelsRGBA.size() ? &m_data->m_cachedCameraPixelsRGBA[0] : 0;
cameraData->m_segmentationMaskValues = m_data->m_cachedSegmentationMask.size()? &m_data->m_cachedSegmentationMask[0] : 0; cameraData->m_segmentationMaskValues = m_data->m_cachedSegmentationMask.size()? &m_data->m_cachedSegmentationMask[0] : 0;
} }

View File

@ -122,7 +122,7 @@ struct b3CameraImageData
int m_pixelWidth; int m_pixelWidth;
int m_pixelHeight; int m_pixelHeight;
const unsigned char* m_rgbColorData;//3*m_pixelWidth*m_pixelHeight bytes const unsigned char* m_rgbColorData;//3*m_pixelWidth*m_pixelHeight bytes
const float* m_depthValues4;//m_pixelWidth*m_pixelHeight floats const float* m_depthValues;//m_pixelWidth*m_pixelHeight floats
const int* m_segmentationMaskValues;//m_pixelWidth*m_pixelHeight ints const int* m_segmentationMaskValues;//m_pixelWidth*m_pixelHeight ints
}; };

View File

@ -1231,7 +1231,7 @@ static PyObject* pybullet_renderImage(PyObject* self, PyObject* args)
// TODO(hellojas): validate depth values make sense // TODO(hellojas): validate depth values make sense
int depIndex = i+j*imageData.m_pixelWidth; int depIndex = i+j*imageData.m_pixelWidth;
{ {
item = PyFloat_FromDouble(imageData.m_depthValues4[depIndex]); item = PyFloat_FromDouble(imageData.m_depthValues[depIndex]);
PyTuple_SetItem(pylistDep, depIndex, item); PyTuple_SetItem(pylistDep, depIndex, item);
} }
{ {