Remove deprecated mjv_makeConnector function.
PiperOrigin-RevId: 690563333 Change-Id: Ice9c6b6cf41de8a55fa361477f9aee9181d50184
This commit is contained in:
committed by
Copybara-Service
parent
3c21abc0e5
commit
d8494fef3b
@@ -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
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ General
|
||||
- The global compiler flag ``exactmeshinertia`` has been removed and replaced with the mesh-specific
|
||||
:ref:`inertia<asset-mesh-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<material-layer>` sub-element.
|
||||
@@ -892,7 +892,7 @@ General
|
||||
#. Added analytic derivatives for quaternion :ref:`subtraction<mjd_subQuat>` and :ref:`integration<mjd_quatIntegrate>`
|
||||
(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
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -675,7 +675,6 @@ PYBIND11_MODULE(_functions, pymodule) {
|
||||
Def<traits::mjv_defaultOption>(pymodule);
|
||||
Def<traits::mjv_defaultFigure>(pymodule);
|
||||
Def<traits::mjv_initGeom>(pymodule);
|
||||
Def<traits::mjv_makeConnector>(pymodule);
|
||||
Def<traits::mjv_connector>(pymodule);
|
||||
// Skipped: mjv_defaultScene (have MjvScene.__init__, memory managed by
|
||||
// MjvScene).
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user