本文整理汇总了C++中ISkeletonAnim::GetAnimationNormalizedTime方法的典型用法代码示例。如果您正苦于以下问题:C++ ISkeletonAnim::GetAnimationNormalizedTime方法的具体用法?C++ ISkeletonAnim::GetAnimationNormalizedTime怎么用?C++ ISkeletonAnim::GetAnimationNormalizedTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISkeletonAnim
的用法示例。
在下文中一共展示了ISkeletonAnim::GetAnimationNormalizedTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Pause
void CActionScope::Pause()
{
if (!m_scopeContext.charInst)
{
return;
}
ISkeletonAnim *pSkeletonAnim = m_scopeContext.charInst->GetISkeletonAnim();
if (!pSkeletonAnim)
{
return;
}
for (int i = 0; i < m_numLayers; ++i)
{
SSequencer &sequencer = m_layerSequencers[i];
const int animationLayer = m_layer + i;
const int animationsInLayer = pSkeletonAnim->GetNumAnimsInFIFO(animationLayer);
if (animationsInLayer == 0)
{
sequencer.savedAnimNormalisedTime = -1;
}
else
{
const int lastAnimationIndex = animationsInLayer - 1;
const CAnimation &animation = pSkeletonAnim->GetAnimFromFIFO(animationLayer, lastAnimationIndex);
sequencer.savedAnimNormalisedTime = pSkeletonAnim->GetAnimationNormalizedTime(&animation);
}
}
}
示例2: Update
//------------------------------------------------------------------------
void CVehicleSeatActionPassengerIK::Update(float frameTime)
{
if (!m_passengerId)
return;
IActor* pActor = CCryAction::GetCryAction()->GetIActorSystem()->GetActor(m_passengerId);
if (!pActor)
{
CRY_ASSERT(!"Invalid entity id for the actor id, Actor System didn't know it");
return;
}
if (ICharacterInstance* pCharInstance = pActor->GetEntity()->GetCharacter(0))
{
ISkeletonAnim* pSkeletonAnim = pCharInstance->GetISkeletonAnim();
CRY_ASSERT(pSkeletonAnim);
if (pSkeletonAnim->GetNumAnimsInFIFO(0) >= 1)
{
const CAnimation& anim = pSkeletonAnim->GetAnimFromFIFO(0, 0);
const uint16 loopCount = anim.GetLoop();
const f32 animationTime = pSkeletonAnim->GetAnimationNormalizedTime( &anim );
if (!m_waitShortlyBeforeStarting || (loopCount > 0 || animationTime > 0.9f))
{
for (TIKLimbVector::iterator ite = m_ikLimbs.begin(); ite != m_ikLimbs.end(); ++ite)
{
const SIKLimb& limb = *ite;
Vec3 helperPos = limb.pHelper->GetWorldSpaceTranslation();
pActor->SetIKPos(limb.limbName.c_str(), helperPos, 1);
}
}
}
}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:37,代码来源:VehicleSeatActionPassengerIK.cpp