Browse Source

update from upstream

nockawa 9 năm trước cách đây
mục cha
commit
53de4e77fc

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 17 - 17
dist/preview release/babylon.core.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1276 - 1275
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 32 - 32
dist/preview release/babylon.js


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

@@ -9468,6 +9468,9 @@ var BABYLON;
             }
             return this._boundingInfo;
         };
+        AbstractMesh.prototype.setBoundingInfo = function (boundingInfo) {
+            this._boundingInfo = boundingInfo;
+        };
         Object.defineProperty(AbstractMesh.prototype, "useBones", {
             get: function () {
                 return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind);
@@ -21960,7 +21963,7 @@ var BABYLON;
             this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED;
             this._texture = this._getFromCache(this.url, this._noMipmap);
             if (!this._texture) {
-                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._extensions);
+                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._files, this._noMipmap);
             }
         };
         CubeTexture.prototype.getReflectionTextureMatrix = function () {
@@ -43904,6 +43907,9 @@ var BABYLON;
             if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
                 return false;
             }
+            if (!this.texture.isReady()) {
+                return false;
+            }
             if (part.id === Sprite2D.SPRITE2D_MAINPARTID) {
                 var d = this._instanceDataParts[0];
                 var ts = this.texture.getBaseSize();

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 32 - 32
dist/preview release/babylon.noworker.js


+ 3 - 0
src/Canvas2d/babylon.sprite2d.js

@@ -322,6 +322,9 @@ var BABYLON;
             if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
                 return false;
             }
+            if (!this.texture.isReady()) {
+                return false;
+            }
             if (part.id === Sprite2D.SPRITE2D_MAINPARTID) {
                 var d = this._instanceDataParts[0];
                 var ts = this.texture.getBaseSize();

+ 35 - 37
src/Canvas2d/babylon.sprite2d.ts

@@ -1,12 +1,12 @@
 module BABYLON {
     export class Sprite2DRenderCache extends ModelRenderCache {
-        effectsReady: boolean                           = false;
-        vb: WebGLBuffer                                 = null;
-        ib: WebGLBuffer                                 = null;
+        effectsReady: boolean = false;
+        vb: WebGLBuffer = null;
+        ib: WebGLBuffer = null;
         instancingAttributes: InstancingAttributeInfo[] = null;
-        texture: Texture                                = null;
-        effect: Effect                                  = null;
-        effectInstanced: Effect                         = null;
+        texture: Texture = null;
+        effect: Effect = null;
+        effectInstanced: Effect = null;
 
         render(instanceInfo: GroupInstanceInfo, context: Render2DContext): boolean {
             // Do nothing if the shader is still loading/preparing 
@@ -264,35 +264,35 @@
          */
         constructor(texture: Texture, settings?: {
 
-            parent            ?: Prim2DBase, 
-            children          ?: Array<Prim2DBase>,
-            id                ?: string,
-            position          ?: Vector2,
-            x                 ?: number,
-            y                 ?: number,
-            rotation          ?: number,
-            scale             ?: number,
-            opacity           ?: number,
-            origin            ?: Vector2,
-            spriteSize        ?: Size,
-            spriteLocation    ?: Vector2,
-            invertY           ?: boolean,
-            alignToPixel      ?: boolean,
-            isVisible         ?: boolean,
+            parent?: Prim2DBase,
+            children?: Array<Prim2DBase>,
+            id?: string,
+            position?: Vector2,
+            x?: number,
+            y?: number,
+            rotation?: number,
+            scale?: number,
+            opacity?: number,
+            origin?: Vector2,
+            spriteSize?: Size,
+            spriteLocation?: Vector2,
+            invertY?: boolean,
+            alignToPixel?: boolean,
+            isVisible?: boolean,
             childrenFlatZOrder?: boolean,
-            marginTop         ?: number | string,
-            marginLeft        ?: number | string,
-            marginRight       ?: number | string,
-            marginBottom      ?: number | string,
-            margin            ?: number | string,
-            marginHAlignment  ?: number,
-            marginVAlignment  ?: number,
-            marginAlignment   ?: string,
-            paddingTop        ?: number | string,
-            paddingLeft       ?: number | string,
-            paddingRight      ?: number | string,
-            paddingBottom     ?: number | string,
-            padding           ?: string,
+            marginTop?: number | string,
+            marginLeft?: number | string,
+            marginRight?: number | string,
+            marginBottom?: number | string,
+            margin?: number | string,
+            marginHAlignment?: number,
+            marginVAlignment?: number,
+            marginAlignment?: string,
+            paddingTop?: number | string,
+            paddingLeft?: number | string,
+            paddingRight?: number | string,
+            paddingBottom?: number | string,
+            padding?: string,
         }) {
 
             if (!settings) {
@@ -324,7 +324,7 @@
 
         static _createCachedCanvasSprite(owner: Canvas2D, texture: MapTexture, size: Size, pos: Vector2): Sprite2D {
 
-            let sprite = new Sprite2D(texture, { parent: owner, id:"__cachedCanvasSprite__", position: Vector2.Zero(), origin: Vector2.Zero(), spriteSize: size, spriteLocation:pos, alignToPixel: true});
+            let sprite = new Sprite2D(texture, { parent: owner, id: "__cachedCanvasSprite__", position: Vector2.Zero(), origin: Vector2.Zero(), spriteSize: size, spriteLocation: pos, alignToPixel: true });
             return sprite;
         }
 
@@ -407,6 +407,4 @@
         private _invertY: boolean;
         private _alignToPixel: boolean;
     }
-
-
 }

+ 1 - 1
src/Materials/Textures/babylon.cubeTexture.js

@@ -51,7 +51,7 @@ var BABYLON;
             this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED;
             this._texture = this._getFromCache(this.url, this._noMipmap);
             if (!this._texture) {
-                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._extensions);
+                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._files, this._noMipmap);
             }
         };
         CubeTexture.prototype.getReflectionTextureMatrix = function () {

+ 1 - 1
src/Materials/Textures/babylon.cubeTexture.ts

@@ -66,7 +66,7 @@
             this._texture = this._getFromCache(this.url, this._noMipmap);
 
             if (!this._texture) {
-                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._extensions);
+                this._texture = this.getScene().getEngine().createCubeTexture(this.url, this.getScene(), this._files, this._noMipmap);
             }
         }
 

+ 4 - 1
src/Mesh/babylon.abstractMesh.js

@@ -296,6 +296,9 @@ var BABYLON;
             }
             return this._boundingInfo;
         };
+        AbstractMesh.prototype.setBoundingInfo = function (boundingInfo) {
+            this._boundingInfo = boundingInfo;
+        };
         Object.defineProperty(AbstractMesh.prototype, "useBones", {
             get: function () {
                 return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(BABYLON.VertexBuffer.MatricesWeightsKind);
@@ -752,7 +755,7 @@ var BABYLON;
          * @Deprecated. Use getPhysicsImpostor().getParam("restitution");
          */
         AbstractMesh.prototype.getPhysicsRestitution = function () {
-            return this.physicsImpostor.getParam("resitution");
+            return this.physicsImpostor.getParam("restitution");
         };
         AbstractMesh.prototype.getPositionInCameraSpace = function (camera) {
             if (!camera) {

+ 5 - 1
src/Mesh/babylon.abstractMesh.ts

@@ -313,6 +313,10 @@
             return this._boundingInfo;
         }
 
+        public setBoundingInfo(boundingInfo: BoundingInfo): void {
+            this._boundingInfo = boundingInfo;
+        }
+
         public get useBones(): boolean {
             return this.skeleton && this.getScene().skeletonsEnabled && this.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind) && this.isVerticesDataPresent(VertexBuffer.MatricesWeightsKind);
         }
@@ -842,7 +846,7 @@
          * @Deprecated. Use getPhysicsImpostor().getParam("restitution");
          */
         public getPhysicsRestitution(): number {
-            return this.physicsImpostor.getParam("resitution")
+            return this.physicsImpostor.getParam("restitution")
         }
 
         public getPositionInCameraSpace(camera?: Camera): Vector3 {