Array of Three.js objects representing bones in parent-child order
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]
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.