本文整理汇总了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));
}
}
}
示例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);
//.........这里部分代码省略.........