mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 02:06:03 +08:00
Improved fix for TransformMode.noRotationOrReflection with skeleton scale.
#1668 http://esotericsoftware.com/forum/WebGL-ScaleX-Question-13983
This commit is contained in:
parent
6a9403511d
commit
d7203eec1a
@ -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: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user