Unit tweaks

This commit is contained in:
Anuken
2020-06-08 16:33:21 -04:00
parent bb9855e830
commit 43762e82a8
46 changed files with 841 additions and 836 deletions

View File

@@ -20,8 +20,7 @@ public class InverseKinematics{
result.set(mat2[0].dot(end), mat2[1].dot(end));
float len = result.len();
float dist = Math.max(0, Math.min(lengthA, (len + (lengthA * lengthA - lengthB * lengthB) / len) / 2));
float e = Mathf.sqrt(lengthA * lengthA - dist * dist);
Vec2 src = temp.set(dist, e);
Vec2 src = temp.set(dist, Mathf.sqrt(lengthA * lengthA - dist * dist));
result.set(mat1[0].dot(src), mat1[1].dot(src));
return dist > 0 && dist < lengthA;