瀏覽代碼

scaling using absolute position

Trevor Baron 7 年之前
父節點
當前提交
22861c8f98
共有 1 個文件被更改,包括 3 次插入1 次删除
  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);
                             }
                         })