Add mj_containsFileVFS and mj_containsBufferVFS functions.

PiperOrigin-RevId: 903785790
Change-Id: I013b37a177284f8440179c4ae5c6221e0f572b49
This commit is contained in:
Sam Haves
2026-04-22 05:26:33 -07:00
committed by Copybara-Service
parent c3fddf5dc1
commit 4cfebcc32b
10 changed files with 156 additions and 0 deletions
+18
View File
@@ -1519,6 +1519,24 @@ Add file to VFS from buffer; return 0: success, 2: repeated name, -1: failed to
Delete file from VFS; return 0: success, -1: not found in VFS.
.. _mj_containsBufferVFS:
`mj_containsBufferVFS <#mj_containsBufferVFS>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. mujoco-include:: mj_containsBufferVFS
Check if buffer exists in VFS; return 1: exists, 0: not found.
.. _mj_containsFileVFS:
`mj_containsFileVFS <#mj_containsFileVFS>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. mujoco-include:: mj_containsFileVFS
Check if file exists in VFS; return 1: exists, 0: not found.
.. _mj_deleteVFS:
`mj_deleteVFS <#mj_deleteVFS>`__
+1
View File
@@ -9,6 +9,7 @@ General
^^^^^^^
- Added new :ref:`mj_maxContact<mj_maxContact>` function to get the maximum number of possible contacts returned by
two geoms.
- Added ``mj_containsBufferVFS`` and ``mj_containsFileVFS`` to check for existence of buffers and files in VFS.
- Added :ref:`multi-cell support<body-flexcomp-cellnum>` for trilinear and quadratic flexes. Note that the implicit
integrator uses a dense solver for the flex degrees of freedom, which can be slow for multi-cell flexes.
- Refactored ``flexstrain`` equality constraints to be instantiated per cell instead of per flex object, reducing the
+2
View File
@@ -3161,6 +3161,8 @@ int mj_unmountVFS(mjVFS* vfs, const char* filename);
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);
int mj_containsBufferVFS(mjVFS* vfs, const char* name);
int mj_containsFileVFS(mjVFS* vfs, const char* directory, const char* filename);
void mj_deleteVFS(mjVFS* vfs);
size_t mj_getCacheSize(const mjCache* cache);
size_t mj_getCacheCapacity(const mjCache* cache);