Browse Source

Updated builds.

Mr.doob 2 years ago
parent
commit
c88db12121
5 changed files with 132 additions and 36 deletions
  1. 44 12
      build/three.cjs
  2. 44 12
      build/three.js
  3. 0 0
      build/three.min.js
  4. 44 12
      build/three.module.js
  5. 0 0
      build/three.module.min.js

+ 44 - 12
build/three.cjs

@@ -11981,6 +11981,8 @@ class ShaderMaterial extends Material {
 		this.lights = false; // set to use scene lights
 		this.lights = false; // set to use scene lights
 		this.clipping = false; // set to use user-defined clipping planes
 		this.clipping = false; // set to use user-defined clipping planes
 
 
+		this.forceSinglePass = true;
+
 		this.extensions = {
 		this.extensions = {
 			derivatives: false, // set to use derivatives
 			derivatives: false, // set to use derivatives
 			fragDepth: false, // set to use fragment depth values
 			fragDepth: false, // set to use fragment depth values
@@ -26106,6 +26108,7 @@ class WebXRManager extends EventDispatcher {
 			const bottom2 = bottomFov * far / far2 * near2;
 			const bottom2 = bottomFov * far / far2 * near2;
 
 
 			camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
 			camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
+			camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 
 
 		}
 		}
 
 
@@ -26157,12 +26160,42 @@ class WebXRManager extends EventDispatcher {
 
 
 			}
 			}
 
 
-			cameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
+			// update projection matrix for proper view frustum culling
+
+			if ( cameras.length === 2 ) {
+
+				setProjectionFromUnion( cameraVR, cameraL, cameraR );
+
+			} else {
+
+				// assume single camera setup (AR)
+
+				cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+
+			}
 
 
 			// update user camera and its children
 			// update user camera and its children
 
 
-			camera.matrix.copy( cameraVR.matrix );
+			updateUserCamera( camera, cameraVR, parent );
+
+		};
+
+		function updateUserCamera( camera, cameraVR, parent ) {
+
+			if ( parent === null ) {
+
+				camera.matrix.copy( cameraVR.matrixWorld );
+
+			} else {
+
+				camera.matrix.copy( parent.matrixWorld );
+				camera.matrix.invert();
+				camera.matrix.multiply( cameraVR.matrixWorld );
+
+			}
+
 			camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 			camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
+			camera.updateMatrixWorld( true );
 
 
 			const children = camera.children;
 			const children = camera.children;
 
 
@@ -26172,21 +26205,17 @@ class WebXRManager extends EventDispatcher {
 
 
 			}
 			}
 
 
-			// update projection matrix for proper view frustum culling
-
-			if ( cameras.length === 2 ) {
+			camera.projectionMatrix.copy( cameraVR.projectionMatrix );
+			camera.projectionMatrixInverse.copy( cameraVR.projectionMatrixInverse );
 
 
-				setProjectionFromUnion( cameraVR, cameraL, cameraR );
+			if ( camera.isPerspectiveCamera ) {
 
 
-			} else {
-
-				// assume single camera setup (AR)
-
-				cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+				camera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );
+				camera.zoom = 1;
 
 
 			}
 			}
 
 
-		};
+		}
 
 
 		this.getCamera = function () {
 		this.getCamera = function () {
 
 
@@ -26305,12 +26334,15 @@ class WebXRManager extends EventDispatcher {
 					}
 					}
 
 
 					camera.matrix.fromArray( view.transform.matrix );
 					camera.matrix.fromArray( view.transform.matrix );
+					camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 					camera.projectionMatrix.fromArray( view.projectionMatrix );
 					camera.projectionMatrix.fromArray( view.projectionMatrix );
+					camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 					camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 					camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 
 
 					if ( i === 0 ) {
 					if ( i === 0 ) {
 
 
 						cameraVR.matrix.copy( camera.matrix );
 						cameraVR.matrix.copy( camera.matrix );
+						cameraVR.matrix.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
 
 
 					}
 					}
 
 

+ 44 - 12
build/three.js

@@ -11986,6 +11986,8 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 			this.lights = false; // set to use scene lights
 			this.lights = false; // set to use scene lights
 			this.clipping = false; // set to use user-defined clipping planes
 			this.clipping = false; // set to use user-defined clipping planes
 
 
+			this.forceSinglePass = true;
+
 			this.extensions = {
 			this.extensions = {
 				derivatives: false, // set to use derivatives
 				derivatives: false, // set to use derivatives
 				fragDepth: false, // set to use fragment depth values
 				fragDepth: false, // set to use fragment depth values
@@ -26111,6 +26113,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 				const bottom2 = bottomFov * far / far2 * near2;
 				const bottom2 = bottomFov * far / far2 * near2;
 
 
 				camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
 				camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
+				camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 
 
 			}
 			}
 
 
@@ -26162,12 +26165,42 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 				}
 				}
 
 
-				cameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
+				// update projection matrix for proper view frustum culling
+
+				if ( cameras.length === 2 ) {
+
+					setProjectionFromUnion( cameraVR, cameraL, cameraR );
+
+				} else {
+
+					// assume single camera setup (AR)
+
+					cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+
+				}
 
 
 				// update user camera and its children
 				// update user camera and its children
 
 
-				camera.matrix.copy( cameraVR.matrix );
+				updateUserCamera( camera, cameraVR, parent );
+
+			};
+
+			function updateUserCamera( camera, cameraVR, parent ) {
+
+				if ( parent === null ) {
+
+					camera.matrix.copy( cameraVR.matrixWorld );
+
+				} else {
+
+					camera.matrix.copy( parent.matrixWorld );
+					camera.matrix.invert();
+					camera.matrix.multiply( cameraVR.matrixWorld );
+
+				}
+
 				camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 				camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
+				camera.updateMatrixWorld( true );
 
 
 				const children = camera.children;
 				const children = camera.children;
 
 
@@ -26177,21 +26210,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 
 
 				}
 				}
 
 
-				// update projection matrix for proper view frustum culling
-
-				if ( cameras.length === 2 ) {
+				camera.projectionMatrix.copy( cameraVR.projectionMatrix );
+				camera.projectionMatrixInverse.copy( cameraVR.projectionMatrixInverse );
 
 
-					setProjectionFromUnion( cameraVR, cameraL, cameraR );
+				if ( camera.isPerspectiveCamera ) {
 
 
-				} else {
-
-					// assume single camera setup (AR)
-
-					cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+					camera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );
+					camera.zoom = 1;
 
 
 				}
 				}
 
 
-			};
+			}
 
 
 			this.getCamera = function () {
 			this.getCamera = function () {
 
 
@@ -26310,12 +26339,15 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
 						}
 						}
 
 
 						camera.matrix.fromArray( view.transform.matrix );
 						camera.matrix.fromArray( view.transform.matrix );
+						camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 						camera.projectionMatrix.fromArray( view.projectionMatrix );
 						camera.projectionMatrix.fromArray( view.projectionMatrix );
+						camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 						camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 						camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 
 
 						if ( i === 0 ) {
 						if ( i === 0 ) {
 
 
 							cameraVR.matrix.copy( camera.matrix );
 							cameraVR.matrix.copy( camera.matrix );
+							cameraVR.matrix.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
 
 
 						}
 						}
 
 

File diff suppressed because it is too large
+ 0 - 0
build/three.min.js


+ 44 - 12
build/three.module.js

@@ -11979,6 +11979,8 @@ class ShaderMaterial extends Material {
 		this.lights = false; // set to use scene lights
 		this.lights = false; // set to use scene lights
 		this.clipping = false; // set to use user-defined clipping planes
 		this.clipping = false; // set to use user-defined clipping planes
 
 
+		this.forceSinglePass = true;
+
 		this.extensions = {
 		this.extensions = {
 			derivatives: false, // set to use derivatives
 			derivatives: false, // set to use derivatives
 			fragDepth: false, // set to use fragment depth values
 			fragDepth: false, // set to use fragment depth values
@@ -26104,6 +26106,7 @@ class WebXRManager extends EventDispatcher {
 			const bottom2 = bottomFov * far / far2 * near2;
 			const bottom2 = bottomFov * far / far2 * near2;
 
 
 			camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
 			camera.projectionMatrix.makePerspective( left2, right2, top2, bottom2, near2, far2 );
+			camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 
 
 		}
 		}
 
 
@@ -26155,12 +26158,42 @@ class WebXRManager extends EventDispatcher {
 
 
 			}
 			}
 
 
-			cameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
+			// update projection matrix for proper view frustum culling
+
+			if ( cameras.length === 2 ) {
+
+				setProjectionFromUnion( cameraVR, cameraL, cameraR );
+
+			} else {
+
+				// assume single camera setup (AR)
+
+				cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+
+			}
 
 
 			// update user camera and its children
 			// update user camera and its children
 
 
-			camera.matrix.copy( cameraVR.matrix );
+			updateUserCamera( camera, cameraVR, parent );
+
+		};
+
+		function updateUserCamera( camera, cameraVR, parent ) {
+
+			if ( parent === null ) {
+
+				camera.matrix.copy( cameraVR.matrixWorld );
+
+			} else {
+
+				camera.matrix.copy( parent.matrixWorld );
+				camera.matrix.invert();
+				camera.matrix.multiply( cameraVR.matrixWorld );
+
+			}
+
 			camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 			camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
+			camera.updateMatrixWorld( true );
 
 
 			const children = camera.children;
 			const children = camera.children;
 
 
@@ -26170,21 +26203,17 @@ class WebXRManager extends EventDispatcher {
 
 
 			}
 			}
 
 
-			// update projection matrix for proper view frustum culling
-
-			if ( cameras.length === 2 ) {
+			camera.projectionMatrix.copy( cameraVR.projectionMatrix );
+			camera.projectionMatrixInverse.copy( cameraVR.projectionMatrixInverse );
 
 
-				setProjectionFromUnion( cameraVR, cameraL, cameraR );
+			if ( camera.isPerspectiveCamera ) {
 
 
-			} else {
-
-				// assume single camera setup (AR)
-
-				cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
+				camera.fov = RAD2DEG * 2 * Math.atan( 1 / camera.projectionMatrix.elements[ 5 ] );
+				camera.zoom = 1;
 
 
 			}
 			}
 
 
-		};
+		}
 
 
 		this.getCamera = function () {
 		this.getCamera = function () {
 
 
@@ -26303,12 +26332,15 @@ class WebXRManager extends EventDispatcher {
 					}
 					}
 
 
 					camera.matrix.fromArray( view.transform.matrix );
 					camera.matrix.fromArray( view.transform.matrix );
+					camera.matrix.decompose( camera.position, camera.quaternion, camera.scale );
 					camera.projectionMatrix.fromArray( view.projectionMatrix );
 					camera.projectionMatrix.fromArray( view.projectionMatrix );
+					camera.projectionMatrixInverse.copy( camera.projectionMatrix ).invert();
 					camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 					camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
 
 
 					if ( i === 0 ) {
 					if ( i === 0 ) {
 
 
 						cameraVR.matrix.copy( camera.matrix );
 						cameraVR.matrix.copy( camera.matrix );
+						cameraVR.matrix.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
 
 
 					}
 					}
 
 

File diff suppressed because it is too large
+ 0 - 0
build/three.module.min.js


Some files were not shown because too many files changed in this diff