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
+20
View File
@@ -5075,6 +5075,11 @@ public unsafe struct mjLROpt_ {
public double tolrange;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct mjCache_ {
public void* impl_;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct _mjVFS
{
@@ -6334,6 +6339,21 @@ public static unsafe extern int mj_deleteFileVFS(void* vfs, [MarshalAs(Unmanaged
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern void mj_deleteVFS(void* vfs);
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern UIntPtr mj_getCacheSize(mjCache_* cache);
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern UIntPtr mj_getCacheCapacity(mjCache_* cache);
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern UIntPtr mj_setCacheCapacity(mjCache_* cache, UIntPtr size);
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern mjCache_* mj_getCache();
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern void mj_clearCache(mjCache_* cache);
[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)]
public static unsafe extern mjModel_* mj_loadXML([MarshalAs(UnmanagedType.LPStr)]string filename, void* vfs, StringBuilder error, int error_sz);