mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[csharp] Port of commit c11afb2, see #2412. Take skeleton scale into account when applying translation only IK constraint.
This commit is contained in:
parent
5d4b86e070
commit
907166572b
@ -168,8 +168,8 @@ namespace Spine {
|
||||
|
||||
switch (bone.data.transformMode) {
|
||||
case TransformMode.OnlyTranslation:
|
||||
tx = targetX - bone.worldX;
|
||||
ty = targetY - bone.worldY;
|
||||
tx = (targetX - bone.worldX) * Math.Sign(bone.skeleton.ScaleX);
|
||||
ty = (targetY - bone.worldY) * Math.Sign(bone.skeleton.ScaleY);
|
||||
break;
|
||||
case TransformMode.NoRotationOrReflection: {
|
||||
float s = Math.Abs(pa * pd - pb * pc) / Math.Max(0.0001f, pa * pa + pc * pc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user