Browse Source

Fix pointer duplication issue in WebXR Hand Examples (#24142)

* Fix pointer duplication issue in WebXR Hand Examples

* Update OculusHandPointerModel.js

Co-authored-by: mrdoob <[email protected]>
DM 3 năm trước cách đây
mục cha
commit
fc357b9cec
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      examples/jsm/webxr/OculusHandPointerModel.js

+ 6 - 1
examples/jsm/webxr/OculusHandPointerModel.js

@@ -46,12 +46,17 @@ class OculusHandPointerModel extends THREE.Object3D {
 		hand.addEventListener( 'connected', ( event ) => {
 
 			const xrInputSource = event.data;
+
 			if ( xrInputSource.hand ) {
 
 				this.visible = true;
 				this.xrInputSource = xrInputSource;
 
-				this.createPointer();
+				if ( this.pointerObject === null ) {
+
+					this.createPointer();
+
+				}
 
 			}