Explorar o código

Merge pull request #3795 from RaananW/remove-BABYLON-references

removing BABYLON references from ts src
Raanan Weber %!s(int64=7) %!d(string=hai) anos
pai
achega
d95e4da429

+ 3 - 3
src/Debug/babylon.debugModules.ts

@@ -368,7 +368,7 @@ module BABYLON {
 
                 if (x !== 0 || y !== 0 || z !== 0) {
                     var tmat2 = Tmp.Matrix[1];
-                    BABYLON.Matrix.IdentityToRef(tmat2);
+                    Matrix.IdentityToRef(tmat2);
                     tmat2.m[12] = x;
                     tmat2.m[13] = y;
                     tmat2.m[14] = z;
@@ -438,10 +438,10 @@ module BABYLON {
                 }
 
                 if (!this._debugMesh) {
-                    this._debugMesh = BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, this._scene);
+                    this._debugMesh = MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: null }, this._scene);
                     this._debugMesh.renderingGroupId = this.renderingGroupId;
                 } else {
-                    BABYLON.MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
+                    MeshBuilder.CreateLineSystem("", { lines: this._debugLines, updatable: true, instance: this._debugMesh }, this._scene);
                 }
                 this._debugMesh.position.copyFrom(this.mesh.position);
                 this._debugMesh.color = this.color;

+ 7 - 7
src/Helpers/babylon.videoDome.ts

@@ -62,18 +62,18 @@ module BABYLON {
             options.size = Math.abs(options.size as any) || (scene.activeCamera ? scene.activeCamera.maxZ * 0.48 : 1000);
 
             // create
-            let tempOptions:VideoTextureSettings = {loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true};
-            let material = this._material = new BABYLON.BackgroundMaterial(name+"_material", scene);
-            let texture = this._videoTexture = new BABYLON.VideoTexture(name+"_texture", urlsOrVideo, scene, false, false, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
-            this._mesh = BABYLON.MeshBuilder.CreateIcoSphere(name+"_mesh", {
+            let tempOptions: VideoTextureSettings = { loop: options.loop, autoPlay: options.autoPlay, autoUpdateTexture: true };
+            let material = this._material = new BackgroundMaterial(name + "_material", scene);
+            let texture = this._videoTexture = new VideoTexture(name + "_texture", urlsOrVideo, scene, false, false, Texture.TRILINEAR_SAMPLINGMODE, tempOptions);
+            this._mesh = MeshBuilder.CreateIcoSphere(name + "_mesh", {
                 flat: false, // saves on vertex data
                 radius: options.size,
                 subdivisions: options.resolution,
-                sideOrientation: BABYLON.Mesh.BACKSIDE // needs to be inside out
+                sideOrientation: Mesh.BACKSIDE // needs to be inside out
             }, scene);
 
             // configure material
-            texture.coordinatesMode = BABYLON.Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE; // matches orientation
+            texture.coordinatesMode = Texture.FIXED_EQUIRECTANGULAR_MIRRORED_MODE; // matches orientation
             texture.wrapV = Texture.CLAMP_ADDRESSMODE; // always clamp the up/down
             material.reflectionTexture = this._videoTexture;
             material.useEquirectangularFOV = true;
@@ -84,7 +84,7 @@ module BABYLON {
             this._mesh.parent = this;
 
             // optional configuration
-            if(options.clickToPlay) {
+            if (options.clickToPlay) {
                 scene.onPointerUp = () => {
                     this._videoTexture.video.play();
                 }

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

@@ -40,7 +40,7 @@
 
         public static CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean) {
             let rootUrlKey = "";
-            
+
             files.forEach(url => rootUrlKey += url);
 
             return new CubeTexture(rootUrlKey, scene, null, noMipmap, files);
@@ -144,18 +144,18 @@
         public setReflectionTextureMatrix(value: Matrix): void {
             this._textureMatrix = value;
         }
-        
+
         public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CubeTexture {
             var texture = SerializationHelper.Parse(() => {
                 return new CubeTexture(rootUrl + parsedTexture.name, scene, parsedTexture.extensions);
             }, parsedTexture, scene);
-            
+
             // Local Cubemaps
             if (parsedTexture.boundingBoxPosition) {
-                texture.boundingBoxPosition = BABYLON.Vector3.FromArray(parsedTexture.boundingBoxPosition);
+                texture.boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);
             }
             if (parsedTexture.boundingBoxSize) {
-                texture.boundingBoxSize = BABYLON.Vector3.FromArray(parsedTexture.boundingBoxSize);
+                texture.boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);
             }
 
             // Animations

+ 3 - 3
src/Materials/Textures/babylon.hdrCubeTexture.ts

@@ -84,7 +84,7 @@ module BABYLON {
         public get boundingBoxSize(): Vector3 {
             return this._boundingBoxSize;
         }
-        
+
         /**
          * Instantiates an HDRTexture from the following parameters.
          * 
@@ -472,10 +472,10 @@ module BABYLON {
             }
             if (texture) {
                 if (parsedTexture.boundingBoxPosition) {
-                    (<any>texture).boundingBoxPosition = BABYLON.Vector3.FromArray(parsedTexture.boundingBoxPosition);
+                    (<any>texture).boundingBoxPosition = Vector3.FromArray(parsedTexture.boundingBoxPosition);
                 }
                 if (parsedTexture.boundingBoxSize) {
-                    (<any>texture).boundingBoxSize = BABYLON.Vector3.FromArray(parsedTexture.boundingBoxSize);
+                    (<any>texture).boundingBoxSize = Vector3.FromArray(parsedTexture.boundingBoxSize);
                 }
             }
             return texture;

+ 35 - 35
src/Math/babylon.math.ts

@@ -18,11 +18,11 @@
             /**
              * Defines the red component (between 0 and 1, default is 0)
              */
-            public r: number = 0, 
+            public r: number = 0,
             /**
              * Defines the green component (between 0 and 1, default is 0) 
              */
-            public g: number = 0, 
+            public g: number = 0,
             /**
              * Defines the blue component (between 0 and 1, default is 0)
              */
@@ -175,9 +175,9 @@
          * @returns the original Color3
          */
         public clampToRef(min: number = 0, max: number = 1, result: Color3): Color3 {
-            result.r = BABYLON.Scalar.Clamp(this.r, min, max);
-            result.g = BABYLON.Scalar.Clamp(this.g, min, max);
-            result.b = BABYLON.Scalar.Clamp(this.b, min, max);
+            result.r = Scalar.Clamp(this.r, min, max);
+            result.g = Scalar.Clamp(this.g, min, max);
+            result.b = Scalar.Clamp(this.b, min, max);
             return this;
         }
 
@@ -387,58 +387,58 @@
         /**
          * Returns a Color3 value containing a green color
          * @returns a new Color3 object
-         */        
+         */
         public static Green(): Color3 { return new Color3(0, 1, 0); }
         /**
          * Returns a Color3 value containing a blue color
          * @returns a new Color3 object
-         */        
+         */
         public static Blue(): Color3 { return new Color3(0, 0, 1); }
         /**
          * Returns a Color3 value containing a black color
          * @returns a new Color3 object
-         */        
+         */
         public static Black(): Color3 { return new Color3(0, 0, 0); }
         /**
          * Returns a Color3 value containing a white color
          * @returns a new Color3 object
-         */        
+         */
         public static White(): Color3 { return new Color3(1, 1, 1); }
         /**
          * Returns a Color3 value containing a purple color
          * @returns a new Color3 object
-         */        
+         */
         public static Purple(): Color3 { return new Color3(0.5, 0, 0.5); }
         /**
          * Returns a Color3 value containing a magenta color
          * @returns a new Color3 object
-         */        
+         */
         public static Magenta(): Color3 { return new Color3(1, 0, 1); }
         /**
          * Returns a Color3 value containing a yellow color
          * @returns a new Color3 object
-         */        
+         */
         public static Yellow(): Color3 { return new Color3(1, 1, 0); }
         /**
          * Returns a Color3 value containing a gray color
          * @returns a new Color3 object
-         */        
+         */
         public static Gray(): Color3 { return new Color3(0.5, 0.5, 0.5); }
         /**
          * Returns a Color3 value containing a teal color
          * @returns a new Color3 object
-         */        
+         */
         public static Teal(): Color3 { return new Color3(0, 1.0, 1.0); }
         /**
          * Returns a Color3 value containing a random color
          * @returns a new Color3 object
-         */     
+         */
         public static Random(): Color3 { return new Color3(Math.random(), Math.random(), Math.random()); }
     }
 
     /**
      * Class used to hold a RBGA color
-     */    
+     */
     export class Color4 {
         /**
          * Creates a new Color4 object from red, green, blue values, all between 0 and 1
@@ -451,15 +451,15 @@
             /**
              * Defines the red component (between 0 and 1, default is 0)
              */
-            public r: number = 0, 
+            public r: number = 0,
             /**
              * Defines the green component (between 0 and 1, default is 0) 
              */
-            public g: number = 0, 
+            public g: number = 0,
             /**
              * Defines the blue component (between 0 and 1, default is 0)
              */
-            public b: number = 0, 
+            public b: number = 0,
             /**
              * Defines the alpha component (between 0 and 1, default is 1)
              */
@@ -571,10 +571,10 @@
          * @returns the cuurent Color4
          */
         public clampToRef(min: number = 0, max: number = 1, result: Color4): Color4 {
-            result.r = BABYLON.Scalar.Clamp(this.r, min, max);
-            result.g = BABYLON.Scalar.Clamp(this.g, min, max);
-            result.b = BABYLON.Scalar.Clamp(this.b, min, max);
-            result.a = BABYLON.Scalar.Clamp(this.a, min, max);
+            result.r = Scalar.Clamp(this.r, min, max);
+            result.g = Scalar.Clamp(this.g, min, max);
+            result.b = Scalar.Clamp(this.b, min, max);
+            result.a = Scalar.Clamp(this.a, min, max);
             return this;
         }
 
@@ -1294,11 +1294,11 @@
             /**
              * Defines the first coordinates (on X axis)
              */
-            public x: number, 
+            public x: number,
             /**
              * Defines the second coordinates (on Y axis)
              */
-            public y: number, 
+            public y: number,
             /**
              * Defines the third coordinates (on Z axis)
              */
@@ -1798,10 +1798,10 @@
          * @param normal direction of the normal
          * @return the angle between vector0 and vector1
          */
-        public static GetAngleBetweenVectors(vector0: Vector3, vector1: Vector3, normal: Vector3):number {
-            var v0:Vector3 = vector0.clone().normalize();
-            var v1:Vector3 = vector1.clone().normalize();
-            var dot:number = Vector3.Dot(v0, v1);
+        public static GetAngleBetweenVectors(vector0: Vector3, vector1: Vector3, normal: Vector3): number {
+            var v0: Vector3 = vector0.clone().normalize();
+            var v1: Vector3 = vector1.clone().normalize();
+            var dot: number = Vector3.Dot(v0, v1);
             var n = Vector3.Cross(v0, v1);
             if (Vector3.Dot(n, normal) > 0) {
                 return Math.acos(dot);
@@ -2301,7 +2301,7 @@
          * @param left defines the first operand
          * @param right defines the second operand
          * @returns the new Vector3
-         */        
+         */
         public static Maximize(left: Vector3, right: Vector3): Vector3 {
             var max = left.clone();
             max.maximizeInPlace(right);
@@ -3897,15 +3897,15 @@
          * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).  
          * @param ref matrix to store the result
          */
-        public toNormalMatrix(ref : Matrix): void {            
+        public toNormalMatrix(ref: Matrix): void {
             this.invertToRef(ref)
             ref.transpose();
             var m = ref.m;
             Matrix.FromValuesToRef(
-                m[0], m[1], m[2],  0,
-                m[4], m[5], m[6],  0,
+                m[0], m[1], m[2], 0,
+                m[4], m[5], m[6], 0,
                 m[8], m[9], m[10], 0,
-                0,    0,    0,     1, ref);
+                0, 0, 0, 1, ref);
         }
 
         /**
@@ -3916,7 +3916,7 @@
             this.getRotationMatrixToRef(result);
             return result;
         }
-       
+
         /**
          * Extracts the rotation matrix from the current one and sets it as the passed "result".  
          * Returns the current Matrix.