浏览代码

Fixing some typos

David Catuhe 10 年之前
父节点
当前提交
3f2df1b57a

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


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


+ 24 - 16
dist/preview release/babylon.max.js

@@ -4302,14 +4302,14 @@ var BABYLON;
                 setTimeout(action, 1);
             }
         };
-        Tools.IsExponantOfTwo = function (value) {
+        Tools.IsExponentOfTwo = function (value) {
             var count = 1;
             do {
                 count *= 2;
             } while (count < value);
             return count === value;
         };
-        Tools.GetExponantOfTwo = function (value, max) {
+        Tools.GetExponentOfTwo = function (value, max) {
             var count = 1;
             do {
                 count *= 2;
@@ -5409,8 +5409,8 @@ var BABYLON;
     var prepareWebGLTexture = function (texture, gl, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) {
         if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
         var engine = scene.getEngine();
-        var potWidth = BABYLON.Tools.GetExponantOfTwo(width, engine.getCaps().maxTextureSize);
-        var potHeight = BABYLON.Tools.GetExponantOfTwo(height, engine.getCaps().maxTextureSize);
+        var potWidth = BABYLON.Tools.GetExponentOfTwo(width, engine.getCaps().maxTextureSize);
+        var potHeight = BABYLON.Tools.GetExponentOfTwo(height, engine.getCaps().maxTextureSize);
         gl.bindTexture(gl.TEXTURE_2D, texture);
         gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
         texture._baseWidth = width;
@@ -6611,8 +6611,8 @@ var BABYLON;
             texture._baseWidth = width;
             texture._baseHeight = height;
             if (forceExponantOfTwo) {
-                width = BABYLON.Tools.GetExponantOfTwo(width, this._caps.maxTextureSize);
-                height = BABYLON.Tools.GetExponantOfTwo(height, this._caps.maxTextureSize);
+                width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
+                height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
             this._activeTexturesCache = [];
             texture._width = width;
@@ -6833,7 +6833,7 @@ var BABYLON;
             }
             else {
                 cascadeLoad(rootUrl, scene, function (imgs) {
-                    var width = BABYLON.Tools.GetExponantOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize);
+                    var width = BABYLON.Tools.GetExponentOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize);
                     var height = width;
                     _this._prepareWorkingCanvas();
                     _this._workingCanvas.width = width;
@@ -10378,7 +10378,7 @@ var BABYLON;
                     this._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix;
                     this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix;
                     this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix;
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], false, metrics));
                     }
                     this._rigCameras[1]._cameraRigParams.vrMetrics = this._rigCameras[0]._cameraRigParams.vrMetrics;
@@ -10387,7 +10387,7 @@ var BABYLON;
                     this._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix;
                     this._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix;
                     this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix;
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], true, metrics));
                     }
                     break;
@@ -18041,7 +18041,7 @@ var BABYLON;
             this.video.autoplay = false;
             this.video.loop = true;
             this.video.addEventListener("canplaythrough", function () {
-                if (BABYLON.Tools.IsExponantOfTwo(_this.video.videoWidth) && BABYLON.Tools.IsExponantOfTwo(_this.video.videoHeight)) {
+                if (BABYLON.Tools.IsExponentOfTwo(_this.video.videoWidth) && BABYLON.Tools.IsExponentOfTwo(_this.video.videoHeight)) {
                     _this.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
                     _this.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
                 }
@@ -19994,10 +19994,18 @@ var BABYLON;
             newStandardMaterial.useReflectionFresnelFromSpecular = this.useReflectionFresnelFromSpecular;
             newStandardMaterial.useSpecularOverAlpha = this.useSpecularOverAlpha;
             newStandardMaterial.roughness = this.roughness;
-            newStandardMaterial.diffuseFresnelParameters = this.diffuseFresnelParameters.clone();
-            newStandardMaterial.emissiveFresnelParameters = this.emissiveFresnelParameters.clone();
-            newStandardMaterial.reflectionFresnelParameters = this.reflectionFresnelParameters.clone();
-            newStandardMaterial.opacityFresnelParameters = this.opacityFresnelParameters.clone();
+            if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.clone) {
+                newStandardMaterial.diffuseFresnelParameters = this.diffuseFresnelParameters.clone();
+            }
+            if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.clone) {
+                newStandardMaterial.emissiveFresnelParameters = this.emissiveFresnelParameters.clone();
+            }
+            if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.clone) {
+                newStandardMaterial.reflectionFresnelParameters = this.reflectionFresnelParameters.clone();
+            }
+            if (this.opacityFresnelParameters && this.opacityFresnelParameters.clone) {
+                newStandardMaterial.opacityFresnelParameters = this.opacityFresnelParameters.clone();
+            }
             return newStandardMaterial;
         };
         // Statics
@@ -23508,8 +23516,8 @@ var BABYLON;
             var maxSize = camera.getEngine().getCaps().maxTextureSize;
             var desiredWidth = ((sourceTexture ? sourceTexture._width : this._engine.getRenderingCanvas().width) * this._renderRatio) | 0;
             var desiredHeight = ((sourceTexture ? sourceTexture._height : this._engine.getRenderingCanvas().height) * this._renderRatio) | 0;
-            desiredWidth = this._renderRatio.width || BABYLON.Tools.GetExponantOfTwo(desiredWidth, maxSize);
-            desiredHeight = this._renderRatio.height || BABYLON.Tools.GetExponantOfTwo(desiredHeight, maxSize);
+            desiredWidth = this._renderRatio.width || BABYLON.Tools.GetExponentOfTwo(desiredWidth, maxSize);
+            desiredHeight = this._renderRatio.height || BABYLON.Tools.GetExponentOfTwo(desiredHeight, maxSize);
             if (this.width !== desiredWidth || this.height !== desiredHeight) {
                 if (this._textures.length > 0) {
                     for (var i = 0; i < this._textures.length; i++) {

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


+ 2 - 0
dist/preview release/what's new.md

@@ -37,3 +37,5 @@
     - `VertexData.CreateGround()` now supports only the single _options_ parameter ([jerome](https://github.com/jbousquie))
     - `VertexData.CreateTiledGround()` now supports only the single _options_ parameter ([jerome](https://github.com/jbousquie))
     - `VertexData.CreateGroundFromHeightMap()` now supports only the single _options_ parameter ([deltakosh](https://github.com/deltakosh))
+    - `Tools.IsExponantOfTwo()` renamed to `Tools.IsExponentOfTwo()` ([deltakosh](https://github.com/deltakosh))
+    - `Tools.GetExponantOfTwo()` renamed to `Tools.GetExponentOfTwo()` ([deltakosh](https://github.com/deltakosh))

+ 2 - 2
src/Cameras/babylon.camera.js

@@ -466,7 +466,7 @@ var BABYLON;
                     this._rigCameras[0]._cameraRigParams.vrHMatrix = metrics.leftHMatrix;
                     this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix;
                     this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix;
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], false, metrics));
                     }
                     this._rigCameras[1]._cameraRigParams.vrMetrics = this._rigCameras[0]._cameraRigParams.vrMetrics;
@@ -475,7 +475,7 @@ var BABYLON;
                     this._rigCameras[1]._cameraRigParams.vrHMatrix = metrics.rightHMatrix;
                     this._rigCameras[1]._cameraRigParams.vrPreViewMatrix = metrics.rightPreViewMatrix;
                     this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix;
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new BABYLON.VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], true, metrics));
                     }
                     break;

+ 2 - 2
src/Cameras/babylon.camera.ts

@@ -524,7 +524,7 @@
                     this._rigCameras[0]._cameraRigParams.vrPreViewMatrix = metrics.leftPreViewMatrix;
                     this._rigCameras[0].getProjectionMatrix = this._rigCameras[0]._getVRProjectionMatrix;
 
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Left", this._rigCameras[0], false, metrics));
                     }
 
@@ -536,7 +536,7 @@
 
                     this._rigCameras[1].getProjectionMatrix = this._rigCameras[1]._getVRProjectionMatrix;
 
-                    if (metrics.compensateDistorsion) {
+                    if (metrics.compensateDistortion) {
                         postProcesses.push(new VRDistortionCorrectionPostProcess("VR_Distort_Compensation_Right", this._rigCameras[1], true, metrics));
                     }
                     break;

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

@@ -19,7 +19,7 @@ var BABYLON;
             this.video.autoplay = false;
             this.video.loop = true;
             this.video.addEventListener("canplaythrough", function () {
-                if (BABYLON.Tools.IsExponantOfTwo(_this.video.videoWidth) && BABYLON.Tools.IsExponantOfTwo(_this.video.videoHeight)) {
+                if (BABYLON.Tools.IsExponentOfTwo(_this.video.videoWidth) && BABYLON.Tools.IsExponentOfTwo(_this.video.videoHeight)) {
                     _this.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
                     _this.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
                 }

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

@@ -15,7 +15,7 @@
             this.video.loop = true;
 
             this.video.addEventListener("canplaythrough", () => {
-                if (Tools.IsExponantOfTwo(this.video.videoWidth) && Tools.IsExponantOfTwo(this.video.videoHeight)) {
+                if (Tools.IsExponentOfTwo(this.video.videoWidth) && Tools.IsExponentOfTwo(this.video.videoHeight)) {
                     this.wrapU = Texture.WRAP_ADDRESSMODE;
                     this.wrapV = Texture.WRAP_ADDRESSMODE;
                 } else {

+ 6 - 5
src/Materials/babylon.standardMaterial.ts

@@ -311,7 +311,7 @@
                     } else {
                         needUVs = true;
                         this._defines.SPECULAR = true;
-                        this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha;    
+                        this._defines.GLOSSINESS = this.useGlossinessFromSpecularMapAlpha;
                     }
                 }
             }
@@ -355,7 +355,7 @@
             if (scene.fogEnabled && mesh && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE && this.fogEnabled) {
                 this._defines.FOG = true;
             }
-            
+
             var lightIndex = 0;
             if (scene.lightsEnabled) {
                 for (var index = 0; index < scene.lights.length; index++) {
@@ -410,7 +410,7 @@
 
                     // Specular
                     if (!light.specular.equalsFloats(0, 0, 0)) {
-                        this. _defines.SPECULARTERM = true;
+                        this._defines.SPECULARTERM = true;
                     }
 
                     // Shadows
@@ -574,7 +574,7 @@
                 if (this._defines.FRESNEL) {
                     fallbacks.addFallback(4, "FRESNEL");
                 }
-                
+
                 if (this._defines.BONES4) {
                     fallbacks.addFallback(0, "BONES4");
                 }
@@ -845,7 +845,7 @@
             }
 
             // View
-            if (scene.fogEnabled && mesh.applyFog &&scene.fogMode !== Scene.FOGMODE_NONE || this.reflectionTexture) {
+            if (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE || this.reflectionTexture) {
                 this._effect.setMatrix("view", scene.getViewMatrix());
             }
 
@@ -999,3 +999,4 @@
         public static LightmapEnabled = true;
     }
 } 
+

+ 2 - 2
src/PostProcess/babylon.postProcess.js

@@ -36,8 +36,8 @@ var BABYLON;
             var maxSize = camera.getEngine().getCaps().maxTextureSize;
             var desiredWidth = ((sourceTexture ? sourceTexture._width : this._engine.getRenderingCanvas().width) * this._renderRatio) | 0;
             var desiredHeight = ((sourceTexture ? sourceTexture._height : this._engine.getRenderingCanvas().height) * this._renderRatio) | 0;
-            desiredWidth = this._renderRatio.width || BABYLON.Tools.GetExponantOfTwo(desiredWidth, maxSize);
-            desiredHeight = this._renderRatio.height || BABYLON.Tools.GetExponantOfTwo(desiredHeight, maxSize);
+            desiredWidth = this._renderRatio.width || BABYLON.Tools.GetExponentOfTwo(desiredWidth, maxSize);
+            desiredHeight = this._renderRatio.height || BABYLON.Tools.GetExponentOfTwo(desiredHeight, maxSize);
             if (this.width !== desiredWidth || this.height !== desiredHeight) {
                 if (this._textures.length > 0) {
                     for (var i = 0; i < this._textures.length; i++) {

+ 2 - 2
src/PostProcess/babylon.postProcess.ts

@@ -58,8 +58,8 @@
             var desiredWidth = ((sourceTexture ? sourceTexture._width : this._engine.getRenderingCanvas().width) * this._renderRatio) | 0;
             var desiredHeight = ((sourceTexture ? sourceTexture._height : this._engine.getRenderingCanvas().height) * this._renderRatio) | 0;
 
-            desiredWidth = this._renderRatio.width || Tools.GetExponantOfTwo(desiredWidth, maxSize);
-            desiredHeight = this._renderRatio.height || Tools.GetExponantOfTwo(desiredHeight, maxSize);
+            desiredWidth = this._renderRatio.width || Tools.GetExponentOfTwo(desiredWidth, maxSize);
+            desiredHeight = this._renderRatio.height || Tools.GetExponentOfTwo(desiredHeight, maxSize);
 
             if (this.width !== desiredWidth || this.height !== desiredHeight) {
                 if (this._textures.length > 0) {

+ 2 - 2
src/Tools/babylon.tools.js

@@ -34,14 +34,14 @@ var BABYLON;
                 setTimeout(action, 1);
             }
         };
-        Tools.IsExponantOfTwo = function (value) {
+        Tools.IsExponentOfTwo = function (value) {
             var count = 1;
             do {
                 count *= 2;
             } while (count < value);
             return count === value;
         };
-        Tools.GetExponantOfTwo = function (value, max) {
+        Tools.GetExponentOfTwo = function (value, max) {
             var count = 1;
             do {
                 count *= 2;

+ 2 - 2
src/Tools/babylon.tools.ts

@@ -48,7 +48,7 @@
             }
         }
 
-        public static IsExponantOfTwo(value: number): boolean {
+        public static IsExponentOfTwo(value: number): boolean {
             var count = 1;
 
             do {
@@ -58,7 +58,7 @@
             return count === value;
         }
 
-        public static GetExponantOfTwo(value: number, max: number): number {
+        public static GetExponentOfTwo(value: number, max: number): number {
             var count = 1;
 
             do {

+ 5 - 5
src/babylon.engine.js

@@ -294,8 +294,8 @@ var BABYLON;
     var prepareWebGLTexture = function (texture, gl, scene, width, height, invertY, noMipmap, isCompressed, processFunction, samplingMode) {
         if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
         var engine = scene.getEngine();
-        var potWidth = BABYLON.Tools.GetExponantOfTwo(width, engine.getCaps().maxTextureSize);
-        var potHeight = BABYLON.Tools.GetExponantOfTwo(height, engine.getCaps().maxTextureSize);
+        var potWidth = BABYLON.Tools.GetExponentOfTwo(width, engine.getCaps().maxTextureSize);
+        var potHeight = BABYLON.Tools.GetExponentOfTwo(height, engine.getCaps().maxTextureSize);
         gl.bindTexture(gl.TEXTURE_2D, texture);
         gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
         texture._baseWidth = width;
@@ -1496,8 +1496,8 @@ var BABYLON;
             texture._baseWidth = width;
             texture._baseHeight = height;
             if (forceExponantOfTwo) {
-                width = BABYLON.Tools.GetExponantOfTwo(width, this._caps.maxTextureSize);
-                height = BABYLON.Tools.GetExponantOfTwo(height, this._caps.maxTextureSize);
+                width = BABYLON.Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
+                height = BABYLON.Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
             this._activeTexturesCache = [];
             texture._width = width;
@@ -1718,7 +1718,7 @@ var BABYLON;
             }
             else {
                 cascadeLoad(rootUrl, scene, function (imgs) {
-                    var width = BABYLON.Tools.GetExponantOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize);
+                    var width = BABYLON.Tools.GetExponentOfTwo(imgs[0].width, _this._caps.maxCubemapTextureSize);
                     var height = width;
                     _this._prepareWorkingCanvas();
                     _this._workingCanvas.width = width;

+ 5 - 5
src/babylon.engine.ts

@@ -304,8 +304,8 @@
     var prepareWebGLTexture = (texture: WebGLTexture, gl: WebGLRenderingContext, scene: Scene, width: number, height: number, invertY: boolean, noMipmap: boolean, isCompressed: boolean,
         processFunction: (width: number, height: number) => void, samplingMode: number = Texture.TRILINEAR_SAMPLINGMODE) => {
         var engine = scene.getEngine();
-        var potWidth = Tools.GetExponantOfTwo(width, engine.getCaps().maxTextureSize);
-        var potHeight = Tools.GetExponantOfTwo(height, engine.getCaps().maxTextureSize);
+        var potWidth = Tools.GetExponentOfTwo(width, engine.getCaps().maxTextureSize);
+        var potHeight = Tools.GetExponentOfTwo(height, engine.getCaps().maxTextureSize);
 
         gl.bindTexture(gl.TEXTURE_2D, texture);
         gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
@@ -1766,8 +1766,8 @@
             texture._baseHeight = height;
 
             if (forceExponantOfTwo) {
-                width = Tools.GetExponantOfTwo(width, this._caps.maxTextureSize);
-                height = Tools.GetExponantOfTwo(height, this._caps.maxTextureSize);
+                width = Tools.GetExponentOfTwo(width, this._caps.maxTextureSize);
+                height = Tools.GetExponentOfTwo(height, this._caps.maxTextureSize);
             }
 
             this._activeTexturesCache = [];
@@ -2041,7 +2041,7 @@
                 }, null, null, true);
             } else {
                 cascadeLoad(rootUrl, scene, imgs => {
-                    var width = Tools.GetExponantOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize);
+                    var width = Tools.GetExponentOfTwo(imgs[0].width, this._caps.maxCubemapTextureSize);
                     var height = width;
 
                     this._prepareWorkingCanvas();