Class FABRIK2D
Utility for 2D Forward And Backward Reaching Inverse Kinematics (FABRIK) IK Solver.
Namespace: UnityEngine.U2D.IK
Syntax
public static class FABRIK2D : object
Methods
Solve(Vector2, Int32, Single, Single[], ref Vector2[])
Solve IK based on FABRIK
Declaration
public static bool Solve(Vector2 targetPosition, int solverLimit, float tolerance, float[] lengths, ref Vector2[] positions)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | targetPosition | Target position. |
Int32 | solverLimit | Solver iteration count. |
Single | tolerance | Target position's tolerance. |
Single[] | lengths | Length of the chains. |
Vector2[] | positions | Chain positions. |
Returns
Type | Description |
---|---|
Boolean | Returns true if solver successfully completes within iteration limit. False otherwise. |
SolveChain(Int32, ref FABRIKChain2D[])
Solve IK based on FABRIK.
Declaration
public static bool SolveChain(int solverLimit, ref FABRIKChain2D[] chains)
Parameters
Type | Name | Description |
---|---|---|
Int32 | solverLimit | Solver iteration count. |
UnityEngine.U2D.IK.FABRIKChain2D[] | chains | FABRIK chains. |
Returns
Type | Description |
---|---|
Boolean | True if solver successfully completes within iteration limit. False otherwise. |