Browse Source

whats new

Trevor Baron 6 năm trước cách đây
mục cha
commit
f0db253815

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

@@ -66,6 +66,7 @@
 - Make onscreen joystick's canvas public ([TrevorDev](https://github.com/TrevorDev))
 - Added `Tools.CustomRequestHeaders`, `Tools.UseCustomRequestHeaders`, `Tools.InjectCustomRequestHeaders` to send Custom Request Headers alongside XMLHttpRequest's i.e. when loading files (Tools.Loadfile) from resources requiring special headers like 'Authorization' ([susares](https://github.com/susares))
 - Added `.serialize` and `.Parse` functions in `ReflectionProbe` to retrieve reflection probes when parsing a previously serialized material ([julien-moreau](https://github.com/julien-moreau))
+- GizmoManager clearGizmoOnEmptyPointerEvent options and onAttachedToMeshObservable event ([TrevorDev](https://github.com/TrevorDev))
 ### glTF Loader
 
 - Added support for mesh instancing for improved performance when multiple nodes point to the same mesh ([bghgary](https://github.com/bghgary))

+ 10 - 12
src/Debug/babylon.axesViewer.ts

@@ -54,7 +54,7 @@ module BABYLON.Debug {
             var blueColoredMaterial = new BABYLON.StandardMaterial("", scene);
             blueColoredMaterial.disableLighting = true;
             blueColoredMaterial.emissiveColor = BABYLON.Color3.Blue().scale(0.5);
-            
+
             this._xmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, redColoredMaterial);
             this._ymesh = BABYLON.AxisDragGizmo._CreateArrow(scene, greenColoredMaterial);
             this._zmesh = BABYLON.AxisDragGizmo._CreateArrow(scene, blueColoredMaterial);
@@ -84,28 +84,26 @@ module BABYLON.Debug {
         public update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void {
             if (this._xmesh) {
                 this._xmesh.position.copyFrom(position);
-                
-                var cross = Vector3.Cross(Vector3.Forward(), xaxis)
-                this._xmesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1+Vector3.Dot(Vector3.Forward(), xaxis));
+
+                var cross = Vector3.Cross(Vector3.Forward(), xaxis);
+                this._xmesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1 + Vector3.Dot(Vector3.Forward(), xaxis));
                 this._xmesh.rotationQuaternion!.normalize();
             }
             if (this._ymesh) {
                 this._ymesh.position.copyFrom(position);
-                
-                var cross = Vector3.Cross(Vector3.Forward(), yaxis)
-                this._ymesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1+Vector3.Dot(Vector3.Forward(), yaxis));
+
+                var cross = Vector3.Cross(Vector3.Forward(), yaxis);
+                this._ymesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1 + Vector3.Dot(Vector3.Forward(), yaxis));
                 this._ymesh.rotationQuaternion!.normalize();
             }
             if (this._zmesh) {
                 this._zmesh.position.copyFrom(position);
-                
-                var cross = Vector3.Cross(Vector3.Forward(), zaxis)
-                this._zmesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1+Vector3.Dot(Vector3.Forward(), zaxis));
+
+                var cross = Vector3.Cross(Vector3.Forward(), zaxis);
+                this._zmesh.rotationQuaternion!.set(cross.x, cross.y, cross.z, 1 + Vector3.Dot(Vector3.Forward(), zaxis));
                 this._zmesh.rotationQuaternion!.normalize();
             }
 
-            
-
         }
 
         /** Releases resources */

+ 1 - 1
src/Gizmos/babylon.axisDragGizmo.ts

@@ -19,7 +19,7 @@ module BABYLON {
         public onSnapObservable = new Observable<{snapDistance: number}>();
 
         /** @hidden */
-        public static _CreateArrow(scene:Scene, material:StandardMaterial){
+        public static _CreateArrow(scene: Scene, material: StandardMaterial) {
             var arrow = new BABYLON.AbstractMesh("", scene);
             var arrowMesh = BABYLON.MeshBuilder.CreateCylinder("yPosMesh", {diameterTop: 0, height: 1.5, diameterBottom: 0.75, tessellation: 96}, scene);
             var arrowTail = BABYLON.MeshBuilder.CreateLines("yPosMesh", {points: [new Vector3(0, 0, 0), new Vector3(0, 1.1, 0)]}, scene);