diff --git a/doc/APIreference/functions.rst b/doc/APIreference/functions.rst index 38568b35..878bbf00 100644 --- a/doc/APIreference/functions.rst +++ b/doc/APIreference/functions.rst @@ -2107,18 +2107,6 @@ mjv_initGeom Initialize given geom fields when not NULL, set the rest to their default values. -.. _mjv_makeConnector: - -mjv_makeConnector -~~~~~~~~~~~~~~~~~ - -.. mujoco-include:: mjv_makeConnector - -Set (type, size, pos, mat) for connector-type geom between given points. -Assume that mjv_initGeom was already called to set all other properties. -Width of mjGEOM_LINE is denominated in pixels. -Deprecated: use mjv_connector. - .. _mjv_connector: mjv_connector diff --git a/doc/changelog.rst b/doc/changelog.rst index 436ffce3..f3c9b25e 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -10,7 +10,7 @@ General - The global compiler flag ``exactmeshinertia`` has been removed and replaced with the mesh-specific :ref:`inertia` attribute. - The not-useful ``convexhull`` compiler option (to disable computation of mesh convex hulls) has been removed. -- Removed the deprecated ``mju_rotVecMat`` and ``mju_rotVecMatT`` functions. +- Removed the deprecated ``mju_rotVecMat``, ``mju_rotVecMatT`` and ``mjv_makeConnector`` functions. - Sorting now uses a faster, native sort function (fixes :github:issue:`1638`). - The PBR texture layers introduced in 3.2.1 were refactored from seperate sub-elements to a single :ref:`layer` sub-element. @@ -892,7 +892,7 @@ General #. Added analytic derivatives for quaternion :ref:`subtraction` and :ref:`integration` (rotation with an angular velocity). Derivatives are in the 3D tangent space. #. Added :ref:`mjv_connector` which has identical functionality to :ref:`mjv_makeConnector`, but with more convenient - "from-to" argument parametrization. :ref:`mjv_makeConnector` is now deprecated. + "from-to" argument parametrization. ``mjv_makeConnector`` is now deprecated. #. Bumped oldest supported MacOS from version 10.12 to 11. MacOS 11 is the oldest version still maintained by Apple. Python bindings diff --git a/doc/includes/references.h b/doc/includes/references.h index e8b6f6e7..9a777763 100644 --- a/doc/includes/references.h +++ b/doc/includes/references.h @@ -3337,9 +3337,6 @@ void mjv_defaultOption(mjvOption* opt); void mjv_defaultFigure(mjvFigure* fig); void mjv_initGeom(mjvGeom* geom, int type, const mjtNum size[3], const mjtNum pos[3], const mjtNum mat[9], const float rgba[4]); -void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, - mjtNum a0, mjtNum a1, mjtNum a2, - mjtNum b0, mjtNum b1, mjtNum b2); void mjv_connector(mjvGeom* geom, int type, mjtNum width, const mjtNum from[3], const mjtNum to[3]); void mjv_defaultScene(mjvScene* scn); diff --git a/doc/python.rst b/doc/python.rst index e3e8d2e8..cef23eb5 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -126,7 +126,7 @@ attributes: - ``user_scn``: an :ref:`mjvScene` object that allows users to add change rendering flags and add custom visualization geoms to the rendered scene. This is separate from the ``mjvScene`` that the viewer uses internally to render the final scene, and is entirely under the user's control. User scripts can call e.g. :ref:`mjv_initGeom` or - :ref:`mjv_makeConnector` to add visualization geoms to ``user_scn``, and upon the next call to ``sync()``, the viewer + :ref:`mjv_connector` to add visualization geoms to ``user_scn``, and upon the next call to ``sync()``, the viewer will incorporate these geoms to future rendered images. Similarly, user scripts can make changes to ``user_scn.flags`` which would be picked up at the next call to ``sync()``. The ``sync()`` call also copies changes to rendering flags made via the GUI back into ``user_scn`` to preserve consistency. For example: diff --git a/include/mujoco/mujoco.h b/include/mujoco/mujoco.h index 849462fe..fae4600f 100644 --- a/include/mujoco/mujoco.h +++ b/include/mujoco/mujoco.h @@ -668,14 +668,6 @@ MJAPI void mjv_defaultFigure(mjvFigure* fig); MJAPI void mjv_initGeom(mjvGeom* geom, int type, const mjtNum size[3], const mjtNum pos[3], const mjtNum mat[9], const float rgba[4]); -// Set (type, size, pos, mat) for connector-type geom between given points. -// Assume that mjv_initGeom was already called to set all other properties. -// Width of mjGEOM_LINE is denominated in pixels. -// Deprecated: use mjv_connector. -MJAPI void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, - mjtNum a0, mjtNum a1, mjtNum a2, - mjtNum b0, mjtNum b1, mjtNum b2); - // Set (type, size, pos, mat) for connector-type geom between given points. // Assume that mjv_initGeom was already called to set all other properties. // Width of mjGEOM_LINE is denominated in pixels. diff --git a/introspect/functions.py b/introspect/functions.py index 4f86485d..2afb3798 100644 --- a/introspect/functions.py +++ b/introspect/functions.py @@ -4372,52 +4372,6 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([ ), doc='Initialize given geom fields when not NULL, set the rest to their default values.', # pylint: disable=line-too-long )), - ('mjv_makeConnector', - FunctionDecl( - name='mjv_makeConnector', - return_type=ValueType(name='void'), - parameters=( - FunctionParameterDecl( - name='geom', - type=PointerType( - inner_type=ValueType(name='mjvGeom'), - ), - ), - FunctionParameterDecl( - name='type', - type=ValueType(name='int'), - ), - FunctionParameterDecl( - name='width', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='a0', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='a1', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='a2', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='b0', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='b1', - type=ValueType(name='mjtNum'), - ), - FunctionParameterDecl( - name='b2', - type=ValueType(name='mjtNum'), - ), - ), - doc='Set (type, size, pos, mat) for connector-type geom between given points. Assume that mjv_initGeom was already called to set all other properties. Width of mjGEOM_LINE is denominated in pixels. Deprecated: use mjv_connector.', # pylint: disable=line-too-long - )), ('mjv_connector', FunctionDecl( name='mjv_connector', diff --git a/python/mujoco/functions.cc b/python/mujoco/functions.cc index 6965957d..47bf5314 100644 --- a/python/mujoco/functions.cc +++ b/python/mujoco/functions.cc @@ -675,7 +675,6 @@ PYBIND11_MODULE(_functions, pymodule) { Def(pymodule); Def(pymodule); Def(pymodule); - Def(pymodule); Def(pymodule); // Skipped: mjv_defaultScene (have MjvScene.__init__, memory managed by // MjvScene). diff --git a/python/tutorial.ipynb b/python/tutorial.ipynb index 15b5ad39..c3d4193d 100644 --- a/python/tutorial.ipynb +++ b/python/tutorial.ipynb @@ -1872,14 +1872,13 @@ " if scene.ngeom >= scene.maxgeom:\n", " return\n", " scene.ngeom += 1 # increment ngeom\n", - " # initialise a new capsule, add it to the scene using mjv_makeConnector\n", + " # initialise a new capsule, add it to the scene using mjv_connector\n", " mujoco.mjv_initGeom(scene.geoms[scene.ngeom-1],\n", " mujoco.mjtGeom.mjGEOM_CAPSULE, np.zeros(3),\n", " np.zeros(3), np.zeros(9), rgba.astype(np.float32))\n", - " mujoco.mjv_makeConnector(scene.geoms[scene.ngeom-1],\n", - " mujoco.mjtGeom.mjGEOM_CAPSULE, radius,\n", - " point1[0], point1[1], point1[2],\n", - " point2[0], point2[1], point2[2])\n", + " mujoco.mjv_connector(scene.geoms[scene.ngeom-1],\n", + " mujoco.mjtGeom.mjGEOM_CAPSULE, radius,\n", + " point1, point2)\n", "\n", " # traces of time, position and speed\n", "times = []\n", diff --git a/src/engine/engine_vis_visualize.c b/src/engine/engine_vis_visualize.c index d3638970..10396a0b 100644 --- a/src/engine/engine_vis_visualize.c +++ b/src/engine/engine_vis_visualize.c @@ -346,10 +346,9 @@ static void setMaterial(const mjModel* m, mjvGeom* geom, int matid, const float* // set (type, size, pos, mat) connector-type geom between given points // assume that mjv_initGeom was already called to set all other properties -void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, - mjtNum a0, mjtNum a1, mjtNum a2, - mjtNum b0, mjtNum b1, mjtNum b2) { - mjtNum quat[4], mat[9], dif[3] = {b0-a0, b1-a1, b2-a2}; +void mjv_connector(mjvGeom* geom, int type, mjtNum width, + const mjtNum from[3], const mjtNum to[3]) { + mjtNum quat[4], mat[9], dif[3] = {to[0]-from[0], to[1]-from[1], to[2]-from[2]}; // require connector-compatible type if (type != mjGEOM_CAPSULE && type != mjGEOM_CYLINDER && @@ -367,17 +366,17 @@ void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, // cylinder and capsule are centered, and size[0] is "radius" if (type == mjGEOM_CAPSULE || type == mjGEOM_CYLINDER) { - geom->pos[0] = 0.5*(a0 + b0); - geom->pos[1] = 0.5*(a1 + b1); - geom->pos[2] = 0.5*(a2 + b2); + geom->pos[0] = 0.5*(from[0] + to[0]); + geom->pos[1] = 0.5*(from[1] + to[1]); + geom->pos[2] = 0.5*(from[2] + to[2]); geom->size[2] *= 0.5; } // arrow is not centered else { - geom->pos[0] = a0; - geom->pos[1] = a1; - geom->pos[2] = a2; + geom->pos[0] = from[0]; + geom->pos[1] = from[1]; + geom->pos[2] = from[2]; } // set mat to minimal rotation aligning b-a with z axis @@ -386,12 +385,7 @@ void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, mju_n2f(geom->mat, mat, 9); } -// set (type, size, pos, mat) connector-type geom between given points -// assume that mjv_initGeom was already called to set all other properties -void mjv_connector(mjvGeom* geom, int type, mjtNum width, - const mjtNum from[3], const mjtNum to[3]) { - mjv_makeConnector(geom, type, width, from[0], from[1], from[2], to[0], to[1], to[2]); -} + // initialize given fields when not NULL, set the rest to their default values void mjv_initGeom(mjvGeom* geom, int type, const mjtNum* size, diff --git a/src/engine/engine_vis_visualize.h b/src/engine/engine_vis_visualize.h index 41c2050d..bf548360 100644 --- a/src/engine/engine_vis_visualize.h +++ b/src/engine/engine_vis_visualize.h @@ -24,12 +24,6 @@ extern "C" { #endif -// set (type, size, pos, mat) connector-type geom between given points -// assume that mjv_initGeom was already called to set all other properties -MJAPI void mjv_makeConnector(mjvGeom* geom, int type, mjtNum width, - mjtNum a0, mjtNum a1, mjtNum a2, - mjtNum b0, mjtNum b1, mjtNum b2); - // set (type, size, pos, mat) connector-type geom between given points // assume that mjv_initGeom was already called to set all other properties MJAPI void mjv_connector(mjvGeom* geom, int type, mjtNum width, diff --git a/unity/Runtime/Bindings/MjBindings.cs b/unity/Runtime/Bindings/MjBindings.cs index f456e3f6..51a13917 100644 --- a/unity/Runtime/Bindings/MjBindings.cs +++ b/unity/Runtime/Bindings/MjBindings.cs @@ -6921,9 +6921,6 @@ public static unsafe extern void mjv_defaultFigure(mjvFigure_* fig); [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void mjv_initGeom(mjvGeom_* geom, int type, double* size, double* pos, double* mat, float* rgba); -[DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)] -public static unsafe extern void mjv_makeConnector(mjvGeom_* geom, int type, double width, double a0, double a1, double a2, double b0, double b1, double b2); - [DllImport("mujoco", CallingConvention = CallingConvention.Cdecl)] public static unsafe extern void mjv_connector(mjvGeom_* geom, int type, double width, double* from, double* to);