Browse Source

Fixed root translation with yDown coordinates.

http://www.esotericsoftware.com/forum/viewtopic.php?f=9&t=1657
NathanSweet 11 years ago
parent
commit
719e09d443

+ 1 - 1
spine-as3/spine-as3/src/spine/Bone.as

@@ -78,7 +78,7 @@ public class Bone {
 			_worldRotation = _data.inheritRotation ? _parent._worldRotation + rotation : rotation;
 		} else {
 			_worldX = flipX ? -x : x;
-			_worldY = flipY ? -y : y;
+			_worldY = (flipY != yDown) ? -y : y;
 			_worldScaleX = scaleX;
 			_worldScaleY = scaleY;
 			_worldRotation = rotation;

+ 1 - 1
spine-c/src/spine/Bone.c

@@ -76,7 +76,7 @@ void spBone_updateWorldTransform (spBone* self, int flipX, int flipY) {
 				self->data->inheritRotation ? self->parent->worldRotation + self->rotation : self->rotation;
 	} else {
 		CONST_CAST(float, self->worldX) = flipX ? -self->x : self->x;
-		CONST_CAST(float, self->worldY) = flipX ? -self->y : self->y;
+		CONST_CAST(float, self->worldY) = (flipY != yDown) ? -self->y : self->y;
 		CONST_CAST(float, self->worldScaleX) = self->scaleX;
 		CONST_CAST(float, self->worldScaleY) = self->scaleY;
 		CONST_CAST(float, self->worldRotation) = self->rotation;

+ 1 - 1
spine-csharp/src/Bone.cs

@@ -85,7 +85,7 @@ namespace Spine {
 				worldRotation = data.inheritRotation ? parent.worldRotation + rotation : rotation;
 			} else {
 				worldX = flipX ? -x : x;
-				worldY = flipY ? -y : y;
+				worldY = (flipY != yDown) ? -y : y;
 				worldScaleX = scaleX;
 				worldScaleY = scaleY;
 				worldRotation = rotation;

+ 2 - 2
spine-js/spine.js

@@ -84,8 +84,8 @@ spine.Bone.prototype = {
 			}
 			this.worldRotation = this.data.inheritRotation ? parent.worldRotation + this.rotation : this.rotation;
 		} else {
-			this.worldX = this.x;
-			this.worldY = this.y;
+			this.worldX = flipX ? -this.x : this.x;
+			this.worldY = (flipY != spine.Bone.yDown) ? -this.y : this.y;
 			this.worldScaleX = this.scaleX;
 			this.worldScaleY = this.scaleY;
 			this.worldRotation = this.rotation;

+ 3 - 3
spine-libgdx/src/com/esotericsoftware/spine/Bone.java

@@ -41,12 +41,12 @@ import com.badlogic.gdx.math.Matrix3;
 public class Bone {
 	final BoneData data;
 	final Bone parent;
-	float x, y;
+	public float x, y;
 	float rotation;
 	float scaleX, scaleY;
 
-	float m00, m01, worldX; // a b x
-	float m10, m11, worldY; // c d y
+	public float m00, m01, worldX; // a b x
+	public float m10, m11, worldY; // c d y
 	float worldRotation;
 	float worldScaleX, worldScaleY;