Forráskód Böngészése

Merge remote-tracking branch 'upstream/master' into Development

Sebastien Vandenberghe 8 éve
szülő
commit
8c08c628d9
2 módosított fájl, 20 hozzáadás és 31 törlés
  1. 7 10
      inspector/src/adapters/MeshAdapter.ts
  2. 13 21
      src/Debug/babylon.axesViewer.ts

+ 7 - 10
inspector/src/adapters/MeshAdapter.ts

@@ -95,7 +95,7 @@ module INSPECTOR {
             var x = new BABYLON.Vector3(8, 0, 0);
             var y = new BABYLON.Vector3(0, 8, 0);
             var z = new BABYLON.Vector3(0, 0, 8);
-
+            
             // Draw an axis of the given color
             let _drawAxis = (color, start, end): BABYLON.LinesMesh => {
                 let axis = BABYLON.Mesh.CreateLines("###axis###", [
@@ -110,26 +110,23 @@ module INSPECTOR {
             // X axis
             let xAxis = _drawAxis(
                 BABYLON.Color3.Red(),
-                this._obj.getAbsolutePosition(),
-                BABYLON.Vector3.TransformCoordinates(x, m));
-            xAxis.position.subtractInPlace(this._obj.position);
+                BABYLON.Vector3.Zero(),
+                x);
             xAxis.parent = this._obj;
             this._axis.push(xAxis);
             // Y axis        
             let yAxis = _drawAxis(
                 BABYLON.Color3.Green(),
-                this._obj.getAbsolutePosition(),
-                BABYLON.Vector3.TransformCoordinates(y, m));
+                BABYLON.Vector3.Zero(),
+                y);
             yAxis.parent = this._obj;
-            yAxis.position.subtractInPlace(this._obj.position);
             this._axis.push(yAxis);
             // Z axis
             let zAxis = _drawAxis(
                 BABYLON.Color3.Blue(),
-                this._obj.getAbsolutePosition(),
-                BABYLON.Vector3.TransformCoordinates(z, m));
+                BABYLON.Vector3.Zero(),
+                z);
             zAxis.parent = this._obj;
-            zAxis.position.subtractInPlace(this._obj.position);
             this._axis.push(zAxis);
         }
     }

+ 13 - 21
src/Debug/babylon.axesViewer.ts

@@ -40,34 +40,26 @@
 
             var scaleLines = this.scaleLines;
 
-            var point1 = this._xline[0];
+            this._xmesh.position.copyFrom(position);
+            this._ymesh.position.copyFrom(position);
+            this._zmesh.position.copyFrom(position);
+
             var point2 = this._xline[1];
-            point1.x = position.x;
-            point1.y = position.y;
-            point1.z = position.z;
-            point2.x = point1.x + xaxis.x * scaleLines;
-            point2.y = point1.y + xaxis.y * scaleLines;
-            point2.z = point1.z + xaxis.z * scaleLines;
+            point2.x = xaxis.x * scaleLines;
+            point2.y = xaxis.y * scaleLines;
+            point2.z = xaxis.z * scaleLines;
             Mesh.CreateLines(null, this._xline, null, null, this._xmesh);
 
-            point1 = this._yline[0];
             point2 = this._yline[1];
-            point1.x = position.x;
-            point1.y = position.y;
-            point1.z = position.z;
-            point2.x = point1.x + yaxis.x * scaleLines;
-            point2.y = point1.y + yaxis.y * scaleLines;
-            point2.z = point1.z + yaxis.z * scaleLines;
+            point2.x = yaxis.x * scaleLines;
+            point2.y = yaxis.y * scaleLines;
+            point2.z = yaxis.z * scaleLines;
             Mesh.CreateLines(null, this._yline, null, null, this._ymesh);
 
-            point1 = this._zline[0];
             point2 = this._zline[1];
-            point1.x = position.x;
-            point1.y = position.y;
-            point1.z = position.z;
-            point2.x = point1.x + zaxis.x * scaleLines;
-            point2.y = point1.y + zaxis.y * scaleLines;
-            point2.z = point1.z + zaxis.z * scaleLines;
+            point2.x = zaxis.x * scaleLines;
+            point2.y = zaxis.y * scaleLines;
+            point2.z = zaxis.z * scaleLines;
             Mesh.CreateLines(null, this._zline, null, null, this._zmesh);
 
         }