1 #ifndef _NALCG_CHECK_ANIMATION_H_
2 #define _NALCG_CHECK_ANIMATION_H_
4 #include "genericanimation.h"
6 class CheckAnimation
: public GenericAnimation
9 CheckAnimation(SceneNode
*checkedNode
, SceneManager
*sceneMgr
)
10 : GenericAnimation(checkedNode
, sceneMgr
), mTextNode(0),
15 virtual ~CheckAnimation()
17 SceneNode::ObjectIterator itr
= mTextNode
->getAttachedObjectIterator();
18 while (itr
.hasMoreElements())
20 MovableObject
* object
= itr
.getNext();
21 mSceneMgr
->destroyMovableObject(object
);
24 mAnimatedNode
->removeAndDestroyChild(mTextNode
->getName());
28 virtual bool animate(const Real
& timeSinceLastFrame
)
32 Entity
* ent
= mSceneMgr
->createEntity(nextName(), "check.mesh");
33 ent
->setQueryFlags(0);
34 mTextNode
= mAnimatedNode
->createChildSceneNode(Vector3(0, 1000, 0));
35 mTextNode
->attachObject(ent
);
39 mTextNode
->translate(0, timeSinceLastFrame
* 2000, 0);
41 else if (mTextNode
->getPosition().y
>= 0)
43 mTextNode
->translate(0, -timeSinceLastFrame
* 2000, 0);
47 mTextNode
->yaw(Radian(timeSinceLastFrame
* Math::PI
));
49 //mTextNode->translate(0, timeSinceLastFrame * 500, 0);
50 mDuration
-= timeSinceLastFrame
;
52 return mDuration
>= 0;
61 #endif // _NALCG_CHECK_ANIMATION_H_