Fixed skeleton flip when rotation and scale are disabled.

This commit is contained in:
NathanSweet 2016-04-12 23:25:31 +02:00
parent 8c55aa1f62
commit b22669711d

View File

@ -131,7 +131,8 @@ public class Bone implements Updatable {
b = pa * lb + pb * ld;
c = pc * la + pd * lc;
d = pc * lb + pd * ld;
} else if (data.inheritRotation) { // No scale inheritance.
} else {
if (data.inheritRotation) { // No scale inheritance.
pa = 1;
pb = 0;
pc = 0;
@ -153,21 +154,13 @@ public class Bone implements Updatable {
b = pa * lb + pb * ld;
c = pc * la + pd * lc;
d = pc * lb + pd * ld;
if (skeleton.flipX) {
a = -a;
b = -b;
}
if (skeleton.flipY) {
c = -c;
d = -d;
}
} else if (data.inheritScale) { // No rotation inheritance.
pa = 1;
pb = 0;
pc = 0;
pd = 1;
do {
float r = parent.rotation;
float r = parent.appliedRotation;
cos = MathUtils.cosDeg(r);
sin = MathUtils.sinDeg(r);
float psx = parent.appliedScaleX, psy = parent.appliedScaleY;
@ -196,6 +189,12 @@ public class Bone implements Updatable {
b = pa * lb + pb * ld;
c = pc * la + pd * lc;
d = pc * lb + pd * ld;
} else {
a = la;
b = lb;
c = lc;
d = ld;
}
if (skeleton.flipX) {
a = -a;
b = -b;
@ -204,11 +203,6 @@ public class Bone implements Updatable {
c = -c;
d = -d;
}
} else {
a = la;
b = lb;
c = lc;
d = ld;
}
}