|
@@ -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 ) {
|