(jointIndex)
| 120 | const processingOrder = []; |
| 121 | |
| 122 | function addJoint(jointIndex) { |
| 123 | if (processed.has(jointIndex)) return; |
| 124 | const joint = joints[jointIndex]; |
| 125 | if (joint.parentIndex >= 0 && !processed.has(joint.parentIndex)) { |
| 126 | addJoint(joint.parentIndex); |
| 127 | } |
| 128 | processingOrder.push(jointIndex); |
| 129 | processed.add(jointIndex); |
| 130 | } |
| 131 | |
| 132 | for (let i = 0; i < joints.length; i++) addJoint(i); |
| 133 |