Explorar o código

Don't update FPS when in Frame and in XR

Raanan Weber %!s(int64=5) %!d(string=hai) anos
pai
achega
74f6af593b
Modificáronse 2 ficheiros con 4 adicións e 2 borrados
  1. 3 1
      Playground/js/frame.js
  2. 1 1
      dist/preview release/what's new.md

+ 3 - 1
Playground/js/frame.js

@@ -118,7 +118,9 @@ run = function () {
                 if (scene.activeCamera || scene.activeCameras.length > 0) {
                     scene.render();
                 }
-                if (fpsLabel) {
+                if (fpsLabel && !(scene.activeCamera && 
+                    scene.activeCamera.getClassName && 
+                    scene.activeCamera.getClassName() === 'WebXRCamera')) {
                     fpsLabel.innerHTML = engine.getFps().toFixed() + " fps";
                 }
             }.bind(this));

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

@@ -63,7 +63,7 @@
 
 - Added optional ray and mesh selection predicates to `WebXRControllerPointerSelection` ([Exolun](https://github.com/Exolun))
 - Implemented the new WebXR HitTest API ([#7364](https://github.com/BabylonJS/Babylon.js/issues/7364)) ([RaananW](https://github.com/RaananW))
-- Playground doesn't update FPS when in XR ([#7875](https://github.com/BabylonJS/Babylon.js/issues/7875)) ([RaananW](https://github.com/RaananW))
+- Playground doesn't update FPS when in XR in main and frame ([#7875](https://github.com/BabylonJS/Babylon.js/issues/7875)) ([RaananW](https://github.com/RaananW))
 
 ### Collisions