Class FabrikSolver2D
Component responsible for 2D Forward And Backward Reaching Inverse Kinematics (FABRIK) IK.
Inherited Members
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectsByType<T>(UnityEngine.FindObjectsInactive, UnityEngine.FindObjectsSortMode)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
UnityEngine.Object.FindFirstObjectByType<T>()
UnityEngine.Object.FindAnyObjectByType<T>()
UnityEngine.Object.FindFirstObjectByType<T>(UnityEngine.FindObjectsInactive)
UnityEngine.Object.FindAnyObjectByType<T>(UnityEngine.FindObjectsInactive)
Namespace: UnityEngine.U2D.IK
Syntax
[MovedFrom("UnityEngine.Experimental.U2D.IK")]
[Solver2DMenu("Chain (FABRIK)")]
public class FabrikSolver2D : Solver2D
Properties
iterations
Get and set the solver's integration count.
Declaration
public int iterations { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
tolerance
Get and set target distance tolerance.
Declaration
public float tolerance { get; set; }
Property Value
| Type | Description |
|---|---|
| Single |
Methods
DoPrepare()
Prepares the data required for updating the solver.
Declaration
protected override void DoPrepare()
Overrides
DoUpdateIK(List<Vector3>)
Updates the IK and sets the chain's transform positions.
Declaration
protected override void DoUpdateIK(List<Vector3> targetPositions)
Parameters
| Type | Name | Description |
|---|---|---|
| List<Vector3> | targetPositions | Target position for the chain. |
Overrides
GetChain(Int32)
Gets the chain in the solver at index.
Declaration
public override IKChain2D GetChain(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | index | Index to query. Not used in this override. |
Returns
| Type | Description |
|---|---|
| IKChain2D | Returns IKChain2D for the Solver. |
Overrides
GetChainCount()
Returns the number of chains in the solver.
Declaration
protected override int GetChainCount()
Returns
| Type | Description |
|---|---|
| Int32 | Returns 1, because FABRIK Solver has only one chain. |