public ArrayList<SegmentedArmature> returnSegmentPinnedNodes() { ArrayList<SegmentedArmature> innerPinnedChains = new ArrayList<SegmentedArmature>(); if (this.tipPinned) { innerPinnedChains.add(this); } else { for (SegmentedArmature childSegment : childSegments) { innerPinnedChains.addAll(childSegment.returnSegmentPinnedNodes()); } } return innerPinnedChains; }
/** * @param chainMember * @return returns the segment chain (pinned or unpinned, doesn't matter) to which the inputBone * belongs. */ public SegmentedArmature getChainFor(AbstractBone chainMember) { AbstractBone candidate = this.segmentTip; while (true) { if (candidate == chainMember) return this; if (candidate == segmentRoot || candidate.parent == null) { break; } candidate = candidate.parent; } SegmentedArmature result = null; for (SegmentedArmature children : childSegments) { result = children.getChainFor(chainMember); if (result != null) break; } return result; }