[cpp] Fix IkConstraint::apply, updated the applied transform first. Closes #2199.

This commit is contained in:
Mario Zechner 2022-11-29 09:19:28 +01:00
parent 674fab37f0
commit d33c10f856

View File

@ -44,11 +44,11 @@ using namespace spine;
RTTI_IMPL(IkConstraint, Updatable)
void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha) {
if (!bone._appliedValid) bone.updateAppliedTransform();
Bone *p = bone.getParent();
float pa = p->_a, pb = p->_b, pc = p->_c, pd = p->_d;
float rotationIK = -bone._ashearX - bone._arotation;
float tx = 0, ty = 0;
if (!bone._appliedValid) bone.updateAppliedTransform();
float tx = 0, ty = 0;
switch(bone._data.getTransformMode()) {
case TransformMode_OnlyTranslation: