mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-10 04:36:57 +08:00
[libgdx] One bone IK clean up.
This commit is contained in:
parent
203a648ae9
commit
d94ebeae7a
@ -186,12 +186,9 @@ public class IkConstraint implements Updatable {
|
|||||||
break;
|
break;
|
||||||
case noRotationOrReflection:
|
case noRotationOrReflection:
|
||||||
rotationIK += atan2(pc, pa) * radDeg;
|
rotationIK += atan2(pc, pa) * radDeg;
|
||||||
float ps = pa * pa + pc * pc;
|
float ps = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);
|
||||||
if (ps > 0.0001f) {
|
pb = -pc * ps;
|
||||||
ps = Math.abs(pa * pd - pb * pc) / ps;
|
pd = pa * ps;
|
||||||
pb = -pc * ps;
|
|
||||||
pd = pa * ps;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
float x = targetX - p.worldX, y = targetY - p.worldY;
|
float x = targetX - p.worldX, y = targetY - p.worldY;
|
||||||
float d = pa * pd - pb * pc;
|
float d = pa * pd - pb * pc;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user