Expose minimal asset cache API.

PiperOrigin-RevId: 803126923
Change-Id: Iabf63802572f7cb86864b5ece85f44b3f15a4ec0
This commit is contained in:
Kyle Bayes
2025-09-04 12:17:47 -07:00
committed by Copybara-Service
parent 02a535b44f
commit ea660f4c13
15 changed files with 223 additions and 29 deletions
+9
View File
@@ -789,6 +789,10 @@ struct mjLROpt_ { // options for mj_setLengthRange()
mjtNum tolrange; // convergence tolerance (relative to range)
};
typedef struct mjLROpt_ mjLROpt;
struct mjCache_ { // asset cache used by the compiler
void* impl_; // internal pointer to cache
};
typedef struct mjCache_ mjCache;
struct mjVFS_ { // virtual file system for loading from memory
void* impl_; // internal pointer to VFS memory
};
@@ -2999,6 +3003,11 @@ int mj_addFileVFS(mjVFS* vfs, const char* directory, const char* filename);
int mj_addBufferVFS(mjVFS* vfs, const char* name, const void* buffer, int nbuffer);
int mj_deleteFileVFS(mjVFS* vfs, const char* filename);
void mj_deleteVFS(mjVFS* vfs);
size_t mj_getCacheSize(const mjCache* cache);
size_t mj_getCacheCapacity(const mjCache* cache);
size_t mj_setCacheCapacity(mjCache* cache, size_t size);
mjCache* mj_getCache(void);
void mj_clearCache(mjCache* cache);
mjModel* mj_loadXML(const char* filename, const mjVFS* vfs, char* error, int error_sz);
mjSpec* mj_parseXML(const char* filename, const mjVFS* vfs, char* error, int error_sz);
mjSpec* mj_parseXMLString(const char* xml, const mjVFS* vfs, char* error, int error_sz);