示例#1
0
void RenderingManager::rebuildPtr(const MWWorld::Ptr &ptr)
{
    NpcAnimation *anim = NULL;
    if(ptr.getRefData().getHandle() == "player")
        anim = mPlayerAnimation;
    else if(ptr.getClass().isActor())
        anim = dynamic_cast<NpcAnimation*>(mActors->getAnimation(ptr));
    if(anim)
    {
        anim->rebuild();
        if(mCamera->getHandle() == ptr.getRefData().getHandle())
        {
            attachCameraTo(ptr);
            mCamera->setAnimation(anim);
        }
    }
}
示例#2
0
 void RenderingManager::rebuildPtr(const MWWorld::Ptr &ptr)
 {
     NpcAnimation *anim = NULL;
     if(ptr == mPlayerAnimation->getPtr())
         anim = mPlayerAnimation.get();
     else
         anim = dynamic_cast<NpcAnimation*>(mObjects->getAnimation(ptr));
     if(anim)
     {
         anim->rebuild();
         if(mCamera->getTrackingPtr() == ptr)
         {
             mCamera->attachTo(ptr);
             mCamera->setAnimation(anim);
         }
     }
 }