fabrik_solve
fabrik_solve(joints, lengths, origin, target, [max_iterations], [distance_tolerance])
Note that bones are defined as a combination of Joint (Transform) and bone length. Joint defines the origin of the bone. Last joint's position is expected to be bone_length distance from the target if target is reachable and be oriented towards that target (Transform.lookAt)
Kind: global function
| Param | Type | Description |
|---|---|---|
| joints | Array.<Transform> | Will be updated as a result of the solve |
| lengths | Array.<number> | distance to next bone |
| origin | Vector3 | where should the first joint be placed at |
| target | Vector3 | where should the last joint be placed at |
| [max_iterations] | number | More steps will lead to higher accuracy, but at the cost of computation. Generally solution will be reached in just a few iteration so this is just a ceiling |
| [distance_tolerance] | number | Minimum squared distance to be achieved to the target, used to terminate earlier before maximum number of iterations is reached |