Documentation
    Preparing search index...

    Function solveCCD

    • Writes chain's world positions into out and solves cyclic coordinate descent so the tip reaches target.

      Each iteration walks the joints from the tip backward to the root and rotates the suffix so that joint's outgoing points closer to the target, then applies that joint's limit if one was given. Bone lengths are taken from the input chain and never stretch.

      Allocation-free when out is provided and already holds one Vector3 per chain entry (scratch is module-level, write-before-read). The solver does not retain nodes.

      Parameters

      • chain: IKChain

        World positions or nodes; length >= 2. Not modified.

      • target: Vector3

        World position the tip should reach. Not modified.

      • Optionaloptions: IKSolveOptions

        Tolerance, iteration budget, optional per-joint limits.

      • Optionalout: Vector3[]

        Positions to write; allocated when omitted.

      Returns IKSolveResult

      RangeError when the chain is shorter than two, out is too short, a length/option is not finite, or a limit has min > max.