diff --git a/doc/APIreference/APItypes.rst b/doc/APIreference/APItypes.rst index d8ff40ad..de6d59ed 100644 --- a/doc/APIreference/APItypes.rst +++ b/doc/APIreference/APItypes.rst @@ -1174,6 +1174,20 @@ mjfGetResourceDir This callback is for returning the directory of a resource, by setting dir to the directory string with ndir being size of directory string. +.. _mjfResourceModified: + +mjfResourceModified +~~~~~~~~~~~~~~~~~~~ + +.. code-block:: C + + typedef int (*mjfResourceModified)(const mjResource* resource); + +This callback is for checking if a resource was modified since it was last read. +Returns positive value if the resource was modified since last open, 0 if resource was not modified, +and negative value if inconclusive. + + .. _tyNotes: Notes diff --git a/doc/changelog.rst b/doc/changelog.rst index 068db417..d166090e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -28,7 +28,8 @@ New features - Added new SDF plugin for defining implicit geometries. The plugin must define methods computing an SDF and its gradient at query points See the :ref:`documentation` for more details. -3. Added :ref:`mjThreadPool` and :ref:`mjTask` which allow for multi-threaded operations within MuJoCo engine pipeline. +3. Added :ref:`mjThreadPool` and :ref:`mjTask` which allow for multi-threaded operations within the MuJoCo engine + pipeline. General ^^^^^^^ @@ -36,23 +37,16 @@ General .. admonition:: Breaking API changes :class: attention - 4. Removed macros ``mjMARKSTACK`` and ``mjFREESTACK``. + 4. Removed the macros ``mjMARKSTACK`` and ``mjFREESTACK``. - .. admonition:: Migration note - :class: note - - These macros have been replaced by new functions :ref:`mj_markStack` and :ref:`mj_freeStack`. These functions - manages ``mjData`` stack frames in a fully encapsulated way (i.e. without having to introduce a local variable - at the call site). + **Migration:** These macros have been replaced by new functions :ref:`mj_markStack` and + :ref:`mj_freeStack`. These functions manage the :ref:`mjData stack` in a fully encapsulated way (i.e., + without introducing a local variable at the call site). 5. Changed the function :ref:`mj_stackAlloc` to allocate an arbitrary number of bytes, rather than in multiples of - ``sizeof(mjtNum)``, and add an additional argument for specifying the alignment of the returned pointer. + ``sizeof(mjtNum)``, and added an additional argument for specifying the alignment of the returned pointer. - .. admonition:: Migration note - :class: note - - The old functionality for allocating ``mjtNum`` arrays is still available through a new function - :ref:`mj_stackAllocNum`. + **Migration:** The functionality for allocating ``mjtNum`` arrays is available via :ref:`mj_stackAllocNum`. 6. Renamed the ``nstack`` field in :ref:`mjModel` and :ref:`mjData` to ``narena``. Changed ``narena``, ``pstack``, and ``maxuse_stack`` to count number of bytes rather than number of :ref:`mjtNum` |-| s. diff --git a/doc/programming/extension.rst b/doc/programming/extension.rst index 7ab8f7e2..2ab381ae 100644 --- a/doc/programming/extension.rst +++ b/doc/programming/extension.rst @@ -331,7 +331,7 @@ Resource prefix Callbacks There are three callbacks that a resource provider is required to implement: :ref:`open`, :ref:`read`, and :ref:`close`. The other two callback - :ref:`getdir` and :ref:`modified` are optional. More details on these callbacks + :ref:`getdir` and :ref:`modified` are optional. More details on these callbacks are given below. Data Pointer @@ -352,7 +352,7 @@ Resource providers work via callbacks: - :ref:`mjfGetResourceDir`: This callback is optional and is used to extract the directory from a resource name. For example, the resource name ``http://www.example.com/myasset.obj`` would have ``http://www.example.com/`` as its directory. -- :ref:`mjfModifiedResource`: This callback is optional and is used to check if an existing +- :ref:`mjfResourceModified`: This callback is optional and is used to check if an existing opened resource has been modifed from its orginal source. .. _exProviderUsage: