Przeglądaj źródła

scaling using absolute position

Trevor Baron 7 lat temu
rodzic
commit
22861c8f98
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      src/Gizmos/babylon.boundingBoxGizmo.ts

+ 3 - 1
src/Gizmos/babylon.boundingBoxGizmo.ts

@@ -12,6 +12,7 @@ module BABYLON {
         private _scaleDragSpeed = 0.2;
 
         private _tmpQuaternion = new Quaternion();
+        private _tmpVector = new Vector3(0,0,0);
         /**
          * Creates an BoundingBoxGizmo
          * @param gizmoLayer The utility layer the gizmo will be added to
@@ -134,7 +135,8 @@ module BABYLON {
                                 
                                 // Update scale and position
                                 this.attachedMesh.scaling.addInPlace(deltaScale);
-                                this.attachedMesh.position.addInPlace(worldMoveDirection);
+                                this.attachedMesh.getAbsolutePosition().addToRef(worldMoveDirection, this._tmpVector)
+                                this.attachedMesh.setAbsolutePosition(this._tmpVector);
                             }
                         })