瀏覽代碼

Merge pull request #380 from raananw/master

Fix for the enum-to-string compile problem
David Catuhe 10 年之前
父節點
當前提交
bd624db232
共有 2 個文件被更改,包括 8 次插入8 次删除
  1. 4 4
      Babylon/Audio/babylon.sound.js
  2. 4 4
      Babylon/Audio/babylon.sound.ts

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

@@ -17,8 +17,8 @@
             this.refDistance = 1;
             this.refDistance = 1;
             this.rolloffFactor = 1;
             this.rolloffFactor = 1;
             this.maxDistance = 100;
             this.maxDistance = 100;
-            this.distanceModel = "linear";
-            this.panningModel = "HRTF";
+            this.distanceModel = DistanceModelType.linear;
+            this.panningModel = PanningModelType.HRTF;
             this.startTime = 0;
             this.startTime = 0;
             this.startOffset = 0;
             this.startOffset = 0;
             this._position = BABYLON.Vector3.Zero();
             this._position = BABYLON.Vector3.Zero();
@@ -116,11 +116,11 @@
 
 
                 if (this.useCustomAttenuation) {
                 if (this.useCustomAttenuation) {
                     // Tricks to disable in a way embedded Web Audio attenuation
                     // Tricks to disable in a way embedded Web Audio attenuation
-                    this._soundPanner.distanceModel = "linear";
+                    this._soundPanner.distanceModel = DistanceModelType.linear;
                     this._soundPanner.maxDistance = Number.MAX_VALUE;
                     this._soundPanner.maxDistance = Number.MAX_VALUE;
                     this._soundPanner.refDistance = 1;
                     this._soundPanner.refDistance = 1;
                     this._soundPanner.rolloffFactor = 1;
                     this._soundPanner.rolloffFactor = 1;
-                    this._soundPanner.panningModel = "HRTF";
+                    this._soundPanner.panningModel = PanningModelType.HRTF;
                 } else {
                 } else {
                     this._soundPanner.distanceModel = this.distanceModel;
                     this._soundPanner.distanceModel = this.distanceModel;
                     this._soundPanner.maxDistance = this.maxDistance;
                     this._soundPanner.maxDistance = this.maxDistance;

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

@@ -8,8 +8,8 @@
         public refDistance: number = 1;
         public refDistance: number = 1;
         public rolloffFactor: number = 1;
         public rolloffFactor: number = 1;
         public maxDistance: number = 100;
         public maxDistance: number = 100;
-        public distanceModel: string = "linear"; 
-        public panningModel: string = "HRTF";
+        public distanceModel: DistanceModelType = DistanceModelType.linear; 
+        public panningModel: PanningModelType = PanningModelType.HRTF;
         private startTime: number = 0;
         private startTime: number = 0;
         private startOffset: number = 0;
         private startOffset: number = 0;
         private _position: Vector3 = Vector3.Zero();
         private _position: Vector3 = Vector3.Zero();
@@ -124,11 +124,11 @@
 
 
                 if (this.useCustomAttenuation) {
                 if (this.useCustomAttenuation) {
                     // Tricks to disable in a way embedded Web Audio attenuation 
                     // Tricks to disable in a way embedded Web Audio attenuation 
-                    this._soundPanner.distanceModel = "linear";
+                    this._soundPanner.distanceModel = DistanceModelType.linear;
                     this._soundPanner.maxDistance = Number.MAX_VALUE;
                     this._soundPanner.maxDistance = Number.MAX_VALUE;
                     this._soundPanner.refDistance = 1;
                     this._soundPanner.refDistance = 1;
                     this._soundPanner.rolloffFactor = 1;
                     this._soundPanner.rolloffFactor = 1;
-                    this._soundPanner.panningModel = "HRTF";
+                    this._soundPanner.panningModel = PanningModelType.HRTF;
                 }
                 }
                 else {
                 else {
                     this._soundPanner.distanceModel = this.distanceModel;
                     this._soundPanner.distanceModel = this.distanceModel;