mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[ts] Ported IKConstraint fix.
This commit is contained in:
parent
d91d1691fc
commit
087bcfc43b
2950
spine-ts/build/spine-webgl.d.ts
vendored
2950
spine-ts/build/spine-webgl.d.ts
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -171,21 +171,24 @@ module spine {
|
||||
}
|
||||
let minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;
|
||||
let maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;
|
||||
let angle = Math.acos(-a * l1 / (aa - bb));
|
||||
x = a * Math.cos(angle) + l1;
|
||||
y = b * Math.sin(angle);
|
||||
d = x * x + y * y;
|
||||
if (d < minDist) {
|
||||
minAngle = angle;
|
||||
minDist = d;
|
||||
minX = x;
|
||||
minY = y;
|
||||
}
|
||||
if (d > maxDist) {
|
||||
maxAngle = angle;
|
||||
maxDist = d;
|
||||
maxX = x;
|
||||
maxY = y;
|
||||
c = -a * l1 / (aa - bb);
|
||||
if (c >= -1 && c <= 1) {
|
||||
c = Math.acos(c);
|
||||
x = a * Math.cos(c) + l1;
|
||||
y = b * Math.sin(c);
|
||||
d = x * x + y * y;
|
||||
if (d < minDist) {
|
||||
minAngle = c;
|
||||
minDist = d;
|
||||
minX = x;
|
||||
minY = y;
|
||||
}
|
||||
if (d > maxDist) {
|
||||
maxAngle = c;
|
||||
maxDist = d;
|
||||
maxX = x;
|
||||
maxY = y;
|
||||
}
|
||||
}
|
||||
if (dd <= (minDist + maxDist) / 2) {
|
||||
a1 = ta - Math.atan2(minY * bendDir, minX);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user