Skip to content

Commit 3283fb8

Browse files
kbayescopybara-github
authored andcommitted
Fix sign in cylinder support function.
PiperOrigin-RevId: 785394029 Change-Id: I010edab0ba8734a9b91626669fa309a0ddb346e5
1 parent db72d0d commit 3283fb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/engine_collision_convex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static void mjc_cylinderSupport(mjtNum res[3], mjCCDObj* obj, const mjtNum dir[3
304304
}
305305

306306
// set result in Z direction
307-
tmp[2] = mju_sign(local_dir[2]) * size[1];
307+
tmp[2] = local_dir[2] >= 0 ? size[1] : -size[1];
308308

309309
// transform result to global frame
310310
localToGlobal(res, mat, tmp, pos);

0 commit comments

Comments
 (0)