Package mindustry.graphics
Class InverseKinematics
java.lang.Object
mindustry.graphics.InverseKinematics
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
InverseKinematics
public InverseKinematics()
-
-
Method Details
-
solve
-
solve
inputs:- Parameters:
lengthA
- first line segment lengthlengthB
- second line segment lengthend
- length of the endpoint you want to reachattractor
- direction you want the result to be closer to (since there are usually 2 solutions) output:result
- a point in-between (0, 0) and (end) such that (0, 0).dst(result) == lengthA and result.dst(end) == lengthB - or in basic terms, the position of a joint between (0, 0) and end where the two lengths of segments are lengthA and lengthB- Returns:
- whether IK succeeded (this can fail if end is too far, for example)
-