|
@@ -3621,6 +3621,8 @@ Object.assign( Matrix4.prototype, {
|
|
|
|
|
|
if ( z.lengthSq() === 0 ) {
|
|
|
|
|
|
+ // eye and target are in the same position
|
|
|
+
|
|
|
z.z = 1;
|
|
|
|
|
|
}
|
|
@@ -3630,15 +3632,10 @@ Object.assign( Matrix4.prototype, {
|
|
|
|
|
|
if ( x.lengthSq() === 0 ) {
|
|
|
|
|
|
- var t = Math.PI / 2;
|
|
|
- var c = Math.cos( t ) * z.y;
|
|
|
- var s = Math.sin( t ) * z.y;
|
|
|
-
|
|
|
- te[ 0 ] = 1; te[ 4 ] = 0; te[ 8 ] = 0;
|
|
|
- te[ 1 ] = 0; te[ 5 ] = c; te[ 9 ] = s;
|
|
|
- te[ 2 ] = 0; te[ 6 ] = - s; te[ 10 ] = c;
|
|
|
+ // eye and target are in the same vertical
|
|
|
|
|
|
- return this;
|
|
|
+ z.z += 0.0001;
|
|
|
+ x.crossVectors( up, z );
|
|
|
|
|
|
}
|
|
|
|