irrlicht/source/Irrlicht/CSceneNodeAnimatorDelete.cpp
bitplane 30b56d2ec5 Moved everything to /trunk
git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@643 dfc29bdd-3216-0410-991c-e03cc46cb475
2007-05-20 18:03:49 +00:00

47 lines
1011 B
C++

// Copyright (C) 2002-2007 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "CSceneNodeAnimatorDelete.h"
#include "ISceneManager.h"
namespace irr
{
namespace scene
{
//! constructor
CSceneNodeAnimatorDelete::CSceneNodeAnimatorDelete(ISceneManager* manager, u32 time)
: DeleteTime(time), SceneManager(manager)
{
#ifdef _DEBUG
setDebugName("CSceneNodeAnimatorDelete");
#endif
}
//! destructor
CSceneNodeAnimatorDelete::~CSceneNodeAnimatorDelete()
{
}
//! animates a scene node
void CSceneNodeAnimatorDelete::animateNode(ISceneNode* node, u32 timeMs)
{
if (timeMs > DeleteTime && node && SceneManager)
{
// don't delete if scene manager is attached to an editor
if (!SceneManager->getParameters()->getAttributeAsBool(IRR_SCENE_MANAGER_IS_EDITOR))
SceneManager->addToDeletionQueue(node);
}
}
} // end namespace scene
} // end namespace irr