Skip to content

Commit d3664b5

Browse files
yuvaltassacopybara-github
authored andcommitted
Avoid square root in mju_makeFrame
PiperOrigin-RevId: 745974380 Change-Id: I90879fac05e62daf60acd2223f814e833634b242
1 parent 3429a48 commit d3664b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/engine/engine_util_spatial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ void mju_makeFrame(mjtNum frame[9]) {
532532
}
533533

534534
// if yaxis undefined, set yaxis to (0,1,0) if possible, otherwise (0,0,1)
535-
if (mju_norm3(frame+3) < 0.5) {
535+
if (mju_dot3(frame+3, frame+3) < 0.25) {
536536
mju_zero3(frame+3);
537537

538538
if (frame[1] < 0.5 && frame[1] > -0.5) {

0 commit comments

Comments
 (0)