Remove mj_makeEmptyFileVFS and mj_findFileVFS from MuJoCo API.

PiperOrigin-RevId: 645393666
Change-Id: Iabe939c88f60b80dce20f84c7ff9a6396717cc84
This commit is contained in:
Kyle Bayes
2024-06-21 08:11:48 -07:00
committed by Copybara-Service
parent 14fe527ea2
commit e66b9a36b2
9 changed files with 32 additions and 117 deletions
-12
View File
@@ -59,20 +59,8 @@ public sealed class MjVfs : IDisposable {
}
}
// Searches the VFS for the specified file and returns its index.
// The index then can be used to retrieve the file contents from Data.filedata array.
public unsafe int FindFile(string filename) {
return mj_findFileVFS(_unmanagedVfs.ToPointer(), filename);
}
// Loads a model from the specified file.
// The file is assumed to be located in the filesystem. If it's not found, the method will throw
// an ArgumentException.
public unsafe MujocoLib.mjModel_* LoadXML(string filename) {
if (FindFile(filename) < 0) {
throw new ArgumentException($"File {filename} was not added to the VFS.");
}
var errorBuf = new StringBuilder(1024);
MujocoLib.mjModel_* model = MujocoLib.mj_loadXML(
filename, _unmanagedVfs.ToPointer(), errorBuf, errorBuf.Capacity);