Improved fix for TransformMode.noRotationOrReflection with skeleton scale.

#1668
http://esotericsoftware.com/forum/WebGL-ScaleX-Question-13983
This commit is contained in:
Nathan Sweet 2020-05-20 12:36:20 +02:00
parent 6a9403511d
commit d7203eec1a

View File

@ -151,6 +151,8 @@ public class Bone implements Updatable {
float s = pa * pa + pc * pc, prx; float s = pa * pa + pc * pc, prx;
if (s > 0.0001f) { if (s > 0.0001f) {
s = Math.abs(pa * pd - pb * pc) / s; s = Math.abs(pa * pd - pb * pc) / s;
pa /= skeleton.scaleX;
pc /= skeleton.scaleY;
pb = pc * s; pb = pc * s;
pd = pa * s; pd = pa * s;
prx = atan2(pc, pa) * radDeg; prx = atan2(pc, pa) * radDeg;
@ -169,7 +171,7 @@ public class Bone implements Updatable {
b = pa * lb - pb * ld; b = pa * lb - pb * ld;
c = pc * la + pd * lc; c = pc * la + pd * lc;
d = pc * lb + pd * ld; d = pc * lb + pd * ld;
return; break;
} }
case noScale: case noScale:
case noScaleOrReflection: { case noScaleOrReflection: {