David Catuhe před 7 roky
rodič
revize
d546e8cbb6

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3148 - 3124
Playground/babylon.d.txt


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3133 - 3109
dist/preview release/babylon.d.ts


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 7 - 7
dist/preview release/babylon.js


+ 48 - 0
dist/preview release/babylon.max.js

@@ -90680,6 +90680,10 @@ var BABYLON;
             this._scaleFactor = 3;
             this._tmpMatrix = new BABYLON.Matrix();
             /**
+             * If a custom mesh has been set (Default: false)
+             */
+            this._customMeshSet = false;
+            /**
              * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
              */
             this.updateGizmoRotationToMatchAttachedMesh = true;
@@ -90748,6 +90752,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Disposes and replaces the current meshes in the gizmo with the specified mesh
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        Gizmo.prototype.setCustomMesh = function (mesh) {
+            if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
+                throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
+            }
+            this._rootMesh.getChildMeshes().forEach(function (c) {
+                c.dispose();
+            });
+            mesh.parent = this._rootMesh;
+            this._customMeshSet = true;
+        };
         Gizmo.prototype._attachedMeshChanged = function (value) {
         };
         /**
@@ -90845,6 +90863,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -90965,6 +90986,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91122,6 +91146,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91210,6 +91237,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        PositionGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return PositionGizmo;
     }(BABYLON.Gizmo));
     BABYLON.PositionGizmo = PositionGizmo;
@@ -91271,6 +91305,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        RotationGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return RotationGizmo;
     }(BABYLON.Gizmo));
     BABYLON.RotationGizmo = RotationGizmo;
@@ -91746,6 +91787,13 @@ var BABYLON;
             box.visibility = 0;
             return box;
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        BoundingBoxGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo");
+        };
         return BoundingBoxGizmo;
     }(BABYLON.Gizmo));
     BABYLON.BoundingBoxGizmo = BoundingBoxGizmo;

+ 48 - 0
dist/preview release/babylon.no-module.max.js

@@ -90647,6 +90647,10 @@ var BABYLON;
             this._scaleFactor = 3;
             this._tmpMatrix = new BABYLON.Matrix();
             /**
+             * If a custom mesh has been set (Default: false)
+             */
+            this._customMeshSet = false;
+            /**
              * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
              */
             this.updateGizmoRotationToMatchAttachedMesh = true;
@@ -90715,6 +90719,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Disposes and replaces the current meshes in the gizmo with the specified mesh
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        Gizmo.prototype.setCustomMesh = function (mesh) {
+            if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
+                throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
+            }
+            this._rootMesh.getChildMeshes().forEach(function (c) {
+                c.dispose();
+            });
+            mesh.parent = this._rootMesh;
+            this._customMeshSet = true;
+        };
         Gizmo.prototype._attachedMeshChanged = function (value) {
         };
         /**
@@ -90812,6 +90830,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -90932,6 +90953,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91089,6 +91113,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91177,6 +91204,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        PositionGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return PositionGizmo;
     }(BABYLON.Gizmo));
     BABYLON.PositionGizmo = PositionGizmo;
@@ -91238,6 +91272,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        RotationGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return RotationGizmo;
     }(BABYLON.Gizmo));
     BABYLON.RotationGizmo = RotationGizmo;
@@ -91713,6 +91754,13 @@ var BABYLON;
             box.visibility = 0;
             return box;
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        BoundingBoxGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo");
+        };
         return BoundingBoxGizmo;
     }(BABYLON.Gizmo));
     BABYLON.BoundingBoxGizmo = BoundingBoxGizmo;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 7 - 7
dist/preview release/babylon.worker.js


+ 48 - 0
dist/preview release/es6.js

@@ -90647,6 +90647,10 @@ var BABYLON;
             this._scaleFactor = 3;
             this._tmpMatrix = new BABYLON.Matrix();
             /**
+             * If a custom mesh has been set (Default: false)
+             */
+            this._customMeshSet = false;
+            /**
              * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
              */
             this.updateGizmoRotationToMatchAttachedMesh = true;
@@ -90715,6 +90719,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Disposes and replaces the current meshes in the gizmo with the specified mesh
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        Gizmo.prototype.setCustomMesh = function (mesh) {
+            if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
+                throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
+            }
+            this._rootMesh.getChildMeshes().forEach(function (c) {
+                c.dispose();
+            });
+            mesh.parent = this._rootMesh;
+            this._customMeshSet = true;
+        };
         Gizmo.prototype._attachedMeshChanged = function (value) {
         };
         /**
@@ -90812,6 +90830,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -90932,6 +90953,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91089,6 +91113,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91177,6 +91204,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        PositionGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return PositionGizmo;
     }(BABYLON.Gizmo));
     BABYLON.PositionGizmo = PositionGizmo;
@@ -91238,6 +91272,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        RotationGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return RotationGizmo;
     }(BABYLON.Gizmo));
     BABYLON.RotationGizmo = RotationGizmo;
@@ -91713,6 +91754,13 @@ var BABYLON;
             box.visibility = 0;
             return box;
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        BoundingBoxGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo");
+        };
         return BoundingBoxGizmo;
     }(BABYLON.Gizmo));
     BABYLON.BoundingBoxGizmo = BoundingBoxGizmo;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 7 - 7
dist/preview release/viewer/babylon.viewer.js


+ 48 - 0
dist/preview release/viewer/babylon.viewer.max.js

@@ -90768,6 +90768,10 @@ var BABYLON;
             this._scaleFactor = 3;
             this._tmpMatrix = new BABYLON.Matrix();
             /**
+             * If a custom mesh has been set (Default: false)
+             */
+            this._customMeshSet = false;
+            /**
              * If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
              */
             this.updateGizmoRotationToMatchAttachedMesh = true;
@@ -90836,6 +90840,20 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        /**
+         * Disposes and replaces the current meshes in the gizmo with the specified mesh
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        Gizmo.prototype.setCustomMesh = function (mesh) {
+            if (mesh.getScene() != this.gizmoLayer.utilityLayerScene) {
+                throw "When setting a custom mesh on a gizmo, the custom meshes scene must be the same as the gizmos (eg. gizmo.gizmoLayer.utilityLayerScene)";
+            }
+            this._rootMesh.getChildMeshes().forEach(function (c) {
+                c.dispose();
+            });
+            mesh.parent = this._rootMesh;
+            this._customMeshSet = true;
+        };
         Gizmo.prototype._attachedMeshChanged = function (value) {
         };
         /**
@@ -90933,6 +90951,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91053,6 +91074,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91210,6 +91234,9 @@ var BABYLON;
                 }
             });
             _this._pointerObserver = gizmoLayer.utilityLayerScene.onPointerObservable.add(function (pointerInfo, eventState) {
+                if (_this._customMeshSet) {
+                    return;
+                }
                 if (pointerInfo.pickInfo && (_this._rootMesh.getChildMeshes().indexOf(pointerInfo.pickInfo.pickedMesh) != -1)) {
                     _this._rootMesh.getChildMeshes().forEach(function (m) {
                         m.material = hoverMaterial;
@@ -91298,6 +91325,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        PositionGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return PositionGizmo;
     }(BABYLON.Gizmo));
     BABYLON.PositionGizmo = PositionGizmo;
@@ -91359,6 +91393,13 @@ var BABYLON;
             this.yGizmo.dispose();
             this.zGizmo.dispose();
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        RotationGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo, please set the custom meshes on the gizmos contained within this one (gizmo.xGizmo, gizmo.yGizmo, gizmo.zGizmo)");
+        };
         return RotationGizmo;
     }(BABYLON.Gizmo));
     BABYLON.RotationGizmo = RotationGizmo;
@@ -91834,6 +91875,13 @@ var BABYLON;
             box.visibility = 0;
             return box;
         };
+        /**
+         * CustomMeshes are not supported by this gizmo
+         * @param mesh The mesh to replace the default mesh of the gizmo
+         */
+        BoundingBoxGizmo.prototype.setCustomMesh = function (mesh) {
+            BABYLON.Tools.Error("Custom meshes are not supported on this gizmo");
+        };
         return BoundingBoxGizmo;
     }(BABYLON.Gizmo));
     BABYLON.BoundingBoxGizmo = BoundingBoxGizmo;