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

Added PlanePanel to GUI3d

David Catuhe 7 éve
szülő
commit
32ac35caf8

+ 1 - 0
Tools/Gulp/config.json

@@ -1754,6 +1754,7 @@
                     "../../gui/src/3D/controls/stackPanel3D.ts",
                     "../../gui/src/3D/controls/volumeBasedPanel.ts",
                     "../../gui/src/3D/controls/spherePanel.ts",
+                    "../../gui/src/3D/controls/planePanel.ts",
                     "../../gui/src/3D/controls/cylinderPanel.ts"
                 ],
                 "shaderFiles": [

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 13288 - 13288
dist/preview release/babylon.d.ts


+ 10 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -2545,6 +2545,16 @@ declare module BABYLON.GUI {
 
 declare module BABYLON.GUI {
     /**
+     * Class used to create a container panel deployed on the surface of a plane
+     */
+    class PlanePanel extends VolumeBasedPanel {
+        protected _mapGridNode(control: Control3D, nodePosition: Vector3): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    /**
      * Class used to create a container panel deployed on the surface of a cylinder
      */
     class CylinderPanel extends VolumeBasedPanel {

+ 37 - 0
dist/preview release/gui/babylon.gui.js

@@ -8578,6 +8578,43 @@ var BABYLON;
     var GUI;
     (function (GUI) {
         /**
+         * Class used to create a container panel deployed on the surface of a plane
+         */
+        var PlanePanel = /** @class */ (function (_super) {
+            __extends(PlanePanel, _super);
+            function PlanePanel() {
+                return _super !== null && _super.apply(this, arguments) || this;
+            }
+            PlanePanel.prototype._mapGridNode = function (control, nodePosition) {
+                var mesh = control.mesh;
+                if (!mesh) {
+                    return;
+                }
+                switch (this.orientation) {
+                    case GUI.Container3D.FACEORIGIN_ORIENTATION:
+                    case GUI.Container3D.FACEFORWARD_ORIENTATION:
+                        mesh.lookAt(new BABYLON.Vector3(0, 0, -1));
+                        break;
+                    case GUI.Container3D.FACEFORWARDREVERSED_ORIENTATION:
+                    case GUI.Container3D.FACEORIGINREVERSED_ORIENTATION:
+                        mesh.lookAt(new BABYLON.Vector3(0, 0, 1));
+                        break;
+                }
+                control.position = nodePosition.clone();
+            };
+            return PlanePanel;
+        }(GUI.VolumeBasedPanel));
+        GUI.PlanePanel = PlanePanel;
+    })(GUI = BABYLON.GUI || (BABYLON.GUI = {}));
+})(BABYLON || (BABYLON = {}));
+
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+
+var BABYLON;
+(function (BABYLON) {
+    var GUI;
+    (function (GUI) {
+        /**
          * Class used to create a container panel deployed on the surface of a cylinder
          */
         var CylinderPanel = /** @class */ (function (_super) {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 10 - 0
dist/preview release/gui/babylon.gui.module.d.ts

@@ -2550,6 +2550,16 @@ declare module BABYLON.GUI {
 
 declare module BABYLON.GUI {
     /**
+     * Class used to create a container panel deployed on the surface of a plane
+     */
+    class PlanePanel extends VolumeBasedPanel {
+        protected _mapGridNode(control: Control3D, nodePosition: Vector3): void;
+    }
+}
+
+
+declare module BABYLON.GUI {
+    /**
      * Class used to create a container panel deployed on the surface of a cylinder
      */
     class CylinderPanel extends VolumeBasedPanel {

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 5 - 5
dist/preview release/inspector/babylon.inspector.bundle.js


+ 29 - 0
gui/src/3D/controls/planePanel.ts

@@ -0,0 +1,29 @@
+/// <reference path="../../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON.GUI {
+    /**
+     * Class used to create a container panel deployed on the surface of a plane
+     */
+    export class PlanePanel extends VolumeBasedPanel {    
+        protected _mapGridNode(control: Control3D, nodePosition: Vector3) {            
+            let mesh = control.mesh;
+
+            if (!mesh) {
+                return;
+            }
+
+            switch (this.orientation) {
+                case Container3D.FACEORIGIN_ORIENTATION:
+                case Container3D.FACEFORWARD_ORIENTATION:
+                    mesh.lookAt(new BABYLON.Vector3(0, 0, -1));
+                    break;
+                case Container3D.FACEFORWARDREVERSED_ORIENTATION:
+                case Container3D.FACEORIGINREVERSED_ORIENTATION:
+                    mesh.lookAt(new BABYLON.Vector3(0, 0, 1));
+                    break;
+            }
+            
+            control.position = nodePosition.clone();
+        }
+    }
+}