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


C++ ISkeletonAnim::SetLayerBlendWeight方法代码示例

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


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

示例1: ReplayUpdateThirdPersonAnimations

void CMountedGunController::ReplayUpdateThirdPersonAnimations( ICharacterInstance* pCharacter, float aimRad, float aimUp, float aimDown, bool firstPerson /*= false*/)
{
    if (pCharacter)
        {
            ISkeletonAnim *pSkeletonAnim = pCharacter->GetISkeletonAnim();
            assert(pSkeletonAnim);

            //Update manually animation time, to match current weapon orientation
            uint32 numAnimsLayer = pSkeletonAnim->GetNumAnimsInFIFO(REPLAY_PLAYER_ANIMATION_LAYER_BASE);
            for(uint32 i=0; i<numAnimsLayer; i++)
                {
                    CAnimation &animation = pSkeletonAnim->GetAnimFromFIFO(REPLAY_PLAYER_ANIMATION_LAYER_BASE, i);
                    if (animation.HasStaticFlag(CA_MANUAL_UPDATE))
                        {
                            float time = CalculateAnimationTime(aimRad);
                            pSkeletonAnim->SetAnimationNormalizedTime(&animation, time);
                            animation.ClearStaticFlag( CA_DISABLE_MULTILAYER );
                        }
                }

            if (firstPerson)
                return;

            //Update additive weights for aiming up/down
            pSkeletonAnim->SetLayerBlendWeight(REPLAY_PLAYER_ANIMATION_LAYER_AIM_UP, aimUp);
            pSkeletonAnim->SetLayerBlendWeight(REPLAY_PLAYER_ANIMATION_LAYER_AIM_DOWN, aimDown);
        }
}
开发者ID:eBunny,项目名称:EmberProject,代码行数:28,代码来源:MountedGunController.cpp

示例2: StartAnimationById

bool CAnimationProxyDualCharacter::StartAnimationById(IEntity *entity, int animId, const CryCharAnimationParams& Params, float speedMultiplier)
{
    ICharacterInstance* pICharacter = entity->GetCharacter(m_characterMain);
    if (pICharacter)
        {
            ISkeletonAnim* pISkeletonAnim = pICharacter->GetISkeletonAnim();
            ICharacterInstance* pIShadowCharacter = m_firstPersonMode ? entity->GetCharacter(m_characterShadow) : NULL;
            IAnimationSet* pAnimSet = pICharacter->GetIAnimationSet();

            SPlayParams playParams;
            GetPlayParams(animId, speedMultiplier, pAnimSet, playParams);

            bool shadowLocomotion = !(((Params.m_nFlags & CA_DISABLE_MULTILAYER) || (Params.m_nLayerID != 0)) || !m_killMixInFirst);
            bool bAnimStarted = false;
            bool bShouldPlayShadow = true;
            CryCharAnimationParams localParams = Params;
            if (!m_firstPersonMode || !shadowLocomotion)
                {
                    localParams.m_fPlaybackSpeed *= m_firstPersonMode ? playParams.speedFP : playParams.speedTP;
                    bAnimStarted = pISkeletonAnim->StartAnimationById(m_firstPersonMode ? playParams.animIDFP : playParams.animIDTP, localParams);
                    if (bAnimStarted)
                        {
                            pISkeletonAnim->SetLayerBlendWeight(Params.m_nLayerID, 1.0f);
                        }
                    else
                        bShouldPlayShadow = false;
                }

            if (bShouldPlayShadow && pIShadowCharacter != NULL)
                {
                    ISkeletonAnim* pIShadowSkeletonAnim = pIShadowCharacter->GetISkeletonAnim();
                    localParams.m_fPlaybackSpeed = Params.m_fPlaybackSpeed * playParams.speedTP;
                    if (pIShadowSkeletonAnim->StartAnimationById(playParams.animIDTP, localParams))
                        {
                            bAnimStarted = true;

                            pIShadowSkeletonAnim->SetLayerBlendWeight(Params.m_nLayerID, 1.0f);
                        }
                }

            if (bAnimStarted && (Params.m_nLayerID == 0))
                {
                    m_allowsMix = (Params.m_nFlags & CA_DISABLE_MULTILAYER) == 0;
                }

            return bAnimStarted;
        }

    return false;
}
开发者ID:eBunny,项目名称:EmberProject,代码行数:50,代码来源:DualCharacterProxy.cpp

示例3: InstallAnimation

bool CActionScope::InstallAnimation(int animID, const CryCharAnimationParams &animParams)
{
    ISkeletonAnim *pSkelAnim = m_scopeContext.charInst->GetISkeletonAnim();
    const bool startAnimationSuccess = pSkelAnim->StartAnimationById(animID, animParams);
    pSkelAnim->SetLayerPlaybackScale(animParams.m_nLayerID, m_speedBias);
    pSkelAnim->SetLayerBlendWeight(animParams.m_nLayerID, m_animWeight);

    return startAnimationSuccess;
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:9,代码来源:ActionScope.cpp

示例4: Update

void CActionScope::Update(float timePassed)
{
    IAction * const pPlayingAction = GetPlayingAction().get();
    if (pPlayingAction)
    {
        ISkeletonAnim *pSkelAnim = m_scopeContext.charInst ? m_scopeContext.charInst->GetISkeletonAnim() : NULL;

        const float newSpeedBias = pPlayingAction->GetSpeedBias();
        const float newAnimWeight = pPlayingAction->GetAnimWeight();

        if (m_speedBias != newSpeedBias)
        {
            m_speedBias = newSpeedBias;

            if(pSkelAnim)
            {
                for (uint32 layer=0; layer<m_numLayers; layer++)
                {
                    pSkelAnim->SetLayerPlaybackScale(m_layer+layer, newSpeedBias);
                }
            }
        }

        if(m_animWeight != newAnimWeight)
        {
            m_animWeight = newAnimWeight;

            if(pSkelAnim)
            {
                for (uint32 layer=0; layer<m_numLayers; layer++)
                {
                    pSkelAnim->SetLayerBlendWeight(m_layer+layer, newAnimWeight);
                }
            }
        }

        timePassed *= m_speedBias;

        m_fragmentTime += timePassed+m_timeIncrement;
    }

    UpdateSequencers(timePassed);
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:43,代码来源:ActionScope.cpp


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