Browse Source

Merge pull request #329 from dad72/master

Removed useless semicolons and bug fixe
David Catuhe 10 years ago
parent
commit
4ea3332f48

+ 5 - 4
Babylon/Audio/babylon.sound.js

@@ -10,8 +10,7 @@
             this._orientation = BABYLON.Vector3.Zero();
             this._isLoaded = false;
             this._isReadyToPlay = false;
-            this._audioEngine = engine.getAudioEngine();
-            ;
+            this._audioEngine = engine.getAudioEngine();            
             this._readyToPlayCallback = readyToPlayCallback;
             if (distanceMax)
                 this.distanceMax = distanceMax;
@@ -77,10 +76,12 @@
             this._audioEngine.audioContext.decodeAudioData(audioData, function (buffer) {
                 _this._audioBuffer = buffer;
                 _this._isReadyToPlay = true;
-                if (_this.autoplay)
+                if (_this.autoplay) {
                     _this.play();
-                if (_this._readyToPlayCallback)
+				}
+                if (_this._readyToPlayCallback) {
                     _this._readyToPlayCallback();
+				}
             }, function (error) {
                 BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
             });

+ 2 - 2
Babylon/Audio/babylon.sound.ts

@@ -74,8 +74,8 @@
             this._audioEngine.audioContext.decodeAudioData(audioData, (buffer) => {
                 this._audioBuffer = buffer;
                 this._isReadyToPlay = true;
-                if (this.autoplay) this.play();
-                if (this._readyToPlayCallback) this._readyToPlayCallback();
+                if (this.autoplay) { this.play(); }
+                if (this._readyToPlayCallback) { this._readyToPlayCallback(); }
             }, function (error) {
                 BABYLON.Tools.Error("Error while decoding audio data: " + error.err);
             });

+ 12 - 0
Babylon/Math/babylon.math.js

@@ -2309,6 +2309,10 @@
                 var min = (minimum.x - this.origin.x) * inv;
                 var max = (maximum.x - this.origin.x) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     var temp = min;
                     min = max;
@@ -2332,6 +2336,10 @@
                 min = (minimum.y - this.origin.y) * inv;
                 max = (maximum.y - this.origin.y) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     temp = min;
                     min = max;
@@ -2355,6 +2363,10 @@
                 min = (minimum.z - this.origin.z) * inv;
                 max = (maximum.z - this.origin.z) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     temp = min;
                     min = max;

+ 12 - 0
Babylon/Math/babylon.math.ts

@@ -2308,6 +2308,10 @@
                 var min = (minimum.x - this.origin.x) * inv;
                 var max = (maximum.x - this.origin.x) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     var temp = min;
                     min = max;
@@ -2332,6 +2336,10 @@
                 min = (minimum.y - this.origin.y) * inv;
                 max = (maximum.y - this.origin.y) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     temp = min;
                     min = max;
@@ -2356,6 +2364,10 @@
                 min = (minimum.z - this.origin.z) * inv;
                 max = (maximum.z - this.origin.z) * inv;
 
+				if(max == -Infinity) {
+					max = Infinity; 
+				}
+				
                 if (min > max) {
                     temp = min;
                     min = max;