Merge pull request #2421 from erwincoumans/master

fix use of uninitialized variable
This commit is contained in:
erwincoumans
2019-09-27 17:15:41 -07:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

View File

@@ -7999,10 +7999,12 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar
} }
const std::string& error_message_prefix = ""; const std::string& error_message_prefix = "";
std::string out_found_filename; std::string out_found_filename;
int out_type; int out_type=0;
bool foundFile = UrdfFindMeshFile(fileIO, pathPrefix, relativeFileName, error_message_prefix, &out_found_filename, &out_type); bool foundFile = UrdfFindMeshFile(fileIO, pathPrefix, relativeFileName, error_message_prefix, &out_found_filename, &out_type);
btSoftBody* psb = NULL; btSoftBody* psb = NULL;
if (foundFile)
{
btScalar spring_elastic_stiffness, spring_damping_stiffness; btScalar spring_elastic_stiffness, spring_damping_stiffness;
if (out_type == UrdfGeometry::FILE_OBJ) if (out_type == UrdfGeometry::FILE_OBJ)
{ {
@@ -8063,6 +8065,7 @@ bool PhysicsServerCommandProcessor::processLoadSoftBodyCommand(const struct Shar
m_data->m_dynamicsWorld->addForce(psb, new btDeformableMassSpringForce(spring_elastic_stiffness, spring_damping_stiffness, true)); m_data->m_dynamicsWorld->addForce(psb, new btDeformableMassSpringForce(spring_elastic_stiffness, spring_damping_stiffness, true));
} }
#endif #endif
}
} }
if (psb != NULL) if (psb != NULL)
{ {

View File

@@ -216,7 +216,7 @@ struct EGLRendererVisualShapeConverterInternalData
ci.m_title = "PyBullet"; ci.m_title = "PyBullet";
ci.m_width = m_swWidth; ci.m_width = m_swWidth;
ci.m_height = m_swHeight; ci.m_height = m_swHeight;
ci.m_renderDevice = 0; ci.m_renderDevice = -1;
m_window->createWindow(ci); m_window->createWindow(ci);
m_window->setWindowTitle(ci.m_title); m_window->setWindowTitle(ci.m_title);
@@ -1573,7 +1573,7 @@ void EGLRendererVisualShapeConverter::removeVisualShape(int collisionObjectUniqu
void EGLRendererVisualShapeConverter::resetAll() void EGLRendererVisualShapeConverter::resetAll()
{ {
m_data->m_cachedTextureIds.clear(); m_data->m_cachedTextureIds.clear();
for (int i = 0; i < m_data->m_swRenderInstances.size(); i++) for (int i = 0; i < m_data->m_swRenderInstances.size(); i++)
{ {
EGLRendererObjectArray** ptrptr = m_data->m_swRenderInstances.getAtIndex(i); EGLRendererObjectArray** ptrptr = m_data->m_swRenderInstances.getAtIndex(i);
@@ -1600,6 +1600,7 @@ void EGLRendererVisualShapeConverter::resetAll()
m_data->m_visualShapes.clear(); m_data->m_visualShapes.clear();
m_data->m_graphicsIndexToSegmentationMask.clear(); m_data->m_graphicsIndexToSegmentationMask.clear();
m_data->m_instancingRenderer->removeAllInstances(); m_data->m_instancingRenderer->removeAllInstances();
m_data->m_cachedVisualShapes.clear();
} }
void EGLRendererVisualShapeConverter::changeShapeTexture(int objectUniqueId, int jointIndex, int shapeIndex, int textureUniqueId) void EGLRendererVisualShapeConverter::changeShapeTexture(int objectUniqueId, int jointIndex, int shapeIndex, int textureUniqueId)