mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-14 11:01:36 +08:00
[haxe] Port of commit 877e705dd. Fix NaN in IKConstraint due to fp precision.
This commit is contained in:
parent
e4df0c0dff
commit
ec52a4fc1a
@ -288,8 +288,9 @@ class IkConstraint implements Updatable {
|
||||
q = -(c1 + q) / 2;
|
||||
var r0:Float = q / c2, r1:Float = c / q;
|
||||
var r:Float = Math.abs(r0) < Math.abs(r1) ? r0 : r1;
|
||||
if (r * r <= dd) {
|
||||
y = Math.sqrt(dd - r * r) * bendDir;
|
||||
r0 = dd - r * r;
|
||||
if (r0 >= 0) {
|
||||
y = Math.sqrt(r0) * bendDir;
|
||||
a1 = ta - Math.atan2(y, r);
|
||||
a2 = Math.atan2(y / psy, (r - l1) / psx);
|
||||
breakOuter = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user