Explorar o código

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 %!s(int64=3) %!d(string=hai) anos
pai
achega
fc357b9cec
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  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();
+
+				}
 
 			}