当前位置: 首页>>代码示例>>C++>>正文


C++ Bone::contains方法代码示例

本文整理汇总了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;
		}
	}
开发者ID:KingNormac,项目名称:CPlusPlus-Opengl-Dragonbones,代码行数:29,代码来源:Bone.cpp

示例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");
     }
 }
开发者ID:GuJaChun,项目名称:SkeletonAnimationLibraryCPP-out-of-date-,代码行数:35,代码来源:AnimationState.cpp

示例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;
}
开发者ID:602147629,项目名称:Tui-x,代码行数:40,代码来源:AnimationState.cpp

示例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();
        }
开发者ID:GuJaChun,项目名称:SkeletonAnimationLibraryCPP-out-of-date-,代码行数:39,代码来源:AnimationState.cpp

示例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;
}
开发者ID:602147629,项目名称:Tui-x,代码行数:39,代码来源:AnimationState.cpp


注:本文中的Bone::contains方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。