Skip to content

Commit 1362187

Browse files
thowellcopybara-github
authored andcommitted
Remove unnecessary loop from mj_collideOBB.
PiperOrigin-RevId: 780629489 Change-Id: I715cd1f72012c0655997ba4c967fa7b5b8731d54
1 parent 14972d2 commit 1362187

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/engine/engine_collision_driver.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -548,16 +548,14 @@ int mj_collideOBB(const mjtNum aabb1[6], const mjtNum aabb2[6],
548548
// compute centers in local coordinates
549549
if (product == NULL) {
550550
for (int i=0; i < 2; i++) { // bounding boxes
551-
for (int j=0; j < 3; j++) { // axes
552-
if (xmat[i]) {
553-
mju_mulMatVec3(xcenter[i], xmat[i], aabb[i]);
554-
} else {
555-
mju_copy3(xcenter[i], aabb[i]);
556-
}
551+
if (xmat[i]) {
552+
mju_mulMatVec3(xcenter[i], xmat[i], aabb[i]);
553+
} else {
554+
mju_copy3(xcenter[i], aabb[i]);
555+
}
557556

558-
if (xpos[i]) {
559-
mju_addTo3(xcenter[i], xpos[i]);
560-
}
557+
if (xpos[i]) {
558+
mju_addTo3(xcenter[i], xpos[i]);
561559
}
562560
}
563561
}

0 commit comments

Comments
 (0)