implement specular, URDF non-standard specular part (see sphere2.urdf) and SDF specular support.

pybullet.changeVisualShape(obUid,linkIndex,specularColor=[R,G,B]) and Bullet C-API b3UpdateVisualShapeSpecularColor
Bug fixes in b3ResourcePath::findResourcePath resolution.
add stadium.sdf and roboschool/models_outdoor/stadium assets https://github.com/openai/roboschool/tree/master/roboschool/models_outdoor/stadium
minor fixes to obj2sdf
This commit is contained in:
Erwin Coumans
2017-06-01 12:32:44 -07:00
parent 439e8c84cf
commit 87293e835c
36 changed files with 78766 additions and 87 deletions

View File

@@ -492,6 +492,60 @@ 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)
{
b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId);
b3Assert(pg);
int srcIndex = pg->m_internalInstanceIndex;
int totalNumInstances = 0;
int gfxObjIndex = -1;
for (int i=0;i<m_graphicsInstances.size();i++)
{
totalNumInstances+=m_graphicsInstances[i]->m_numGraphicsInstances;
if (srcIndex<totalNumInstances)
{
gfxObjIndex = i;
break;
}
}
if (gfxObjIndex>0)
{
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[0] = specular[0];
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[1] = specular[1];
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[2] = specular[2];
}
}
void GLInstancingRenderer::writeSingleInstanceSpecularColorToCPU(const float* specular, int bodyUniqueId)
{
b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId);
b3Assert(pg);
int srcIndex = pg->m_internalInstanceIndex;
int totalNumInstances = 0;
int gfxObjIndex = -1;
for (int i=0;i<m_graphicsInstances.size();i++)
{
totalNumInstances+=m_graphicsInstances[i]->m_numGraphicsInstances;
if (srcIndex<totalNumInstances)
{
gfxObjIndex = i;
break;
}
}
if (gfxObjIndex>0)
{
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[0] = specular[0];
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[1] = specular[1];
m_graphicsInstances[gfxObjIndex]->m_materialSpecularColor[2] = specular[2];
}
}
void GLInstancingRenderer::writeSingleInstanceScaleToCPU(const double* scale, int bodyUniqueId)
{
b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(bodyUniqueId);