Deprecate mju_rotVecMat and mju_rotVecMatT in favor of mju_mulMatVec3 and mju_mulMatTVec3.

These functions names and argument ordering are more consistent with the rest of the API.

PiperOrigin-RevId: 643788290
Change-Id: I783eda8021b80b82098e23ed95669b102bb82508
This commit is contained in:
Yuval Tassa
2024-06-16 10:01:31 -07:00
committed by Copybara-Service
parent 739512a0e4
commit 6067048537
33 changed files with 233 additions and 117 deletions
+6 -6
View File
@@ -306,10 +306,10 @@ void TouchGrid::Compute(const mjModel* m, mjData* d, int instance) {
// Note that contact.frame is column major.
mjtNum tmp_force[6], tmp1[3];
mj_contactForce(m, d, i, tmp_force);
mju_rotVecMatT(tmp1, tmp_force, d->contact[i].frame);
mju_rotVecMatT(forces + 6*contact, tmp1, site_mat);
mju_rotVecMatT(tmp1, tmp_force + 3, d->contact[i].frame);
mju_rotVecMatT(forces + 6*contact + 3, tmp1, site_mat);
mju_mulMatTVec3(tmp1, d->contact[i].frame, tmp_force);
mju_mulMatTVec3(forces + 6*contact, site_mat, tmp1);
mju_mulMatTVec3(tmp1, d->contact[i].frame, tmp_force + 3);
mju_mulMatTVec3(forces + 6*contact + 3, site_mat, tmp1);
// Forces point from the smaller to larger body, so flip sign if
// the parent body has smaller id.
@@ -324,7 +324,7 @@ void TouchGrid::Compute(const mjModel* m, mjData* d, int instance) {
// Get position, rotate into contact frame.
mjtNum tmp2[3];
mju_sub3(tmp1, d->contact[i].pos, site_pos);
mju_rotVecMatT(tmp2, tmp1, site_mat);
mju_mulMatTVec3(tmp2, site_mat, tmp1);
// Transform to spherical coordinates, copy into positions array.
CartesianToSpherical(tmp2, tmp1);
@@ -442,7 +442,7 @@ void TouchGrid::Visualize(const mjModel* m, mjData* d, const mjvOption* opt,
0.5*(y_edges[j+1]+y_edges[j]),
dist*(1-kRelativeThickness)};
SphericalToCartesian(aer, pos);
mju_rotVecMat(pos, pos, site_mat);
mju_mulMatVec3(pos, site_mat, pos);
mju_addTo3(pos, site_pos);
// orientation