mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Fix android-specific rotation issue. bone->arotation == NaN, in some specific cases during update bones, cause squared value can been very smoll but still negative anyway and create NaN value (#2459)
This commit is contained in:
parent
f4c0f64f0d
commit
0ffc316793
@ -246,8 +246,9 @@ void spIkConstraint_apply2(spBone *parent, spBone *child, float targetX, float t
|
|||||||
r0 = q / c2;
|
r0 = q / c2;
|
||||||
r1 = c0 / q;
|
r1 = c0 / q;
|
||||||
r = ABS(r0) < ABS(r1) ? r0 : r1;
|
r = ABS(r0) < ABS(r1) ? r0 : r1;
|
||||||
if (r * r <= dd) {
|
y = dd - r * r;
|
||||||
y = SQRT(dd - r * r) * bendDir;
|
if (y > 0) {
|
||||||
|
y = SQRT(y) * bendDir;
|
||||||
a1 = ta - ATAN2(y, r);
|
a1 = ta - ATAN2(y, r);
|
||||||
a2 = ATAN2(y / psy, (r - l1) / psx);
|
a2 = ATAN2(y / psy, (r - l1) / psx);
|
||||||
goto break_outer;
|
goto break_outer;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user