pybullet.getCameraImage: preparation to expose link index in segmentation mask buffer

This commit is contained in:
Erwin Coumans
2017-12-28 10:18:35 -08:00
parent 78e4d9675e
commit afd1066c50
7 changed files with 30 additions and 14 deletions

View File

@@ -2169,7 +2169,11 @@ void PhysicsServerExample::updateGraphics()
btVector4(32,255,255,255)};
if (segmentationMask>=0)
{
btVector4 rgb = palette[segmentationMask&3];
int obIndex = segmentationMask&(0x1e24-1);
int linkIndex = (segmentationMask>>24)-1;
btVector4 rgb = palette[(obIndex+linkIndex)&3];
m_canvas->setPixel(m_canvasSegMaskIndex,i,j,
rgb.x(),
rgb.y(),