Bläddra i källkod

dont modify pivot on attach mesh

Trevor Baron 7 år sedan
förälder
incheckning
ba51a521b2
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 1 1
      dist/preview release/what's new.md
  2. 2 0
      src/Gizmos/babylon.boundingBoxGizmo.ts

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

@@ -173,7 +173,7 @@
 - Exiting VR can result in messed up view ([TrevorDev](https://github.com/TrevorDev))
 - Dispose existing gazeTrackers when setting a new one ([TrevorDev](https://github.com/TrevorDev))
 - Set missing parentId in Mesh.serialize() for instances ([julien-moreau](https://github.com/julien-moreau))
-- Do not modify pivot when using bounding box gizmo ([TrevorDev](https://github.com/TrevorDev))
+- Do not modify pivot point when using bounding box gizmo ([TrevorDev](https://github.com/TrevorDev))
 - GPUParticleSystem does not get stuck in burst loop when stopped and started ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine

+ 2 - 0
src/Gizmos/babylon.boundingBoxGizmo.ts

@@ -315,8 +315,10 @@ module BABYLON {
             if (value) {
                 // Reset anchor mesh to match attached mesh's scale
                 // This is needed to avoid invalid box/sphere position on first drag
+                this.removeAndStorePivotPoint();
                 this._anchorMesh.addChild(value);
                 this._anchorMesh.removeChild(value);
+                this.restorePivotPoint();
                 this.updateBoundingBox();
             }
         }