Always normalize in planeNormal to reduce rounding errors in single precision.
PiperOrigin-RevId: 926002329 Change-Id: I682f3b90249e60838c2432231b3181e57c565c28
This commit is contained in:
committed by
Copybara-Service
parent
5d231c64cd
commit
558366f364
@@ -1538,6 +1538,9 @@ static mjtNum planeNormal(mjtNum res[3], const mjtNum v1[3], const mjtNum v2[3],
|
||||
sub3(diff1, v2, v1);
|
||||
sub3(diff2, v3, v1);
|
||||
cross3(res, diff1, diff2);
|
||||
|
||||
// normalize isn't needed (cancelled out), but done to avoid asymmetric rounding later on
|
||||
mju_normalize3(res);
|
||||
return dot3(res, v1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user