From 719e09d443355688d5edf99054a5e6cc6005dfea Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sat, 30 Nov 2013 16:01:57 +0100 Subject: [PATCH] Fixed root translation with yDown coordinates. http://www.esotericsoftware.com/forum/viewtopic.php?f=9&t=1657 --- spine-as3/spine-as3/src/spine/Bone.as | 2 +- spine-c/src/spine/Bone.c | 2 +- spine-csharp/src/Bone.cs | 2 +- spine-js/spine.js | 4 ++-- spine-libgdx/src/com/esotericsoftware/spine/Bone.java | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spine-as3/spine-as3/src/spine/Bone.as b/spine-as3/spine-as3/src/spine/Bone.as index 7a97c66a9..0a2d7513a 100644 --- a/spine-as3/spine-as3/src/spine/Bone.as +++ b/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; diff --git a/spine-c/src/spine/Bone.c b/spine-c/src/spine/Bone.c index c322ff1c9..41c9f42b7 100644 --- a/spine-c/src/spine/Bone.c +++ b/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; diff --git a/spine-csharp/src/Bone.cs b/spine-csharp/src/Bone.cs index 0c0ab4315..926499dae 100644 --- a/spine-csharp/src/Bone.cs +++ b/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; diff --git a/spine-js/spine.js b/spine-js/spine.js index 0746ce8e5..fadd8b0a5 100644 --- a/spine-js/spine.js +++ b/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; diff --git a/spine-libgdx/src/com/esotericsoftware/spine/Bone.java b/spine-libgdx/src/com/esotericsoftware/spine/Bone.java index 57c076b62..95f2deaf1 100644 --- a/spine-libgdx/src/com/esotericsoftware/spine/Bone.java +++ b/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;