Ver código fonte

Update texture center to rotationCenter

Gary Hsu 7 anos atrás
pai
commit
c0e3f14808

+ 2 - 2
loaders/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -25,8 +25,8 @@ module BABYLON.GLTF2.Extensions {
                     }
 
                     // Always rotate around the origin.
-                    babylonTexture.uCenter = 0;
-                    babylonTexture.vCenter = 0;
+                    babylonTexture.uRotationCenter = 0;
+                    babylonTexture.vRotationCenter = 0;
 
                     if (extension.rotation) {
                         babylonTexture.wAng = -extension.rotation;

+ 9 - 9
src/Materials/Textures/babylon.texture.ts

@@ -69,19 +69,19 @@
          * Defines the center of rotation (U)
          */
         @serialize()
-        public uCenter = 0.5;
+        public uRotationCenter = 0.5;
 
         /**
          * Defines the center of rotation (V)
          */
         @serialize()
-        public vCenter = 0.5;
+        public vRotationCenter = 0.5;
 
         /**
          * Defines the center of rotation (W)
          */
         @serialize()
-        public wCenter = 0.5;
+        public wRotationCenter = 0.5;
 
         get noMipmap(): boolean {
             return this._noMipmap;
@@ -247,15 +247,15 @@
             x *= this.uScale;
             y *= this.vScale;
 
-            x -= this.uCenter * this.uScale;
-            y -= this.vCenter * this.vScale;
-            z -= this.wCenter;
+            x -= this.uRotationCenter * this.uScale;
+            y -= this.vRotationCenter * this.vScale;
+            z -= this.wRotationCenter;
 
             Vector3.TransformCoordinatesFromFloatsToRef(x, y, z, this._rowGenerationMatrix, t);
 
-            t.x += this.uCenter * this.uScale + this.uOffset;
-            t.y += this.vCenter * this.vScale + this.vOffset;
-            t.z += this.wCenter;
+            t.x += this.uRotationCenter * this.uScale + this.uOffset;
+            t.y += this.vRotationCenter * this.vScale + this.vOffset;
+            t.z += this.wRotationCenter;
         }
 
         public getTextureMatrix(): Matrix {