Support directories in VFS via mj_addBufferVFS.

PiperOrigin-RevId: 655286683
Change-Id: I846376a0571d8df28d979beb5981a0cbccd7a04f
This commit is contained in:
Kyle Bayes
2024-07-23 13:38:28 -07:00
committed by Copybara-Service
parent 2746cb8559
commit 5ac5cfb618
18 changed files with 197 additions and 156 deletions
+4 -4
View File
@@ -402,8 +402,8 @@ void mjCMesh::Compile(const mjVFS* vfs) {
throw mjCError(this, "unsupported content type: '%s'", asset_type.c_str());
}
std::string filename = mjuu_combinePaths(model->modelfiledir_, model->meshdir_, file_);
mjResource* resource = LoadResource(filename, vfs);
std::string filename = mjuu_combinePaths(model->meshdir_, file_);
mjResource* resource = LoadResource(model->modelfiledir_, filename, vfs);
try {
if (asset_type == "model/stl") {
@@ -2095,8 +2095,8 @@ void mjCSkin::Compile(const mjVFS* vfs) {
throw mjCError(this, "Unknown skin file type: %s", file_.c_str());
}
std::string filename = mjuu_combinePaths(model->modelfiledir_, model->meshdir_, file_);
mjResource* resource = LoadResource(filename, vfs);
std::string filename = mjuu_combinePaths(model->meshdir_, file_);
mjResource* resource = LoadResource(model->modelfiledir_, filename, vfs);
try {
LoadSKN(resource);