本文整理汇总了C++中Armature::addBone方法的典型用法代码示例。如果您正苦于以下问题:C++ Armature::addBone方法的具体用法?C++ Armature::addBone怎么用?C++ Armature::addBone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Armature
的用法示例。
在下文中一共展示了Armature::addBone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildArmature
/**
* Build and returns a new Armature instance.
* @example
* <listing>
* var armature:Armature = factory.buildArmature('dragon');
* </listing>
* @param armatureName The name of this Armature instance.
* @param The name of this animation
* @param The name of this SkeletonData.
* @param The name of this textureAtlas.
* @param The name of this skin.
* @return A Armature instance.
*/
Armature* BaseFactory::buildArmature(const String &armatureName,
const String &animationName,
const String &skeletonName,
const String &textureAtlasName,
const String &skinName)
{
ArmatureData* armatureData = 0;
SkeletonData *data = 0;
if(!skeletonName.empty())
{
std::map<String , SkeletonData*>::iterator iter = _dataDic.find(skeletonName);
if(iter != _dataDic.end())
{
data = iter->second;
armatureData = data->getArmatureData(armatureName);
}
}
//else
//{
// for(skeletonName in _dataDic)
// {
// data = _dataDic[skeletonName];
// armatureData = data->getArmatureData(armatureName);
// if(armatureData)
// {
// break;
// }
// }
//}
if(!armatureData)
{
return nullptr;
}
_currentDataName = skeletonName;
_currentTextureAtlasName = textureAtlasName.empty() ? skeletonName : textureAtlasName;
Armature* armature = generateArmature();
armature->name = armatureName;
Bone* bone;
for(size_t i = 0 ; i < armatureData->boneDataList.size() ; i ++)
{
BoneData* boneData = armatureData->boneDataList[i];
bone = new Bone();
bone->name = boneData->name;
bone->fixedRotation = boneData->fixedRotation;
bone->scaleMode = boneData->scaleMode;
bone->origin = boneData->transform;
if(armatureData->getBoneData(boneData->parent))
{
armature->addBone(bone, boneData->parent);
}
else
{
armature->addBone(bone);
}
}
ArmatureData* animationArmatureData = 0;
SkinData *skinDataCopy = 0;
if(!animationName.empty() && animationName != armatureName)
{
//ArmatureData* animationArmatureData = data->getArmatureData(animationName);
// Get the default animation
//if(!animationArmatureData)
//{
// for (skeletonName in _dataDic)
// {
// data = _dataDic[skeletonName];
// animationArmatureData = data->getArmatureData(animationName);
// if(animationArmatureData)
// {
// break;
// }
// }
//}
ArmatureData* armatureDataCopy = data->getArmatureData(animationName);
if(armatureDataCopy)
{
skinDataCopy = armatureDataCopy->getSkinData("");
}
}
if(animationArmatureData)
{
//.........这里部分代码省略.........