|
@@ -76,11 +76,12 @@ void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float al
|
|
|
rotationIK = 360 - rotationIK;
|
|
|
if (rotationIK > 180) rotationIK -= 360;
|
|
|
else if (rotationIK < -180) rotationIK += 360;
|
|
|
- spBone_updateWorldTransformWith(bone, bone->x, bone->y, rotation + (rotationIK - rotation) * alpha, bone->scaleX, bone->scaleY);
|
|
|
+ spBone_updateWorldTransformWith(bone, bone->x, bone->y, rotation + (rotationIK - rotation) * alpha, bone->appliedScaleX,
|
|
|
+ bone->appliedScaleY);
|
|
|
}
|
|
|
|
|
|
void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float targetY, int bendDir, float alpha) {
|
|
|
- float px = parent->x, py = parent->y, psx = parent->scaleX, psy = parent->scaleY;
|
|
|
+ float px = parent->x, py = parent->y, psx = parent->appliedScaleX, psy = parent->appliedScaleY;
|
|
|
float cx = child->x, cy = child->y, csx = child->appliedScaleX, cwx = child->worldX, cwy = child->worldY;
|
|
|
int o1, o2, s2, u;
|
|
|
spBone* pp = parent->parent;
|
|
@@ -198,9 +199,9 @@ void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float
|
|
|
}
|
|
|
}
|
|
|
outer: {
|
|
|
- float offset = ATAN2(cy, child->x) * s2;
|
|
|
- a1 = (a1 - offset) * RAD_DEG + o1;
|
|
|
- a2 = (a2 + offset) * RAD_DEG * s2 + o2;
|
|
|
+ float os = ATAN2(cy, cx) * s2;
|
|
|
+ a1 = (a1 - os) * RAD_DEG + o1;
|
|
|
+ a2 = (a2 + os) * RAD_DEG * s2 + o2;
|
|
|
if (a1 > 180) a1 -= 360;
|
|
|
else if (a1 < -180) a1 += 360;
|
|
|
if (a2 > 180) a2 -= 360;
|