ソースを参照

Updated builds.

Mr.doob 3 年 前
コミット
f45ba9be48
4 ファイル変更103 行追加87 行削除
  1. 29 25
      build/three.cjs
  2. 29 25
      build/three.js
  3. 0 0
      build/three.min.js
  4. 45 37
      build/three.module.js

+ 29 - 25
build/three.cjs

@@ -18163,31 +18163,6 @@ class WebXRController {
 		const hand = this._hand;
 
 		if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
-			if (targetRay !== null) {
-				inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);
-
-				if (inputPose !== null) {
-					targetRay.matrix.fromArray(inputPose.transform.matrix);
-					targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
-
-					if (inputPose.linearVelocity) {
-						targetRay.hasLinearVelocity = true;
-						targetRay.linearVelocity.copy(inputPose.linearVelocity);
-					} else {
-						targetRay.hasLinearVelocity = false;
-					}
-
-					if (inputPose.angularVelocity) {
-						targetRay.hasAngularVelocity = true;
-						targetRay.angularVelocity.copy(inputPose.angularVelocity);
-					} else {
-						targetRay.hasAngularVelocity = false;
-					}
-
-					this.dispatchEvent(_moveEvent);
-				}
-			}
-
 			if (hand && inputSource.hand) {
 				handPose = true;
 
@@ -18263,6 +18238,35 @@ class WebXRController {
 					}
 				}
 			}
+
+			if (targetRay !== null) {
+				inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
+
+				if (inputPose === null && gripPose !== null) {
+					inputPose = gripPose;
+				}
+
+				if (inputPose !== null) {
+					targetRay.matrix.fromArray(inputPose.transform.matrix);
+					targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
+
+					if (inputPose.linearVelocity) {
+						targetRay.hasLinearVelocity = true;
+						targetRay.linearVelocity.copy(inputPose.linearVelocity);
+					} else {
+						targetRay.hasLinearVelocity = false;
+					}
+
+					if (inputPose.angularVelocity) {
+						targetRay.hasAngularVelocity = true;
+						targetRay.angularVelocity.copy(inputPose.angularVelocity);
+					} else {
+						targetRay.hasAngularVelocity = false;
+					}
+
+					this.dispatchEvent(_moveEvent);
+				}
+			}
 		}
 
 		if (targetRay !== null) {

+ 29 - 25
build/three.js

@@ -18165,31 +18165,6 @@
 			const hand = this._hand;
 
 			if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
-				if (targetRay !== null) {
-					inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);
-
-					if (inputPose !== null) {
-						targetRay.matrix.fromArray(inputPose.transform.matrix);
-						targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
-
-						if (inputPose.linearVelocity) {
-							targetRay.hasLinearVelocity = true;
-							targetRay.linearVelocity.copy(inputPose.linearVelocity);
-						} else {
-							targetRay.hasLinearVelocity = false;
-						}
-
-						if (inputPose.angularVelocity) {
-							targetRay.hasAngularVelocity = true;
-							targetRay.angularVelocity.copy(inputPose.angularVelocity);
-						} else {
-							targetRay.hasAngularVelocity = false;
-						}
-
-						this.dispatchEvent(_moveEvent);
-					}
-				}
-
 				if (hand && inputSource.hand) {
 					handPose = true;
 
@@ -18265,6 +18240,35 @@
 						}
 					}
 				}
+
+				if (targetRay !== null) {
+					inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
+
+					if (inputPose === null && gripPose !== null) {
+						inputPose = gripPose;
+					}
+
+					if (inputPose !== null) {
+						targetRay.matrix.fromArray(inputPose.transform.matrix);
+						targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
+
+						if (inputPose.linearVelocity) {
+							targetRay.hasLinearVelocity = true;
+							targetRay.linearVelocity.copy(inputPose.linearVelocity);
+						} else {
+							targetRay.hasLinearVelocity = false;
+						}
+
+						if (inputPose.angularVelocity) {
+							targetRay.hasAngularVelocity = true;
+							targetRay.angularVelocity.copy(inputPose.angularVelocity);
+						} else {
+							targetRay.hasAngularVelocity = false;
+						}
+
+						this.dispatchEvent(_moveEvent);
+					}
+				}
 			}
 
 			if (targetRay !== null) {

ファイルの差分が大きいため隠しています
+ 0 - 0
build/three.min.js


+ 45 - 37
build/three.module.js

@@ -24679,43 +24679,6 @@ class WebXRController {
 
 		if ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {
 
-			if ( targetRay !== null ) {
-
-				inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
-
-				if ( inputPose !== null ) {
-
-					targetRay.matrix.fromArray( inputPose.transform.matrix );
-					targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
-
-					if ( inputPose.linearVelocity ) {
-
-						targetRay.hasLinearVelocity = true;
-						targetRay.linearVelocity.copy( inputPose.linearVelocity );
-
-					} else {
-
-						targetRay.hasLinearVelocity = false;
-
-					}
-
-					if ( inputPose.angularVelocity ) {
-
-						targetRay.hasAngularVelocity = true;
-						targetRay.angularVelocity.copy( inputPose.angularVelocity );
-
-					} else {
-
-						targetRay.hasAngularVelocity = false;
-
-					}
-
-					this.dispatchEvent( _moveEvent );
-
-				}
-
-			}
-
 			if ( hand && inputSource.hand ) {
 
 				handPose = true;
@@ -24820,6 +24783,51 @@ class WebXRController {
 
 			}
 
+			if ( targetRay !== null ) {
+
+				inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
+
+				// Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
+				if ( inputPose === null && gripPose !== null ) {
+
+					inputPose = gripPose;
+
+				}
+
+				if ( inputPose !== null ) {
+
+					targetRay.matrix.fromArray( inputPose.transform.matrix );
+					targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
+
+					if ( inputPose.linearVelocity ) {
+
+						targetRay.hasLinearVelocity = true;
+						targetRay.linearVelocity.copy( inputPose.linearVelocity );
+
+					} else {
+
+						targetRay.hasLinearVelocity = false;
+
+					}
+
+					if ( inputPose.angularVelocity ) {
+
+						targetRay.hasAngularVelocity = true;
+						targetRay.angularVelocity.copy( inputPose.angularVelocity );
+
+					} else {
+
+						targetRay.hasAngularVelocity = false;
+
+					}
+
+					this.dispatchEvent( _moveEvent );
+
+				}
+
+			}
+
+
 		}
 
 		if ( targetRay !== null ) {

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません