David Catuhe 7 年之前
父节点
当前提交
1035bf8018

文件差异内容过多而无法显示
+ 811 - 808
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 2447 - 2447
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 43 - 43
dist/preview release/babylon.js


+ 6 - 4
dist/preview release/babylon.max.js

@@ -8026,6 +8026,7 @@ var BABYLON;
             this.onContextRestoredObservable = new BABYLON.Observable();
             this.onContextRestoredObservable = new BABYLON.Observable();
             this._contextWasLost = false;
             this._contextWasLost = false;
             this._doNotHandleContextLost = false;
             this._doNotHandleContextLost = false;
+            this._constantAnimationDeltaTime = -1;
             // FPS
             // FPS
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._fps = 60;
             this._fps = 60;
@@ -8095,9 +8096,13 @@ var BABYLON;
                 if (options.stencil === undefined) {
                 if (options.stencil === undefined) {
                     options.stencil = true;
                     options.stencil = true;
                 }
                 }
+                if (options.constantAnimationDeltaTime === undefined) {
+                    options.constantAnimationDeltaTime = -1;
+                }
                 this._deterministicLockstep = options.deterministicLockstep;
                 this._deterministicLockstep = options.deterministicLockstep;
                 this._lockstepMaxSteps = options.lockstepMaxSteps;
                 this._lockstepMaxSteps = options.lockstepMaxSteps;
                 this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
                 this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
+                this._constantAnimationDeltaTime = options.constantAnimationDeltaTime;
                 // GL
                 // GL
                 if (!options.disableWebGL2Support) {
                 if (!options.disableWebGL2Support) {
                     try {
                     try {
@@ -11996,7 +12001,7 @@ var BABYLON;
             return this._fps;
             return this._fps;
         };
         };
         Engine.prototype.getDeltaTime = function () {
         Engine.prototype.getDeltaTime = function () {
-            return this._deltaTime;
+            return this._constantAnimationDeltaTime > -1 ? this._constantAnimationDeltaTime : this._deltaTime;
         };
         };
         Engine.prototype._measureFps = function () {
         Engine.prototype._measureFps = function () {
             this._performanceMonitor.sampleFrame();
             this._performanceMonitor.sampleFrame();
@@ -20696,9 +20701,6 @@ var BABYLON;
                     }
                     }
                     this.onAfterStepObservable.notifyObservers(this);
                     this.onAfterStepObservable.notifyObservers(this);
                     this._currentStepId++;
                     this._currentStepId++;
-                    if ((internalSteps > 1) && (stepsTaken != internalSteps - 1)) {
-                        this._evaluateActiveMeshes();
-                    }
                     stepsTaken++;
                     stepsTaken++;
                     deltaTime -= defaultFrameTime;
                     deltaTime -= defaultFrameTime;
                 } while (deltaTime > 0 && stepsTaken < internalSteps);
                 } while (deltaTime > 0 && stepsTaken < internalSteps);

文件差异内容过多而无法显示
+ 43 - 43
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 39 - 39
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 6 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -8026,6 +8026,7 @@ var BABYLON;
             this.onContextRestoredObservable = new BABYLON.Observable();
             this.onContextRestoredObservable = new BABYLON.Observable();
             this._contextWasLost = false;
             this._contextWasLost = false;
             this._doNotHandleContextLost = false;
             this._doNotHandleContextLost = false;
+            this._constantAnimationDeltaTime = -1;
             // FPS
             // FPS
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._performanceMonitor = new BABYLON.PerformanceMonitor();
             this._fps = 60;
             this._fps = 60;
@@ -8095,9 +8096,13 @@ var BABYLON;
                 if (options.stencil === undefined) {
                 if (options.stencil === undefined) {
                     options.stencil = true;
                     options.stencil = true;
                 }
                 }
+                if (options.constantAnimationDeltaTime === undefined) {
+                    options.constantAnimationDeltaTime = -1;
+                }
                 this._deterministicLockstep = options.deterministicLockstep;
                 this._deterministicLockstep = options.deterministicLockstep;
                 this._lockstepMaxSteps = options.lockstepMaxSteps;
                 this._lockstepMaxSteps = options.lockstepMaxSteps;
                 this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
                 this._doNotHandleContextLost = options.doNotHandleContextLost ? true : false;
+                this._constantAnimationDeltaTime = options.constantAnimationDeltaTime;
                 // GL
                 // GL
                 if (!options.disableWebGL2Support) {
                 if (!options.disableWebGL2Support) {
                     try {
                     try {
@@ -11996,7 +12001,7 @@ var BABYLON;
             return this._fps;
             return this._fps;
         };
         };
         Engine.prototype.getDeltaTime = function () {
         Engine.prototype.getDeltaTime = function () {
-            return this._deltaTime;
+            return this._constantAnimationDeltaTime > -1 ? this._constantAnimationDeltaTime : this._deltaTime;
         };
         };
         Engine.prototype._measureFps = function () {
         Engine.prototype._measureFps = function () {
             this._performanceMonitor.sampleFrame();
             this._performanceMonitor.sampleFrame();
@@ -20696,9 +20701,6 @@ var BABYLON;
                     }
                     }
                     this.onAfterStepObservable.notifyObservers(this);
                     this.onAfterStepObservable.notifyObservers(this);
                     this._currentStepId++;
                     this._currentStepId++;
-                    if ((internalSteps > 1) && (stepsTaken != internalSteps - 1)) {
-                        this._evaluateActiveMeshes();
-                    }
                     stepsTaken++;
                     stepsTaken++;
                     deltaTime -= defaultFrameTime;
                     deltaTime -= defaultFrameTime;
                 } while (deltaTime > 0 && stepsTaken < internalSteps);
                 } while (deltaTime > 0 && stepsTaken < internalSteps);

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

@@ -678,6 +678,7 @@ declare module BABYLON.GUI {
         placeholderColor: string;
         placeholderColor: string;
         placeholderText: string;
         placeholderText: string;
         text: string;
         text: string;
+        width: string | number;
         constructor(name?: string | undefined, text?: string);
         constructor(name?: string | undefined, text?: string);
         onBlur(): void;
         onBlur(): void;
         onFocus(): void;
         onFocus(): void;

+ 18 - 2
dist/preview release/gui/babylon.gui.js

@@ -2777,10 +2777,10 @@ var BABYLON;
                         context.shadowOffsetY = this.shadowOffsetY;
                         context.shadowOffsetY = this.shadowOffsetY;
                     }
                     }
                     if (this._thumbWidth.isPixel) {
                     if (this._thumbWidth.isPixel) {
-                        effectiveThumbWidth = Math.min(this._thumbWidth.getValue(this._host), this._currentMeasure.height);
+                        effectiveThumbWidth = Math.min(this._thumbWidth.getValue(this._host), this._currentMeasure.width);
                     }
                     }
                     else {
                     else {
-                        effectiveThumbWidth = this._currentMeasure.height * this._thumbWidth.getValue(this._host);
+                        effectiveThumbWidth = this._currentMeasure.width * this._thumbWidth.getValue(this._host);
                     }
                     }
                     if (this._barOffset.isPixel) {
                     if (this._barOffset.isPixel) {
                         effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._currentMeasure.height);
                         effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._currentMeasure.height);
@@ -4329,6 +4329,22 @@ var BABYLON;
                 enumerable: true,
                 enumerable: true,
                 configurable: true
                 configurable: true
             });
             });
+            Object.defineProperty(InputText.prototype, "width", {
+                get: function () {
+                    return this._width.toString(this._host);
+                },
+                set: function (value) {
+                    if (this._width.toString(this._host) === value) {
+                        return;
+                    }
+                    if (this._width.fromString(value)) {
+                        this._markAsDirty();
+                    }
+                    this.autoStretchWidth = false;
+                },
+                enumerable: true,
+                configurable: true
+            });
             InputText.prototype.onBlur = function () {
             InputText.prototype.onBlur = function () {
                 this._isFocused = false;
                 this._isFocused = false;
                 this._scrollLeft = null;
                 this._scrollLeft = null;

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


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

@@ -683,6 +683,7 @@ declare module BABYLON.GUI {
         placeholderColor: string;
         placeholderColor: string;
         placeholderText: string;
         placeholderText: string;
         text: string;
         text: string;
+        width: string | number;
         constructor(name?: string | undefined, text?: string);
         constructor(name?: string | undefined, text?: string);
         onBlur(): void;
         onBlur(): void;
         onFocus(): void;
         onFocus(): void;

文件差异内容过多而无法显示
+ 45 - 45
dist/preview release/viewer/babylon.viewer.js


+ 34 - 34
gui/src/controls/slider.ts

@@ -3,10 +3,10 @@
 module BABYLON.GUI {
 module BABYLON.GUI {
     export class Slider extends Control {
     export class Slider extends Control {
         private _thumbWidth = new ValueAndUnit(30, ValueAndUnit.UNITMODE_PIXEL, false);
         private _thumbWidth = new ValueAndUnit(30, ValueAndUnit.UNITMODE_PIXEL, false);
-        private _minimum = 0; 
+        private _minimum = 0;
         private _maximum = 100;
         private _maximum = 100;
         private _value = 50;
         private _value = 50;
-        private _background = "black";   
+        private _background = "black";
         private _borderColor = "white";
         private _borderColor = "white";
         private _barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);
         private _barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);
         private _isThumbCircle = false;
         private _isThumbCircle = false;
@@ -24,7 +24,7 @@ module BABYLON.GUI {
 
 
             this._borderColor = value;
             this._borderColor = value;
             this._markAsDirty();
             this._markAsDirty();
-        }  
+        }
 
 
         public get background(): string {
         public get background(): string {
             return this._background;
             return this._background;
@@ -37,17 +37,17 @@ module BABYLON.GUI {
 
 
             this._background = value;
             this._background = value;
             this._markAsDirty();
             this._markAsDirty();
-        }     
+        }
 
 
-        public get barOffset(): string | number  {
+        public get barOffset(): string | number {
             return this._barOffset.toString(this._host);
             return this._barOffset.toString(this._host);
         }
         }
 
 
-        public get barOffsetInPixels(): number  {
+        public get barOffsetInPixels(): number {
             return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
             return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);
-        }            
+        }
 
 
-        public set barOffset(value: string | number ) {
+        public set barOffset(value: string | number) {
             if (this._barOffset.toString(this._host) === value) {
             if (this._barOffset.toString(this._host) === value) {
                 return;
                 return;
             }
             }
@@ -55,17 +55,17 @@ module BABYLON.GUI {
             if (this._barOffset.fromString(value)) {
             if (this._barOffset.fromString(value)) {
                 this._markAsDirty();
                 this._markAsDirty();
             }
             }
-        }      
+        }
 
 
-        public get thumbWidth(): string | number  {
+        public get thumbWidth(): string | number {
             return this._thumbWidth.toString(this._host);
             return this._thumbWidth.toString(this._host);
         }
         }
 
 
-        public get thumbWidthInPixels(): number  {
+        public get thumbWidthInPixels(): number {
             return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
             return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);
-        }          
+        }
 
 
-        public set thumbWidth(value: string | number ) {
+        public set thumbWidth(value: string | number) {
             if (this._thumbWidth.toString(this._host) === value) {
             if (this._thumbWidth.toString(this._host) === value) {
                 return;
                 return;
             }
             }
@@ -73,7 +73,7 @@ module BABYLON.GUI {
             if (this._thumbWidth.fromString(value)) {
             if (this._thumbWidth.fromString(value)) {
                 this._markAsDirty();
                 this._markAsDirty();
             }
             }
-        }              
+        }
 
 
         public get minimum(): number {
         public get minimum(): number {
             return this._minimum;
             return this._minimum;
@@ -88,7 +88,7 @@ module BABYLON.GUI {
             this._markAsDirty();
             this._markAsDirty();
 
 
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
-        }         
+        }
 
 
         public get maximum(): number {
         public get maximum(): number {
             return this._maximum;
             return this._maximum;
@@ -103,7 +103,7 @@ module BABYLON.GUI {
             this._markAsDirty();
             this._markAsDirty();
 
 
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
             this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);
-        }     
+        }
 
 
         public get value(): number {
         public get value(): number {
             return this._value;
             return this._value;
@@ -119,7 +119,7 @@ module BABYLON.GUI {
             this._markAsDirty();
             this._markAsDirty();
 
 
             this.onValueChangedObservable.notifyObservers(this._value);
             this.onValueChangedObservable.notifyObservers(this._value);
-        }                             
+        }
 
 
         public get isThumbCircle(): boolean {
         public get isThumbCircle(): boolean {
             return this._isThumbCircle;
             return this._isThumbCircle;
@@ -142,7 +142,7 @@ module BABYLON.GUI {
 
 
         protected _getTypeName(): string {
         protected _getTypeName(): string {
             return "Slider";
             return "Slider";
-        }              
+        }
 
 
         public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {
         public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {
             context.save();
             context.save();
@@ -153,7 +153,7 @@ module BABYLON.GUI {
                 var effectiveThumbWidth;
                 var effectiveThumbWidth;
                 var effectiveBarOffset;
                 var effectiveBarOffset;
 
 
-                if(this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY){
+                if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                     context.shadowColor = this.shadowColor;
                     context.shadowColor = this.shadowColor;
                     context.shadowBlur = this.shadowBlur;
                     context.shadowBlur = this.shadowBlur;
                     context.shadowOffsetX = this.shadowOffsetX;
                     context.shadowOffsetX = this.shadowOffsetX;
@@ -161,16 +161,16 @@ module BABYLON.GUI {
                 }
                 }
 
 
                 if (this._thumbWidth.isPixel) {
                 if (this._thumbWidth.isPixel) {
-                    effectiveThumbWidth = Math.min(this._thumbWidth.getValue(this._host), this._currentMeasure.height);
+                    effectiveThumbWidth = Math.min(this._thumbWidth.getValue(this._host), this._currentMeasure.width);
                 } else {
                 } else {
-                    effectiveThumbWidth = this._currentMeasure.height * this._thumbWidth.getValue(this._host); 
+                    effectiveThumbWidth = this._currentMeasure.width * this._thumbWidth.getValue(this._host);
                 }
                 }
 
 
                 if (this._barOffset.isPixel) {
                 if (this._barOffset.isPixel) {
                     effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._currentMeasure.height);
                     effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._currentMeasure.height);
                 } else {
                 } else {
-                    effectiveBarOffset = this._currentMeasure.height * this._barOffset.getValue(this._host); 
-                }                
+                    effectiveBarOffset = this._currentMeasure.height * this._barOffset.getValue(this._host);
+                }
 
 
 
 
                 var left = this._currentMeasure.left + effectiveThumbWidth / 2;
                 var left = this._currentMeasure.left + effectiveThumbWidth / 2;
@@ -181,7 +181,7 @@ module BABYLON.GUI {
                 context.fillStyle = this._background;
                 context.fillStyle = this._background;
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, width, this._currentMeasure.height - effectiveBarOffset * 2);
 
 
-                if(this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY){
+                if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                     context.shadowBlur = 0;
                     context.shadowBlur = 0;
                     context.shadowOffsetX = 0;
                     context.shadowOffsetX = 0;
                     context.shadowOffsetY = 0;
                     context.shadowOffsetY = 0;
@@ -190,7 +190,7 @@ module BABYLON.GUI {
                 context.fillStyle = this.color;
                 context.fillStyle = this.color;
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, thumbPosition, this._currentMeasure.height - effectiveBarOffset * 2);
                 context.fillRect(left, this._currentMeasure.top + effectiveBarOffset, thumbPosition, this._currentMeasure.height - effectiveBarOffset * 2);
 
 
-                if(this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY){
+                if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                     context.shadowColor = this.shadowColor;
                     context.shadowColor = this.shadowColor;
                     context.shadowBlur = this.shadowBlur;
                     context.shadowBlur = this.shadowBlur;
                     context.shadowOffsetX = this.shadowOffsetX;
                     context.shadowOffsetX = this.shadowOffsetX;
@@ -203,7 +203,7 @@ module BABYLON.GUI {
                     context.arc(left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height / 2, effectiveThumbWidth / 2, 0, 2 * Math.PI);
                     context.arc(left + thumbPosition, this._currentMeasure.top + this._currentMeasure.height / 2, effectiveThumbWidth / 2, 0, 2 * Math.PI);
                     context.fill();
                     context.fill();
 
 
-                    if(this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY){
+                    if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                         context.shadowBlur = 0;
                         context.shadowBlur = 0;
                         context.shadowOffsetX = 0;
                         context.shadowOffsetX = 0;
                         context.shadowOffsetY = 0;
                         context.shadowOffsetY = 0;
@@ -214,8 +214,8 @@ module BABYLON.GUI {
                 }
                 }
                 else {
                 else {
                     context.fillRect(left + thumbPosition - effectiveThumbWidth / 2, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
                     context.fillRect(left + thumbPosition - effectiveThumbWidth / 2, this._currentMeasure.top, effectiveThumbWidth, this._currentMeasure.height);
-                    
-                    if(this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY){
+
+                    if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
                         context.shadowBlur = 0;
                         context.shadowBlur = 0;
                         context.shadowOffsetX = 0;
                         context.shadowOffsetX = 0;
                         context.shadowOffsetY = 0;
                         context.shadowOffsetY = 0;
@@ -231,8 +231,8 @@ module BABYLON.GUI {
         // Events
         // Events
         private _pointerIsDown = false;
         private _pointerIsDown = false;
 
 
-        private _updateValueFromPointer(x: number, y:number): void {
-            if(this.rotation != 0){
+        private _updateValueFromPointer(x: number, y: number): void {
+            if (this.rotation != 0) {
                 this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
                 this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
                 x = this._transformedPosition.x;
                 x = this._transformedPosition.x;
             }
             }
@@ -260,11 +260,11 @@ module BABYLON.GUI {
             super._onPointerMove(target, coordinates);
             super._onPointerMove(target, coordinates);
         }
         }
 
 
-        public _onPointerUp (target: Control, coordinates: Vector2, buttonIndex: number): void {
+        public _onPointerUp(target: Control, coordinates: Vector2, buttonIndex: number): void {
             this._pointerIsDown = false;
             this._pointerIsDown = false;
-            
+
             this._host._capturingControl = null;
             this._host._capturingControl = null;
             super._onPointerUp(target, coordinates, buttonIndex);
             super._onPointerUp(target, coordinates, buttonIndex);
-        }         
-    }    
+        }
+    }
 }
 }

二进制
tests/validation/ReferenceImages/GUI.png