Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonz/ikskeleton.h"
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void IKSkeleton::computeSkeleton(IKNode *node) {
Shinya Kitaoka 120a6e
  for (int i = 0; i < (int)m_nodes.size(); i++) {
Shinya Kitaoka 120a6e
    m_nodes[i]->computeS();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void IKSkeleton::compute(void) {
Shinya Kitaoka 120a6e
  IKNode *root = this->getRoot();
Shinya Kitaoka 120a6e
  computeSkeleton(root);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void IKSkeleton::setPurpose(int nodeIndex, IKNode::Purpose purpose) {
Shinya Kitaoka 120a6e
  switch (purpose) {
Shinya Kitaoka 120a6e
  case IKNode::JOINT:
Shinya Kitaoka 120a6e
    m_nodes[nodeIndex]->setPurpose(purpose);
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  case IKNode::EFFECTOR:
Shinya Kitaoka 120a6e
    if (m_nodes[nodeIndex]->getPurpose() != IKNode::EFFECTOR) {
Shinya Kitaoka 120a6e
      m_nodes[nodeIndex]->setPurpose(purpose);
Shinya Kitaoka 120a6e
      m_nodes[nodeIndex]->setSeqNumEffector(numEffector);
Shinya Kitaoka 120a6e
      numEffector++;
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
    break;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//========================================================================