Implement InMemoryFile for memory caching for fileIO plugin.

Support SDF loading through fileIO plugin.
Replace strcspn by C code (not crossplatform)
Add flag for loadURDF to use color from MTL file (instead from URDF link material)
pybullet.URDF_USE_MATERIAL_COLORS_FROM_MTL and pybullet.URDF_USE_MATERIAL_TRANSPARANCY_FROM_MTL
This commit is contained in:
erwincoumans
2018-10-14 12:54:34 -07:00
parent 3309ce8f6a
commit c1e20c448f
12 changed files with 511 additions and 66 deletions

View File

@@ -74,16 +74,8 @@ static bool UrdfFindMeshFile(
std::string existing_file;
{
std::string attempt = fn;
int f = fileIO->fileOpen(attempt.c_str(), "rb");
if (f>=0)
{
existing_file = attempt;
fileIO->fileClose(f);
}
}
if (existing_file.empty())
{
for (std::list<std::string>::iterator x = shorter.begin(); x != shorter.end(); ++x)
{
@@ -100,6 +92,16 @@ static bool UrdfFindMeshFile(
break;
}
}
if (existing_file.empty())
{
std::string attempt = fn;
int f = fileIO->fileOpen(attempt.c_str(), "rb");
if (f>=0)
{
existing_file = attempt;
fileIO->fileClose(f);
}
}
if (existing_file.empty())
{