本文整理汇总了C++中Bone::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::contains方法的具体用法?C++ Bone::contains怎么用?C++ Bone::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bone
的用法示例。
在下文中一共展示了Bone::contains方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addChild
void Bone::addChild(DBObject* child){
if(!child)
{
return;
}
if(checkIfClass<Bone>(child)) {
Bone* bone = (Bone*) child;
if(child == this || (bone && bone->contains(this)))
{
printf("An Bone cannot be added as a child to itself or one of its children (or children's children, etc.) \n");
return;
}
}
if(child->parent)
{
child->parent->removeChild(child);
}
_children.push_back(child);
child->parent = this;
child->setArmature(this->_armature);
if(!_slot && checkIfClass<Slot>(child))
{
_slot = (Slot*) child;
}
}
示例2: addMixingTransform
void AnimationState::addMixingTransform(const String &timelineName, int type , bool recursive)
{
if(_clip && _clip->getTimeline(timelineName))
{
if(recursive)
{
int i = _armature->_boneList.size();
Bone* bone;
Bone* currentBone;
while(i --)
{
bone = _armature->_boneList[i];
if(bone->name == timelineName)
{
currentBone = bone;
}
if(currentBone && (currentBone == bone || currentBone->contains(bone)))
{
_mixingTransforms[bone->name] = type;
}
}
}
else
{
_mixingTransforms[timelineName] = type;
}
updateTimelineStates();
}
else
{
// TODO(hejiangzhou): Shall we disable exception?
throw std::invalid_argument("argument error");
}
}
示例3: removeMixingTransform
AnimationState* AnimationState::removeMixingTransform(const std::string &timelineName, bool recursive)
{
if (recursive)
{
Bone *currentBone = nullptr;
// From root to leaf
for (size_t i = _armature->getBones().size(); i--;)
{
Bone *bone = _armature->getBones()[i];
if (bone->name == timelineName)
{
currentBone = bone;
}
if (currentBone && (currentBone == bone || currentBone->contains(bone)))
{
auto iterator = std::find(_mixingTransforms.begin(), _mixingTransforms.end(), bone->name);
if (iterator != _mixingTransforms.end())
{
_mixingTransforms.erase(iterator);
}
}
}
}
else
{
auto iterator = std::find(_mixingTransforms.begin(), _mixingTransforms.end(), timelineName);
if (iterator != _mixingTransforms.end())
{
_mixingTransforms.erase(iterator);
}
}
updateTimelineStates();
return this;
}
示例4: removeMixingTransform
void AnimationState::removeMixingTransform(const String &timelineName , bool recursive)
{
if(!timelineName.empty())
{
if(recursive)
{
int i = _armature->_boneList.size();
Bone* bone;
Bone* currentBone;
while(i --)
{
bone = _armature->_boneList[i];
if(bone->name == timelineName)
{
currentBone = bone;
}
if(currentBone && (currentBone == bone || currentBone->contains(bone)))
{
std::map<String , int>::iterator iter = _mixingTransforms.find(bone->name);
if(iter != _mixingTransforms.end())
{
_mixingTransforms.erase(iter);
}
}
}
}
else
{
std::map<String , int>::iterator iter = _mixingTransforms.find(timelineName);
if(iter != _mixingTransforms.end())
{
_mixingTransforms.erase(iter);
}
}
}
updateTimelineStates();
}
示例5: addMixingTransform
AnimationState* AnimationState::addMixingTransform(const std::string &timelineName, bool recursive)
{
if (recursive)
{
Bone *currentBone = nullptr;
// From root to leaf
for (size_t i = _armature->getBones().size(); i--;)
{
Bone *bone = _armature->getBones()[i];
const std::string &boneName = bone->name;
if (boneName == timelineName)
{
currentBone = bone;
}
if (
currentBone &&
(currentBone == bone || currentBone->contains(bone)) &&
_clip->getTimeline(boneName) &&
std::find(_mixingTransforms.cbegin(), _mixingTransforms.cend(), boneName) == _mixingTransforms.cend()
)
{
_mixingTransforms.push_back(boneName);
}
}
}
else if (
_clip->getTimeline(timelineName) &&
std::find(_mixingTransforms.cbegin(), _mixingTransforms.cend(), timelineName) == _mixingTransforms.cend()
)
{
_mixingTransforms.push_back(timelineName);
}
updateTimelineStates();
return this;
}