Browse Source

Merge pull request #5398 from TrevorDev/gizmoSize

Gizmo size
David Catuhe 6 years ago
parent
commit
0258aae92d
2 changed files with 2 additions and 1 deletions
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Gizmos/babylon.gizmo.ts

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

@@ -58,6 +58,7 @@
 
 ## Bug fixes
 - Refocusing on input gui with pointer events ([TrevorDev](https://github.com/TrevorDev))
+- Gizmo scaling not consistent when camera is parented ([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/Gizmos/babylon.gizmo.ts

@@ -111,7 +111,7 @@ module BABYLON {
                     this._rootMesh.position.copyFrom(this.attachedMesh.absolutePosition);
                 }
                 if (this._updateScale && this.gizmoLayer.utilityLayerScene.activeCamera && this.attachedMesh) {
-                    var cameraPosition = this.gizmoLayer.utilityLayerScene.activeCamera.position;
+                    var cameraPosition = this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition;
                     if ((<WebVRFreeCamera>this.gizmoLayer.utilityLayerScene.activeCamera).devicePosition) {
                         cameraPosition = (<WebVRFreeCamera>this.gizmoLayer.utilityLayerScene.activeCamera).devicePosition;
                     }