@needle-tools/three 0.162.5 → 0.162.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/three",
3
- "version": "0.162.5",
3
+ "version": "0.162.7",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.cjs",
@@ -74,6 +74,8 @@ class WebXRManager extends EventDispatcher {
74
74
 
75
75
  this.isPresenting = false;
76
76
 
77
+ this.controllerAutoUpdate = true;
78
+
77
79
  this.getController = function ( index ) {
78
80
 
79
81
  let controller = controllers[ index ];
@@ -161,7 +163,7 @@ class WebXRManager extends EventDispatcher {
161
163
 
162
164
  controllerInputSources[ i ] = null;
163
165
 
164
- controllers[ i ].disconnect( inputSource );
166
+ controllers[ i ]?.disconnect( inputSource );
165
167
 
166
168
  }
167
169
 
@@ -393,7 +395,7 @@ class WebXRManager extends EventDispatcher {
393
395
  if ( index >= 0 ) {
394
396
 
395
397
  controllerInputSources[ index ] = null;
396
- controllers[ index ].disconnect( inputSource );
398
+ controllers[ index ]?.disconnect( inputSource );
397
399
 
398
400
  }
399
401
 
@@ -778,15 +780,19 @@ class WebXRManager extends EventDispatcher {
778
780
 
779
781
  //
780
782
 
781
- for ( let i = 0; i < controllers.length; i ++ ) {
782
-
783
- const inputSource = controllerInputSources[ i ];
784
- const controller = controllers[ i ];
785
-
786
- if ( inputSource !== null && controller !== undefined ) {
783
+ if ( scope.controllerAutoUpdate ) {
787
784
 
788
- controller.update( inputSource, frame, customReferenceSpace || referenceSpace );
785
+ for ( let i = 0; i < controllers.length; i ++ ) {
789
786
 
787
+ const inputSource = controllerInputSources[ i ];
788
+ const controller = controllers[ i ];
789
+
790
+ if ( inputSource !== null && controller !== undefined ) {
791
+
792
+ controller.update( inputSource, frame, customReferenceSpace || referenceSpace );
793
+
794
+ }
795
+
790
796
  }
791
797
 
792
798
  }