File tree Expand file tree Collapse file tree 3 files changed +17
-11
lines changed
Expand file tree Collapse file tree 3 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -355,22 +355,25 @@ void Matrix3::Re_Orthogonalize(void)
355355 if (len < WWMATH_EPSILON) {
356356 Make_Identity ();
357357 return ;
358+ } else {
359+ x /= len;
358360 }
359- x /= len;
360361
361362 len = y.Length ();
362363 if (len < WWMATH_EPSILON) {
363364 Make_Identity ();
364365 return ;
366+ } else {
367+ y /= len;
365368 }
366- y /= len;
367369
368370 len = z.Length ();
369371 if (len < WWMATH_EPSILON) {
370372 Make_Identity ();
371373 return ;
374+ } else {
375+ z /= len;
372376 }
373- z /= len;
374377
375378 Row[0 ][0 ] = x.X ;
376379 Row[0 ][1 ] = x.Y ;
Original file line number Diff line number Diff line change @@ -782,22 +782,25 @@ void Matrix3D::Re_Orthogonalize(void)
782782 if (len < WWMATH_EPSILON) {
783783 Make_Identity ();
784784 return ;
785+ } else {
786+ x *= 1 .0f /len;
785787 }
786- x *= 1 .0f /len;
787788
788789 len = y.Length ();
789790 if (len < WWMATH_EPSILON) {
790791 Make_Identity ();
791792 return ;
793+ } else {
794+ y *= 1 .0f /len;
792795 }
793- y *= 1 .0f /len;
794796
795797 len = z.Length ();
796798 if (len < WWMATH_EPSILON) {
797799 Make_Identity ();
798800 return ;
801+ } else {
802+ z *= 1 .0f /len;
799803 }
800- z *= 1 .0f /len;
801804
802805 Row[0 ][0 ] = x.X ;
803806 Row[0 ][1 ] = x.Y ;
Original file line number Diff line number Diff line change @@ -116,12 +116,12 @@ void Quaternion::Normalize()
116116
117117 if (0 .0f == mag) {
118118 return ;
119+ } else {
120+ X /= mag;
121+ Y /= mag;
122+ Z /= mag;
123+ W /= mag;
119124 }
120-
121- X /= mag;
122- Y /= mag;
123- Z /= mag;
124- W /= mag;
125125}
126126
127127/* **********************************************************************************************
You can’t perform that action at this time.
0 commit comments