コード例 #1
0
ファイル: AnimationPose.cpp プロジェクト: zxy2845986/Demi3D
void DiAnimationPose::RemoveBasePoseBlender( const DiString& strBaseAni )
{
    if(strBaseAni.empty())
    {
        return ;
    }

    AniBlenderMap::iterator itBaseBlender = mMapBaseBlenders.find(strBaseAni);
    if(itBaseBlender == mMapBaseBlenders.end())
    {
        DI_WARNING("Cannot find and delete the animation %s", strBaseAni.c_str());
        return ;
    }

    DiClipController * pkClip = mClipSet->GetClipController(strBaseAni);
    pkClip->SetTimeRatio(1.0f);
    pkClip->SetEnabled(false);
    mMapBaseBlenders.erase(itBaseBlender);
    pkClip->SetWeight(1.0f);

}
コード例 #2
0
ファイル: AnimationPose.cpp プロジェクト: zxy2845986/Demi3D
bool DiAnimationPose::AddAdditPoseBlender( DiAnimation * animation )
{
    if(!animation)
    {
        return false;
    }

    AniBlenderMap::iterator itBaseBlender = mMapAdditBlenders.find(animation->GetName());
    if(itBaseBlender != mMapAdditBlenders.end())
    {
        DI_WARNING("The animation %s has already existed", animation->GetName().c_str());
        return false;
    }

    DiClipController * pkClip = mClipSet->GetClipController(animation->GetName());
    pkClip->SetEnabled(true);
    pkClip->SetTimePosition(0.0f);

    mMapAdditBlenders[animation->GetName()] = animation;

    return true;
}