Replace mjMIN and mjMAX with mju_min and mju_max, where possible.
PiperOrigin-RevId: 566602924 Change-Id: I2d24183d0d9df3e647bb2d7d7544473582f38128
This commit is contained in:
committed by
Copybara-Service
parent
9cf1f6eba4
commit
dfd48dd821
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user