diff --git a/doc/APIreference/APItypes.rst b/doc/APIreference/APItypes.rst index 85d50af8..e4fe2f6c 100644 --- a/doc/APIreference/APItypes.rst +++ b/doc/APIreference/APItypes.rst @@ -5,20 +5,20 @@ Types MuJoCo defines a large number of types: - Two :ref:`primitive types`. -- C enums used to define categorical values. These can be classified according to their use in: +- :ref:`C enum types` used to define categorical values. These can be classified as: - - :ref:`mjModel`. - - :ref:`mjData`. - - Abstract :ref:`visualization`. - - The :ref:`openGL renderer`. - - The :ref:`mjUI` user interface package. + - Enums used in :ref:`mjModel`. + - Enums used in :ref:`mjData`. + - Abstract :ref:`visualization enums`. + - Enums used by the :ref:`openGL renderer`. + - Enums used by the :ref:`mjUI` user interface package. Note that the API does not use these enum types directly. Instead it uses ints, and the documentation/comments state that certain ints correspond to certain enum types. This is because we want the API to be compiler-independent, and the C standard does not dictate how many bytes must be used to represent an enum type. Nevertheless, for improved readiblity, we recommend using these types when calling API functions which take them as arguments. -- C struct types. These can be classified as: +- :ref:`C struct types`. These can be classified as: - :ref:`Main struct types`. These are :ref:`mjModel`, :ref:`mjOption` and :ref:`mjData`. - :ref:`Auxillary struct types`, also used by the engine. @@ -29,17 +29,19 @@ MuJoCo defines a large number of types: - Several :ref:`tyFunction` for user-defined callbacks. + .. _tyPrimitive: Primitive types -^^^^^^^^^^^^^^^ +--------------- The two types below are defined in `mjtnum.h `_. + .. _mjtNum: mjtNum -~~~~~~ +^^^^^^ This is the floating-point type used throughout the simulator. If the symbol ``mjUSEDOUBLE`` is defined in ``mjmodel.h``, this type is defined as ``double``, otherwise it is defined as ``float``. Currently only the @@ -65,7 +67,7 @@ changed by the user. .. _mjtByte: mjtByte -~~~~~~~ +^^^^^^^ Byte type used to represent boolean variables. @@ -74,11 +76,16 @@ Byte type used to represent boolean variables. typedef unsigned char mjtByte; +.. _tyEnums: + +Enum types +---------- + .. _tyModelEnums: -Model enums -^^^^^^^^^^^ +Model +^^^^^ The enums below are defined in `mjmodel.h `_. @@ -327,8 +334,8 @@ These are the possible sensor data types, used in ``mjData.sensor_datatype``. .. _tyDataEnums: -Data enums -^^^^^^^^^^ +Data +^^^^ The enums below are defined in `mjmdata.h `_. @@ -358,8 +365,8 @@ Timer types. The number of timer types is given by ``mjNTIMER`` which is also th .. _tyVisEnums: -Visualization enums -^^^^^^^^^^^^^^^^^^^ +Visualization +^^^^^^^^^^^^^ The enums below are defined in `mjvisualize.h `_. @@ -462,8 +469,8 @@ These are the possible stereo rendering types. They are used in ``mjvScene.stere .. _tyRenderEnums: -Rendering enums -^^^^^^^^^^^^^^^ +Rendering +^^^^^^^^^ The enums below are defined in `mjrender.h `_. @@ -512,8 +519,8 @@ These are the possible font types. .. _tyUIEnums: -User Interface enums -^^^^^^^^^^^^^^^^^^^^ +User Interface +^^^^^^^^^^^^^^ The enums below are defined in `mjui.h `_. @@ -549,10 +556,17 @@ Item types used in the UI framework. +.. _tyStructure: + +Struct types +------------ + + .. _tyMainStructure: -Main structs -^^^^^^^^^^^^ +Main +^^^^ + The three central struct types for physics simulation are :ref:`mjModel`, :ref:`mjOption` (embedded in :ref:`mjModel`) and :ref:`mjData`. An introductory discussion of these strucures can be found in the Overview under :ref:`Separation of model and data`. @@ -593,8 +607,9 @@ modifiable inputs and write their outputs. .. _tyAuxStructure: -Auxillary structs -^^^^^^^^^^^^^^^^^ +Auxillary +^^^^^^^^^ + These struct types are used in the engine and their names are prefixed with ``mj``. :ref:`mjVisual` and :ref:`mjStatistic` are embedded in :ref:`mjModel`, :ref:`mjContact` is embedded in :ref:`mjData`, and :ref:`mjVFS` is a library-level struct used for loading assets. @@ -658,8 +673,9 @@ Options for configuring the automatic :ref:`actuator length-range computation`_ and in `mjui.h @@ -904,7 +923,7 @@ in the :doc:`globals` page. .. _mjfGeneric: mjfGeneric -~~~~~~~~~~ +^^^^^^^^^^ .. code-block:: C @@ -916,7 +935,7 @@ This is the function type of the callbacks :ref:`mjcb_passive` and :ref:`mjcb_co .. _mjfConFilt: mjfConFilt -~~~~~~~~~~ +^^^^^^^^^^ .. code-block:: C @@ -929,7 +948,7 @@ This is the function type of the callback :ref:`mjcb_contactfilter`. The return .. _mjfSensor: mjfSensor -~~~~~~~~~ +^^^^^^^^^ .. code-block:: C @@ -941,7 +960,7 @@ This is the function type of the callback :ref:`mjcb_sensor`. .. _mjfTime: mjfTime -~~~~~~~ +^^^^^^^ .. code-block:: C @@ -953,7 +972,7 @@ This is the function type of the callback :ref:`mjcb_time`. .. _mjfAct: mjfAct -~~~~~~ +^^^^^^ .. code-block:: C @@ -965,7 +984,7 @@ This is the function type of the callbacks :ref:`mjcb_act_dyn`, :ref:`mjcb_act_g .. _mjfCollision: mjfCollision -~~~~~~~~~~~~ +^^^^^^^^^^^^ .. code-block:: C @@ -978,7 +997,7 @@ This is the function type of the callbacks in the collision table :ref:`mjCOLLIS .. _mjfItemEnable: mjfItemEnable -~~~~~~~~~~~~~ +^^^^^^^^^^^^^ .. code-block:: C diff --git a/doc/APIreference/index.rst b/doc/APIreference/index.rst index 3d1f0980..6f916867 100644 --- a/doc/APIreference/index.rst +++ b/doc/APIreference/index.rst @@ -7,9 +7,14 @@ API Reference This chapter is the reference manual for the MuJoCo API. It is automatically kept in sync with MuJoCo's header files, but also contains additional information not available in the headers. The API is composed of 3 categories: -.. toctree:: - :maxdepth: 1 +.. table:: + :class: aligntop - APItypes - APIglobals - APIfunctions + +--------------------+--------------------+--------------------+ + | | | | + | .. toctree:: | .. toctree:: | .. toctree:: | + | :maxdepth: 3 | :maxdepth: 2 | :maxdepth: 2 | + | | | | + | APItypes | APIfunctions | APIglobals | + | | | | + +--------------------+--------------------+--------------------+ diff --git a/doc/css/theme_overrides.css b/doc/css/theme_overrides.css index 0a4f0233..55f84c8a 100644 --- a/doc/css/theme_overrides.css +++ b/doc/css/theme_overrides.css @@ -161,6 +161,12 @@ html.writer-html5 .rst-content table.docutils th>p { border: none; } +/* Table with top-aligned cell contents. */ +table.aligntop > tbody { + vertical-align: top; +} + + /* Alternate row colors. */ table.docutils:not(.mjcf-attributes) > tbody > tr.row-odd { background-color: var(--row-odd-background-color);