Skip to main content

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

ParamTypeDescription
jointsArray.<Transform>Will be updated as a result of the solve
lengthsArray.<number>distance to next bone
originVector3where should the first joint be placed at
targetVector3where should the last joint be placed at
[max_iterations]numberMore 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]numberMinimum squared distance to be achieved to the target, used to terminate earlier before maximum number of iterations is reached