|
@@ -2843,18 +2843,11 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- project: function () {
|
|
|
+ project: function ( camera ) {
|
|
|
|
|
|
- var matrix = new Matrix4();
|
|
|
-
|
|
|
- return function project( camera ) {
|
|
|
-
|
|
|
- matrix.multiplyMatrices( camera.projectionMatrix, matrix.getInverse( camera.matrixWorld ) );
|
|
|
- return this.applyMatrix4( matrix );
|
|
|
-
|
|
|
- };
|
|
|
+ return this.applyMatrix4( camera.matrixWorldInverse ).applyMatrix4( camera.projectionMatrix );
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
unproject: function () {
|
|
|
|
|
@@ -2862,8 +2855,7 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
return function unproject( camera ) {
|
|
|
|
|
|
- matrix.multiplyMatrices( camera.matrixWorld, matrix.getInverse( camera.projectionMatrix ) );
|
|
|
- return this.applyMatrix4( matrix );
|
|
|
+ return this.applyMatrix4( matrix.getInverse( camera.projectionMatrix ) ).applyMatrix4( camera.matrixWorld );
|
|
|
|
|
|
};
|
|
|
|
|
@@ -6930,6 +6922,28 @@ Object.assign( Color.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ lerpHSL: function () {
|
|
|
+
|
|
|
+ var hslA = { h: 0, s: 0, l: 0 };
|
|
|
+ var hslB = { h: 0, s: 0, l: 0 };
|
|
|
+
|
|
|
+ return function lerpHSL( color, alpha ) {
|
|
|
+
|
|
|
+ this.getHSL( hslA );
|
|
|
+ color.getHSL( hslB );
|
|
|
+
|
|
|
+ var h = _Math.lerp( hslA.h, hslB.h, alpha );
|
|
|
+ var s = _Math.lerp( hslA.s, hslB.s, alpha );
|
|
|
+ var l = _Math.lerp( hslA.l, hslB.l, alpha );
|
|
|
+
|
|
|
+ this.setHSL( h, s, l );
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ }(),
|
|
|
+
|
|
|
equals: function ( c ) {
|
|
|
|
|
|
return ( c.r === this.r ) && ( c.g === this.g ) && ( c.b === this.b );
|
|
@@ -8508,26 +8522,22 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
|
|
|
|
|
|
}(),
|
|
|
|
|
|
- getWorldDirection: function () {
|
|
|
-
|
|
|
- var quaternion = new Quaternion();
|
|
|
-
|
|
|
- return function getWorldDirection( target ) {
|
|
|
+ getWorldDirection: function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
+ if ( target === undefined ) {
|
|
|
|
|
|
- console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
+ console.warn( 'THREE.Object3D: .getWorldDirection() target is now required' );
|
|
|
+ target = new Vector3();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- this.getWorldQuaternion( quaternion );
|
|
|
+ this.updateMatrixWorld( true );
|
|
|
|
|
|
- return target.set( 0, 0, 1 ).applyQuaternion( quaternion );
|
|
|
+ var e = this.matrixWorld.elements;
|
|
|
|
|
|
- };
|
|
|
+ return target.set( e[ 8 ], e[ 9 ], e[ 10 ] ).normalize();
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
raycast: function () {},
|
|
|
|
|
@@ -8871,26 +8881,22 @@ Camera.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
},
|
|
|
|
|
|
- getWorldDirection: function () {
|
|
|
-
|
|
|
- var quaternion = new Quaternion();
|
|
|
-
|
|
|
- return function getWorldDirection( target ) {
|
|
|
+ getWorldDirection: function ( target ) {
|
|
|
|
|
|
- if ( target === undefined ) {
|
|
|
+ if ( target === undefined ) {
|
|
|
|
|
|
- console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
|
|
|
- target = new Vector3();
|
|
|
+ console.warn( 'THREE.Camera: .getWorldDirection() target is now required' );
|
|
|
+ target = new Vector3();
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- this.getWorldQuaternion( quaternion );
|
|
|
+ this.updateMatrixWorld( true );
|
|
|
|
|
|
- return target.set( 0, 0, - 1 ).applyQuaternion( quaternion );
|
|
|
+ var e = this.matrixWorld.elements;
|
|
|
|
|
|
- };
|
|
|
+ return target.set( - e[ 8 ], - e[ 9 ], - e[ 10 ] ).normalize();
|
|
|
|
|
|
- }(),
|
|
|
+ },
|
|
|
|
|
|
updateMatrixWorld: function ( force ) {
|
|
|
|
|
@@ -31867,6 +31873,24 @@ Object.assign( FileLoader.prototype, {
|
|
|
|
|
|
}, false );
|
|
|
|
|
|
+ request.addEventListener( 'abort', function ( event ) {
|
|
|
+
|
|
|
+ var callbacks = loading[ url ];
|
|
|
+
|
|
|
+ delete loading[ url ];
|
|
|
+
|
|
|
+ for ( var i = 0, il = callbacks.length; i < il; i ++ ) {
|
|
|
+
|
|
|
+ var callback = callbacks[ i ];
|
|
|
+ if ( callback.onError ) callback.onError( event );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ scope.manager.itemEnd( url );
|
|
|
+ scope.manager.itemError( url );
|
|
|
+
|
|
|
+ }, false );
|
|
|
+
|
|
|
if ( this.responseType !== undefined ) request.responseType = this.responseType;
|
|
|
if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
|
|
|
|
|
@@ -32349,7 +32373,7 @@ Object.assign( TextureLoader.prototype, {
|
|
|
texture.image = image;
|
|
|
|
|
|
// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
|
|
|
- var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
|
|
|
+ var isJPEG = url.search( /\.jpe?g$/i ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;
|
|
|
|
|
|
texture.format = isJPEG ? RGBFormat : RGBAFormat;
|
|
|
texture.needsUpdate = true;
|