فهرست منبع

fix touchpad dot

Raanan Weber 5 سال پیش
والد
کامیت
a53ac5e2e6
1فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 5 3
      src/Cameras/XR/motionController/webXRProfiledMotionController.ts

+ 5 - 3
src/Cameras/XR/motionController/webXRProfiledMotionController.ts

@@ -62,9 +62,9 @@ export class WebXRProfiledMotionController extends WebXRAbstractMotionController
                     this._buttonMeshMapping[type].states[visualResponseKey] = {
                         valueMesh: this._getChildByName(this.rootMesh!, nameOfMesh)
                     };
-                    if (componentInLayout.type === WebXRControllerComponent.TOUCHPAD && !this._touchDots[visualResponseKey]) {
+                    if (type === WebXRControllerComponent.TOUCHPAD && !this._touchDots[visualResponseKey]) {
                         const dot = SphereBuilder.CreateSphere(visualResponseKey + 'dot', {
-                            diameter: 0.001,
+                            diameter: 0.0015,
                             segments: 8
                         }, this.scene);
                         dot.material = new StandardMaterial(visualResponseKey + 'mat', this.scene);
@@ -121,7 +121,9 @@ export class WebXRProfiledMotionController extends WebXRAbstractMotionController
                 } else {
                     // visibility
                     meshes.states[visualResponseKey].valueMesh.isVisible = component.touched || component.pressed;
-                    this._touchDots[visualResponseKey].isVisible = component.touched || component.pressed;
+                    if (this._touchDots[visualResponseKey]) {
+                        this._touchDots[visualResponseKey].isVisible = component.touched || component.pressed;
+                    }
                 }
             });
         });