SkeletonPtr constructLinkageTestSkeleton() { SkeletonPtr skel = Skeleton::create(); BodyNode* bn = skel->createJointAndBodyNodePair<RevoluteJoint>().second; bn->setName("c1b1"); bn = addBodyNode<FreeJoint>(bn, "c1b2"); BodyNode* c1b3 = addBodyNode(bn, "c1b3"); bn = addBodyNode(c1b3, "c2b1"); bn = addBodyNode(bn, "c2b2"); addBodyNode(bn, "c2b3"); bn = addBodyNode(c1b3, "c3b1"); bn = addBodyNode(bn, "c3b2"); BodyNode* c3b3 = addBodyNode(bn, "c3b3"); bn = addBodyNode(c3b3, "c4b1"); bn = addBodyNode(bn, "c4b2"); addBodyNode(bn, "c4b3"); addBodyNode(c3b3, "c3b4"); bn = addBodyNode(c1b3, "c5b1"); addBodyNode(bn, "c5b2"); return skel; }
BodyNode* addBodyNode(BodyNode* bn, const std::string& name) { BodyNode* result = bn->createChildJointAndBodyNodePair<JointType>().second; result->setName(name); return result; }