Modifier reordering
This commit is contained in:
@@ -7,12 +7,12 @@ public class InverseKinematics{
|
||||
private static final Vec2[] mat1 = {new Vec2(), new Vec2()}, mat2 = {new Vec2(), new Vec2()};
|
||||
private static final Vec2 temp = new Vec2(), temp2 = new Vec2(), at1 = new Vec2();
|
||||
|
||||
static public boolean solve(float lengthA, float lengthB, Vec2 end, boolean side, Vec2 result){
|
||||
public static boolean solve(float lengthA, float lengthB, Vec2 end, boolean side, Vec2 result){
|
||||
at1.set(end).rotate(side ? 1 : -1).setLength(lengthA + lengthB).add(end.x / 2f, end.y / 2f);
|
||||
return solve(lengthA, lengthB, end, at1, result);
|
||||
}
|
||||
|
||||
static public boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
|
||||
public static boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
|
||||
Vec2 axis = mat2[0].set(end).nor();
|
||||
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
|
||||
mat1[0].set(mat2[0].x, mat2[1].x);
|
||||
|
||||
Reference in New Issue
Block a user