fix use of uninitialized variable

This commit is contained in:
Erwin Coumans
2019-09-25 13:49:11 -07:00
parent 2e5455def1
commit 391411b660

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)
{ {