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

@@ -149,7 +149,14 @@ struct b3BulletDefaultFileIO : public CommonFileIOInterface
if (f)
{
char* txt = ::fgets(destBuffer, numBytes, m_fileHandles[fileHandle]);
destBuffer[strcspn(destBuffer, "\r\n")] = 0;
for (int i=0;i<numBytes;i++)
{
if (destBuffer[i]=='\r'||destBuffer[i]=='\n' || destBuffer[i]==0)
{
destBuffer[i] = 0;
break;
}
}
return txt;
}
}