Class CCDSolver2D
Component responsible for 2D Cyclic Coordinate Descent (CCD) IK.
Inherited Members
Object.GetEntityId()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: UnityEngine.U2D.IK
Assembly: Unity.2D.IK.Runtime.dll
Syntax
[MovedFrom("UnityEngine.Experimental.U2D.IK")]
[Solver2DMenu("Chain (CCD)")]
[Icon("Packages/com.unity.2d.animation/Editor/Assets/ComponentIcons/Animation.IKCCD.png")]
[BurstCompile]
public sealed class CCDSolver2D : Solver2D
Properties
iterations
Get and set the solver's integration count.
Declaration
public int iterations { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
tolerance
Get and set target distance tolerance.
Declaration
public float tolerance { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
velocity
Get and Set the solver velocity.
Declaration
public float velocity { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
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 positions for the chain. |
Overrides
DoValidate()
Override to perform custom validation.
Declaration
protected override bool DoValidate()
Returns
| Type | Description |
|---|---|
| bool | Returns true if the Solver is in a valid state. False otherwise. |
Overrides
GetChain(int)
Gets the chain in the solver at index.
Declaration
public override IKChain2D GetChain(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| int | 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 |
|---|---|
| int | Returns 1, because CCD Solver has only one chain. |