Add spaces around comparison operators in engine source files.
PiperOrigin-RevId: 535989348 Change-Id: I883f7e82351299933c49b35a31842b5d8d6aea04
This commit is contained in:
committed by
Copybara-Service
parent
d40c395917
commit
455b1cd2e2
@@ -663,7 +663,8 @@ int mj_broadphase(const mjModel* m, mjData* d, int* pair, int maxpair) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// world with geoms, or welded body with plane or hfield
|
// world with geoms, or welded body with plane or hfield
|
||||||
if ((b1==0 && m->body_geomnum[b1]>0) || (m->body_weldid[b1]==0 && has_plane_or_hfield(m, b1))) {
|
if ((b1 == 0 && m->body_geomnum[b1] > 0) ||
|
||||||
|
(m->body_weldid[b1] == 0 && has_plane_or_hfield(m, b1))) {
|
||||||
int weld1 = 0;
|
int weld1 = 0;
|
||||||
int parent_weld1 = 0;
|
int parent_weld1 = 0;
|
||||||
for (b2=0; b2 < nbody; b2++) {
|
for (b2=0; b2 < nbody; b2++) {
|
||||||
|
|||||||
@@ -1149,9 +1149,11 @@ static inline void mjd_magnus_force(
|
|||||||
|
|
||||||
// premultiply by magnus_coef
|
// premultiply by magnus_coef
|
||||||
const mjtNum lin_vel[3] = {
|
const mjtNum lin_vel[3] = {
|
||||||
magnus_coef * lvel[3], magnus_coef * lvel[4], magnus_coef * lvel[5]};
|
magnus_coef * lvel[3], magnus_coef * lvel[4], magnus_coef * lvel[5]
|
||||||
|
};
|
||||||
const mjtNum ang_vel[3] = {
|
const mjtNum ang_vel[3] = {
|
||||||
magnus_coef * lvel[0], magnus_coef * lvel[1], magnus_coef * lvel[2]};
|
magnus_coef * lvel[0], magnus_coef * lvel[1], magnus_coef * lvel[2]
|
||||||
|
};
|
||||||
|
|
||||||
// force[3:] += magnus_coef * cross(ang_vel, lin_vel)
|
// force[3:] += magnus_coef * cross(ang_vel, lin_vel)
|
||||||
mjd_cross(ang_vel, lin_vel, D_ang, D_lin);
|
mjd_cross(ang_vel, lin_vel, D_ang, D_lin);
|
||||||
|
|||||||
@@ -1065,7 +1065,9 @@ static int updateBracket(const mjModel* m, mjData* d, mjCGContext* ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// positive deriv
|
// positive deriv
|
||||||
else if (p->deriv[0]>0 && candidates[i].deriv[0]>0 && p->deriv[0]>candidates[i].deriv[0]) {
|
else if (p->deriv[0] > 0 &&
|
||||||
|
candidates[i].deriv[0] > 0 &&
|
||||||
|
p->deriv[0] > candidates[i].deriv[0]) {
|
||||||
*p = candidates[i];
|
*p = candidates[i];
|
||||||
flag = 2;
|
flag = 2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -368,8 +368,7 @@ void mju_inertCom(mjtNum res[10], const mjtNum inert[3], const mjtNum mat[9],
|
|||||||
// tmp = diag(inert) * mat' (mat is local-to-global rotation)
|
// tmp = diag(inert) * mat' (mat is local-to-global rotation)
|
||||||
mjtNum tmp[9] = {mat[0]*inert[0], mat[3]*inert[0], mat[6]*inert[0],
|
mjtNum tmp[9] = {mat[0]*inert[0], mat[3]*inert[0], mat[6]*inert[0],
|
||||||
mat[1]*inert[1], mat[4]*inert[1], mat[7]*inert[1],
|
mat[1]*inert[1], mat[4]*inert[1], mat[7]*inert[1],
|
||||||
mat[2]*inert[2], mat[5]*inert[2], mat[8]*inert[2]
|
mat[2]*inert[2], mat[5]*inert[2], mat[8]*inert[2]};
|
||||||
};
|
|
||||||
|
|
||||||
// res_rot = mat * diag(inert) * mat'
|
// res_rot = mat * diag(inert) * mat'
|
||||||
res[0] = mat[0]*tmp[0] + mat[1]*tmp[3] + mat[2]*tmp[6];
|
res[0] = mat[0]*tmp[0] + mat[1]*tmp[3] + mat[2]*tmp[6];
|
||||||
|
|||||||
@@ -687,7 +687,8 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vopt->label
|
// vopt->label
|
||||||
if (vopt->label==mjLABEL_BODY || (vopt->label==mjLABEL_SELECTION && pert->select==i)) {
|
if (vopt->label == mjLABEL_BODY ||
|
||||||
|
(vopt->label == mjLABEL_SELECTION && pert->select == i)) {
|
||||||
makeLabel(m, mjOBJ_BODY, i, thisgeom->label);
|
makeLabel(m, mjOBJ_BODY, i, thisgeom->label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user