Selaa lähdekoodia

Merge pull request #5752 from TrevorDev/gizmoRenderingActiveCamera

use last active camera in utility layer
David Catuhe 6 vuotta sitten
vanhempi
commit
070988fd8b
2 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Rendering/utilityLayerRenderer.ts

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

@@ -148,6 +148,7 @@
 - Fix more case sensitive paths ([mrdunk](https://github.com))
 - Attaching a BoundingBoxGizmo on a child should not remove its parent ([TrevorDev](https://github.com/TrevorDev)))
 - AmmoJS fix include issue caused after modules update and use world contact point to be consistent with oimo and cannon ([TrevorDev](https://github.com/TrevorDev)))
+- Utility layer should render on last active camera ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 1 - 1
src/Rendering/utilityLayerRenderer.ts

@@ -265,7 +265,7 @@ export class UtilityLayerRenderer implements IDisposable {
 
     private _updateCamera() {
         if (this.originalScene.activeCameras.length > 1) {
-            this.utilityLayerScene.activeCamera = this.originalScene.activeCameras[0];
+            this.utilityLayerScene.activeCamera = this.originalScene.activeCameras[this.originalScene.activeCameras.length - 1];
         } else {
             this.utilityLayerScene.activeCamera = this.originalScene.activeCamera;
         }