mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[c][cpp] Fix for #2412
This commit is contained in:
parent
b62cb372e5
commit
501ad3553d
@ -80,8 +80,8 @@ void spIkConstraint_apply1(spBone *bone, float targetX, float targetY, int /*boo
|
||||
|
||||
switch (bone->data->transformMode) {
|
||||
case SP_TRANSFORMMODE_ONLYTRANSLATION:
|
||||
tx = targetX - bone->worldX;
|
||||
ty = targetY - bone->worldY;
|
||||
tx = (targetX - bone->worldX) * SIGNUM(bone->skeleton->scaleX);
|
||||
ty = (targetY - bone->worldY) * SIGNUM(bone->skeleton->scaleY);
|
||||
break;
|
||||
case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: {
|
||||
s = ABS(pa * pd - pb * pc) / MAX(0.0001f, pa * pa + pc * pc);
|
||||
|
||||
@ -47,8 +47,8 @@ void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress
|
||||
|
||||
switch (bone._data.getTransformMode()) {
|
||||
case TransformMode_OnlyTranslation:
|
||||
tx = targetX - bone._worldX;
|
||||
ty = targetY - bone._worldY;
|
||||
tx = (targetX - bone._worldX) * MathUtil::sign(bone.getSkeleton().getScaleX());
|
||||
ty = (targetY - bone._worldY) * MathUtil::sign(bone.getSkeleton().getScaleY());
|
||||
break;
|
||||
case TransformMode_NoRotationOrReflection: {
|
||||
float s = MathUtil::abs(pa * pd - pb * pc) / MathUtil::max(0.0001f, pa * pa + pc * pc);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user