本文整理汇总了C++中Bone::connections方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::connections方法的具体用法?C++ Bone::connections怎么用?C++ Bone::connections使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bone
的用法示例。
在下文中一共展示了Bone::connections方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visitedBones
std::set<std::pair<Socket*, Joint*>> Skeleton::socketJoints() const {
if (_bones.size() == 0) return std::set<std::pair<Socket*, Joint*>>();
Bone* root = *_bones.begin();
std::set<std::pair<Socket*, Joint*>> socketJoints;
std::set<Bone*> visitedBones({ root });
std::vector<Bone*> boneStack({ root });
do {
Bone* bone = boneStack.back();
boneStack.pop_back();
for (auto connection : bone->connections()) {
Bone* opposingBone = connection->opposingBone();
if (opposingBone == NULL) continue;
socketJoints.insert(connection->socketJoint());
if (visitedBones.find(opposingBone) == visitedBones.end()) {
visitedBones.insert(opposingBone);
boneStack.push_back(opposingBone);
}
}
} while (boneStack.size() > 0);
return socketJoints;
}
示例2: boneStack
std::vector<SkeletonComponent*> Skeleton::getAllComponents() const {
if (_bones.size() == 0) return std::vector<SkeletonComponent*>();
Bone* root = *_bones.begin();
std::vector<SkeletonComponent*> components;
std::set<Bone*> visitedBones;
std::vector<Bone*> boneStack({ root });
do {
Bone* bone = boneStack.back();
boneStack.pop_back();
visitedBones.insert(bone);
components.push_back(bone);
for (auto connection : bone->connections()) {
components.push_back(connection);
Bone* opposingBone = connection->opposingBone();
if (opposingBone == NULL) continue;
if (visitedBones.find(opposingBone) == visitedBones.end()) {
boneStack.push_back(opposingBone);
}
}
} while (boneStack.size() > 0);
return components;
}