docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Solver2D

    Abstract class for implementing a 2D IK Solver.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    Solver2D
    CCDSolver2D
    FabrikSolver2D
    LimbSolver2D
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.destroyCancellationToken
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.U2D.IK
    Assembly: Unity.2D.IK.Runtime.dll
    Syntax
    [MovedFrom("UnityEngine.Experimental.U2D.IK")]
    public abstract class Solver2D : MonoBehaviour

    Properties

    allChainsHaveTargets

    Returns true if all chains in the Solver have a target.

    Declaration
    public bool allChainsHaveTargets { get; }
    Property Value
    Type Description
    bool

    chainCount

    Returns the number of IKChain2D in the solver.

    Declaration
    public int chainCount { get; }
    Property Value
    Type Description
    int

    constrainRotation

    Gets and sets the rotation constrain property.

    Declaration
    public bool constrainRotation { get; set; }
    Property Value
    Type Description
    bool

    isValid

    Returns true if the Solver2D is in a valid state.

    Declaration
    public bool isValid { get; }
    Property Value
    Type Description
    bool

    solveFromDefaultPose

    Get and set restoring default pose before the update.

    Declaration
    public bool solveFromDefaultPose { get; set; }
    Property Value
    Type Description
    bool

    weight

    Get and Set Solver weights.

    Declaration
    public float weight { get; set; }
    Property Value
    Type Description
    float

    Methods

    DoInitialize()

    Override to initialize the solver.

    Declaration
    protected virtual void DoInitialize()

    DoPrepare()

    Override to prepare the solver for update.

    Declaration
    protected virtual void DoPrepare()

    DoUpdateIK(List<Vector3>)

    Override to perform Solver IK update.

    Declaration
    protected abstract void DoUpdateIK(List<Vector3> targetPositions)
    Parameters
    Type Name Description
    List<Vector3> targetPositions

    Target position for the chain.

    DoValidate()

    Override to perform custom validation.

    Declaration
    protected virtual bool DoValidate()
    Returns
    Type Description
    bool

    Returns true if the Solver is in a valid state. False otherwise.

    GetChain(int)

    Override to return the IKChain2D at the given index.

    Declaration
    public abstract IKChain2D GetChain(int index)
    Parameters
    Type Name Description
    int index

    Index of the IKChain2D.

    Returns
    Type Description
    IKChain2D

    A chain at a given index.

    GetChainCount()

    Override to return the number of chains in the Solver.

    Declaration
    protected abstract int GetChainCount()
    Returns
    Type Description
    int

    Number of chains in the solver.

    GetPlaneRootTransform()

    Override to return the root transform of the Solver. The default implementation returns the root transform of the first chain.

    Declaration
    protected virtual Transform GetPlaneRootTransform()
    Returns
    Type Description
    Transform

    Transform representing the root.

    GetPointOnSolverPlane(Vector3)

    Convert a world position coordinate to the solver's plane space.

    Declaration
    protected Vector3 GetPointOnSolverPlane(Vector3 worldPosition)
    Parameters
    Type Name Description
    Vector3 worldPosition

    Vector3 representing world position

    Returns
    Type Description
    Vector3

    Converted position in solver's plane

    GetWorldPositionFromSolverPlanePoint(Vector2)

    Convert a position from solver's plane to world coordinates.

    Declaration
    protected Vector3 GetWorldPositionFromSolverPlanePoint(Vector2 planePoint)
    Parameters
    Type Name Description
    Vector2 planePoint

    Vector3 representing a position in the Solver's plane.

    Returns
    Type Description
    Vector3

    Converted position to world coordinates.

    Initialize()

    Initializes the solver.

    Declaration
    public void Initialize()

    OnPreviewUpdate()

    Empty method. Implemented for the IPreviewable interface.

    Declaration
    public void OnPreviewUpdate()

    OnValidate()

    Validate and initialize the Solver.

    Declaration
    protected virtual void OnValidate()

    UpdateIK(List<Vector3>, float)

    Perform the Solver IK update with specified target positions.

    Declaration
    public void UpdateIK(List<Vector3> targetPositions, float globalWeight)
    Parameters
    Type Name Description
    List<Vector3> targetPositions

    Target positions.

    float globalWeight

    Weight for position solving.

    UpdateIK(float)

    Perform the Solver IK update.

    Declaration
    public void UpdateIK(float globalWeight)
    Parameters
    Type Name Description
    float globalWeight

    Weight for position solving.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)