#include "CSceneNodeAnimatorDelete.h"
#include "ISceneManager.h"
namespace irr
{
namespace scene
{
CSceneNodeAnimatorDelete::CSceneNodeAnimatorDelete(ISceneManager* manager, u32 time)
: ISceneNodeAnimatorFinishing(time), SceneManager(manager)
{
#ifdef _DEBUG
setDebugName("CSceneNodeAnimatorDelete");
#endif
}
void CSceneNodeAnimatorDelete::animateNode(ISceneNode* node, u32 timeMs)
{
if (timeMs > FinishTime)
{
HasFinished = true;
if(node && SceneManager)
{
if (!SceneManager->getParameters()->getAttributeAsBool(IRR_SCENE_MANAGER_IS_EDITOR))
SceneManager->addToDeletionQueue(node);
}
}
}
ISceneNodeAnimator* CSceneNodeAnimatorDelete::createClone(ISceneNode* node, ISceneManager* newManager)
{
CSceneNodeAnimatorDelete * newAnimator =
new CSceneNodeAnimatorDelete(SceneManager, FinishTime);
return newAnimator;
}
}
}