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


C++ Armature::advanceTime方法代码示例

本文整理汇总了C++中Armature::advanceTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Armature::advanceTime方法的具体用法?C++ Armature::advanceTime怎么用?C++ Armature::advanceTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Armature的用法示例。


在下文中一共展示了Armature::advanceTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: advanceTime

	void Armature::advanceTime(float passedTime){
		_animation->advanceTime(passedTime);
		

		for(Bone* bone : _boneList)
		{
			bone->update();
		}

			
		
		for(Slot* slot : _slotList)
		{
			slot->update();
			if(slot->_isDisplayOnStage)
			{
				Armature* childArmature = slot->getChildArmature();
				if(childArmature)
				{
					childArmature->advanceTime(passedTime);
				}
			}
		}

			
		if(_slotsZOrderChanged)
		{
			updateSlotsZOrder();
				
			if(this->hasEventListener(ArmatureEvent::Z_ORDER_UPDATED))
			{
				this->dispatchEvent(new ArmatureEvent(ArmatureEvent::Z_ORDER_UPDATED));
			}
		}

	}
开发者ID:KingNormac,项目名称:CPlusPlus-Opengl-Dragonbones,代码行数:36,代码来源:Armature.cpp

示例2: buildArmature

Armature* BaseFactory::buildArmature(const std::string &armatureName, const std::string &skinName, const std::string &animationName, const std::string &dragonBonesName, const std::string &textureAtlasName) const
{
    DragonBonesData *dragonBonesData = nullptr;
    ArmatureData *armatureData = nullptr;
    ArmatureData *animationArmatureData = nullptr;
    SkinData *skinData = nullptr;
    SkinData *skinDataCopy = nullptr;
    
    if (!dragonBonesName.empty())
    {
        auto iterator = _dragonBonesDataMap.find(dragonBonesName);
        
        if (iterator != _dragonBonesDataMap.end())
        {
            dragonBonesData = iterator->second;
            armatureData = dragonBonesData->getArmatureData(armatureName);
            _currentDragonBonesDataName = dragonBonesName;
            _currentTextureAtlasName = textureAtlasName.empty() ? _currentDragonBonesDataName : textureAtlasName;
        }
    }
    
    if (!armatureData)
    {
        AutoSearchType searchType = (dragonBonesName.empty() ? AutoSearchType::AST_ALL : (autoSearchDragonBonesData ? AutoSearchType::AST_AUTO : AutoSearchType::AST_NONE));
        
        if (searchType != AutoSearchType::AST_NONE)
        {
            for (auto iterator = _dragonBonesDataMap.begin(); iterator != _dragonBonesDataMap.end(); ++iterator)
            {
                dragonBonesData = iterator->second;
                
                if (searchType == AutoSearchType::AST_ALL || dragonBonesData->autoSearch)
                {
                    armatureData = dragonBonesData->getArmatureData(armatureName);
                    
                    if (armatureData)
                    {
                        _currentDragonBonesDataName = iterator->first;
                        _currentTextureAtlasName = _currentDragonBonesDataName;
                        break;
                    }
                }
            }
        }
    }
    
    if (!armatureData)
    {
        return nullptr;
    }
    
    if (!animationName.empty() && animationName != armatureName)
    {
        animationArmatureData = dragonBonesData->getArmatureData(animationName);
        
        if (!animationArmatureData)
        {
            for (auto iterator = _dragonBonesDataMap.begin(); iterator != _dragonBonesDataMap.end(); ++iterator)
            {
                dragonBonesData = iterator->second;
                animationArmatureData = dragonBonesData->getArmatureData(animationName);
                
                if (animationArmatureData)
                {
                    break;
                }
            }
        }
        
        if (animationArmatureData)
        {
            skinDataCopy = animationArmatureData->getSkinData("");
        }
    }
    
    skinData = armatureData->getSkinData(skinName);
    Armature *armature = generateArmature(armatureData);
    armature->name = armatureName;
    
    if (animationArmatureData)
    {
        armature->getAnimation()->setAnimationDataList(animationArmatureData->animationDataList);
    }
    else
    {
        armature->getAnimation()->setAnimationDataList(armatureData->animationDataList);
    }
    
    //
    buildBones(armature, armatureData);
    
    //
    if (skinData)
    {
        buildSlots(armature, armatureData, skinData, skinDataCopy);
    }
    
    // update armature pose
    armature->getAnimation()->play();
    armature->advanceTime(0);
//.........这里部分代码省略.........
开发者ID:602147629,项目名称:Tui-x,代码行数:101,代码来源:BaseFactory.cpp


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