David Catuhe 6 rokov pred
rodič
commit
e4b0eced76

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3840 - 3836
Playground/babylon.d.txt


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 3571 - 3567
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.js


+ 7 - 1
dist/preview release/babylon.max.js

@@ -103480,6 +103480,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103595,7 +103599,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });

+ 7 - 1
dist/preview release/babylon.no-module.max.js

@@ -103447,6 +103447,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103562,7 +103566,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/babylon.worker.js


+ 7 - 1
dist/preview release/es6.js

@@ -103447,6 +103447,10 @@ var BABYLON;
              * If set, the drag plane/axis will be rotated based on the attached mesh's world rotation (Default: true)
              */
             this.useObjectOrienationForDragging = true;
+            /**
+             * Predicate to determine if it is valid to move the object to a new position when it is moved
+             */
+            this.validateDrag = function (targetPosition) { return true; };
             this._tmpVector = new BABYLON.Vector3(0, 0, 0);
             this._alternatePickedPoint = new BABYLON.Vector3(0, 0, 0);
             this._worldDragAxis = new BABYLON.Vector3(0, 0, 0);
@@ -103562,7 +103566,9 @@ var BABYLON;
                     _this._targetPosition.subtractToRef((_this._attachedNode).absolutePosition, _this._tmpVector);
                     _this._tmpVector.scaleInPlace(_this.dragDeltaRatio);
                     (_this._attachedNode).getAbsolutePosition().addToRef(_this._tmpVector, _this._tmpVector);
-                    (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    if (_this.validateDrag(_this._tmpVector)) {
+                        (_this._attachedNode).setAbsolutePosition(_this._tmpVector);
+                    }
                     BABYLON.BoundingBoxGizmo._RestorePivotPoint(_this._attachedNode);
                 }
             });

+ 4 - 4
dist/preview release/viewer/babylon.viewer.d.ts

@@ -168,11 +168,11 @@ declare module BabylonViewer {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -189,11 +189,11 @@ declare module BabylonViewer {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/viewer/babylon.viewer.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 4 - 4
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -200,11 +200,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Mainly used for help and errors
                 * @param subScreen the name of the subScreen. Those can be defined in the configuration object
                 */
-            showOverlayScreen(subScreen: string): Promise<Template> | Promise<string>;
+            showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
             /**
                 * Hide the overlay screen.
                 */
-            hideOverlayScreen(): Promise<Template> | Promise<string>;
+            hideOverlayScreen(): Promise<string> | Promise<Template>;
             /**
                 * show the viewer (in case it was hidden)
                 *
@@ -221,11 +221,11 @@ declare module 'babylonjs-viewer/viewer/defaultViewer' {
                 * Show the loading screen.
                 * The loading screen can be configured using the configuration object
                 */
-            showLoadingScreen(): Promise<Template> | Promise<string>;
+            showLoadingScreen(): Promise<string> | Promise<Template>;
             /**
                 * Hide the loading screen
                 */
-            hideLoadingScreen(): Promise<Template> | Promise<string>;
+            hideLoadingScreen(): Promise<string> | Promise<Template>;
             dispose(): void;
             protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
     }