本文整理汇总了C++中ISkeletonAnim::SetLayerUpdateMultiplier方法的典型用法代码示例。如果您正苦于以下问题:C++ ISkeletonAnim::SetLayerUpdateMultiplier方法的具体用法?C++ ISkeletonAnim::SetLayerUpdateMultiplier怎么用?C++ ISkeletonAnim::SetLayerUpdateMultiplier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISkeletonAnim
的用法示例。
在下文中一共展示了ISkeletonAnim::SetLayerUpdateMultiplier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayAnimationEx
//------------------------------------------------------------------------
void CItem::PlayAnimationEx(const char* animationName, int slot, int layer, bool loop, float blend, float speed, uint32 flags)
{
bool start=true;
ICharacterInstance *pCharacter = GetEntity()->GetCharacter(slot);
if (!pCharacter && slot==eIGS_FirstPerson && ((m_stats.viewmode&eIVM_FirstPerson)==0))
{
start=false;
int idx = 0;
if (m_stats.hand == eIH_Right)
idx = 1;
else if (m_stats.hand == eIH_Left)
idx = 2;
if (m_fpgeometry[idx].name.empty())
idx = 0;
pCharacter = m_pItemSystem->GetCachedCharacter(m_fpgeometry[idx].name.c_str());
}
if (pCharacter && animationName)
{
ISkeletonAnim* pSkeletonAnim = pCharacter->GetISkeletonAnim();
if (flags&eIPAF_CleanBlending)
{
while(pSkeletonAnim->GetNumAnimsInFIFO(layer)>1)
{
if (!pSkeletonAnim->RemoveAnimFromFIFO(layer, pSkeletonAnim->GetNumAnimsInFIFO(layer)-1))
break;
}
}
if (flags&eIPAF_NoBlend)
blend = 0.0f;
if (start)
{
CryCharAnimationParams params;
params.m_fTransTime = blend;
params.m_nLayerID = layer;
params.m_nFlags = (loop?CA_LOOP_ANIMATION:0)|(flags&eIPAF_RestartAnimation?CA_ALLOW_ANIM_RESTART:0)|(flags&eIPAF_RepeatLastFrame?CA_REPEAT_LAST_KEY:0);
pSkeletonAnim->StartAnimation(animationName, params);
pSkeletonAnim->SetLayerUpdateMultiplier(layer, speed);
//pCharacter->GetISkeleton()->SetDebugging( true );
}
float duration=0.0f;
int animationId = pCharacter->GetIAnimationSet()->GetAnimIDByName(animationName);
if (animationId>=0)
duration = pCharacter->GetIAnimationSet()->GetDuration_sec(animationId);
m_animationTime[slot] = (uint32)(duration*1000.0f/speed);
m_animationEnd[slot] = (uint32)(gEnv->pTimer->GetCurrTime()*1000.0f)+m_animationTime[slot];
m_animationSpeed[slot] = speed;
}
}