Strata - v1.4.10
    Preparing search index...

    Function createBoneChain

    • Create a bone chain from existing Three.js objects.

      Analyzes a hierarchy of objects and calculates the distances between them to create an IK-ready bone chain. Useful when working with imported models or manually placed objects.

      Parameters

      • bones: Object3D<Object3DEventMap>[]

        Array of Three.js objects representing bones in parent-child order

      Returns BoneChain

      A bone chain with calculated lengths and total length

      // Create chain from existing scene objects
      const shoulder = scene.getObjectByName('shoulder');
      const elbow = scene.getObjectByName('elbow');
      const wrist = scene.getObjectByName('wrist');

      const armChain = createBoneChain([shoulder, elbow, wrist]);
      console.log(armChain.totalLength); // Total arm reach
      console.log(armChain.lengths); // [upperArmLength, forearmLength]