Fixed root translation with yDown coordinates.

http://www.esotericsoftware.com/forum/viewtopic.php?f=9&t=1657
This commit is contained in:
NathanSweet 2013-11-30 16:01:57 +01:00
parent 3977ce93e2
commit 719e09d443
5 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

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