mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[cpp] Fix IkConstraint::apply, updated the applied transform first. Closes #2199.
This commit is contained in:
parent
674fab37f0
commit
d33c10f856
@ -44,11 +44,11 @@ using namespace spine;
|
|||||||
RTTI_IMPL(IkConstraint, Updatable)
|
RTTI_IMPL(IkConstraint, Updatable)
|
||||||
|
|
||||||
void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha) {
|
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();
|
Bone *p = bone.getParent();
|
||||||
float pa = p->_a, pb = p->_b, pc = p->_c, pd = p->_d;
|
float pa = p->_a, pb = p->_b, pc = p->_c, pd = p->_d;
|
||||||
float rotationIK = -bone._ashearX - bone._arotation;
|
float rotationIK = -bone._ashearX - bone._arotation;
|
||||||
float tx = 0, ty = 0;
|
float tx = 0, ty = 0;
|
||||||
if (!bone._appliedValid) bone.updateAppliedTransform();
|
|
||||||
|
|
||||||
switch(bone._data.getTransformMode()) {
|
switch(bone._data.getTransformMode()) {
|
||||||
case TransformMode_OnlyTranslation:
|
case TransformMode_OnlyTranslation:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user