Selaa lähdekoodia

Merge pull request #5739 from TrevorDev/laserDistanceVR

fix laser distance
David Catuhe 6 vuotta sitten
vanhempi
commit
12fa36b345
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 1 1
      dist/preview release/what's new.md
  2. 2 2
      src/Cameras/VR/vrExperienceHelper.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -124,7 +124,7 @@
 - Gizmo scaling not consistent when camera is parented ([TrevorDev](https://github.com/TrevorDev))
 - Context loss causing unexpected results with dynamic textures, geometries with the same name and reflectionTextures ([TrevorDev](https://github.com/TrevorDev))
 - CreateScreenshotUsingRenderTarget stretches mirror textures when setting both width and height ([TrevorDev](https://github.com/TrevorDev))
-- VR helper only updating vr cameras position when entering vr, rotation was missing ([TrevorDev](https://github.com/TrevorDev))
+- VR helper only updating vr cameras position when entering vr, rotation was missing, laser distance stopped working ([TrevorDev](https://github.com/TrevorDev))
 - Fix VR controllers after gltfLoader transformNode change ([TrevorDev](https://github.com/TrevorDev))
 - Bounding Box fixedDragMeshScreenSize stopped working and allow rotating through bounding box ([TrevorDev](https://github.com/TrevorDev))
 - VR helper would rotate non vr camera while in VR ([TrevorDev](https://github.com/TrevorDev))

+ 2 - 2
src/Cameras/VR/vrExperienceHelper.ts

@@ -151,7 +151,7 @@ class VRExperienceHelperGazer implements IDisposable {
     }
 
     /** @hidden */
-    public _updatePointerDistance() {
+    public _updatePointerDistance(distance: number = 100) {
     }
 
     public dispose() {
@@ -1841,7 +1841,7 @@ export class VRExperienceHelper {
             }
 
             // Changing the size of the laser pointer based on the distance from the targetted point
-            gazer._updatePointerDistance();
+            gazer._updatePointerDistance(hit.distance);
         }
         else {
             gazer._updatePointerDistance();