Skip to content

Commit 18cbe8f

Browse files
authored
Merge pull request #17080 from TheophileMot/gimbal-lock-precision
Euler: Fix gimbal lock precision
2 parents 7973543 + c09ae2d commit 18cbe8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/math/Euler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Object.assign( Euler.prototype, {
149149

150150
this._y = Math.asin( clamp( m13, - 1, 1 ) );
151151

152-
if ( Math.abs( m13 ) < 0.99999 ) {
152+
if ( Math.abs( m13 ) < 0.9999999 ) {
153153

154154
this._x = Math.atan2( - m23, m33 );
155155
this._z = Math.atan2( - m12, m11 );
@@ -165,7 +165,7 @@ Object.assign( Euler.prototype, {
165165

166166
this._x = Math.asin( - clamp( m23, - 1, 1 ) );
167167

168-
if ( Math.abs( m23 ) < 0.99999 ) {
168+
if ( Math.abs( m23 ) < 0.9999999 ) {
169169

170170
this._y = Math.atan2( m13, m33 );
171171
this._z = Math.atan2( m21, m22 );
@@ -181,7 +181,7 @@ Object.assign( Euler.prototype, {
181181

182182
this._x = Math.asin( clamp( m32, - 1, 1 ) );
183183

184-
if ( Math.abs( m32 ) < 0.99999 ) {
184+
if ( Math.abs( m32 ) < 0.9999999 ) {
185185

186186
this._y = Math.atan2( - m31, m33 );
187187
this._z = Math.atan2( - m12, m22 );
@@ -197,7 +197,7 @@ Object.assign( Euler.prototype, {
197197

198198
this._y = Math.asin( - clamp( m31, - 1, 1 ) );
199199

200-
if ( Math.abs( m31 ) < 0.99999 ) {
200+
if ( Math.abs( m31 ) < 0.9999999 ) {
201201

202202
this._x = Math.atan2( m32, m33 );
203203
this._z = Math.atan2( m21, m11 );
@@ -213,7 +213,7 @@ Object.assign( Euler.prototype, {
213213

214214
this._z = Math.asin( clamp( m21, - 1, 1 ) );
215215

216-
if ( Math.abs( m21 ) < 0.99999 ) {
216+
if ( Math.abs( m21 ) < 0.9999999 ) {
217217

218218
this._x = Math.atan2( - m23, m22 );
219219
this._y = Math.atan2( - m31, m11 );
@@ -229,7 +229,7 @@ Object.assign( Euler.prototype, {
229229

230230
this._z = Math.asin( - clamp( m12, - 1, 1 ) );
231231

232-
if ( Math.abs( m12 ) < 0.99999 ) {
232+
if ( Math.abs( m12 ) < 0.9999999 ) {
233233

234234
this._x = Math.atan2( m32, m22 );
235235
this._y = Math.atan2( m13, m11 );

0 commit comments

Comments
 (0)