Replace mjMIN and mjMAX with mju_min and mju_max, where possible.

PiperOrigin-RevId: 566602924
Change-Id: I2d24183d0d9df3e647bb2d7d7544473582f38128
This commit is contained in:
Yuval Tassa
2023-09-19 05:39:55 -07:00
committed by Copybara-Service
parent 9cf1f6eba4
commit dfd48dd821
9 changed files with 45 additions and 50 deletions
+1 -2
View File
@@ -19,7 +19,6 @@
#include <string.h>
#include <mujoco/mjdata.h>
#include <mujoco/mjmacro.h>
#include <mujoco/mjmodel.h>
#include "engine/engine_core_constraint.h"
#include "engine/engine_crossplatform.h"
@@ -1543,7 +1542,7 @@ mjtNum mj_getTotalmass(const mjModel* m) {
// scale all body masses and inertias to achieve specified total mass
void mj_setTotalmass(mjModel* m, mjtNum newmass) {
// compute scale factor, avoid zeros
mjtNum scale = mjMAX(mjMINVAL, newmass / mjMAX(mjMINVAL, mj_getTotalmass(m)));
mjtNum scale = mju_max(mjMINVAL, newmass / mju_max(mjMINVAL, mj_getTotalmass(m)));
// scale all masses and inertias
for (int i=1; i < m->nbody; i++) {