?? animmanager.h
字號:
/**
* AnimManager , manages the animation in Irrlicht
*
* Author : Kevin Lynx
* History :
* 2007.7.31 : First version
*/
#ifndef _ANIM_MANAGER_H_
#define _ANIM_MANAGER_H_
#include <map>
using std::map;
/**
* AnimManager class,
*
* Implements an easy animation controller
*/
class AnimManager
{
public:
/**
* animation properties
*
*/
struct AnimState
{
AnimState( int begin = 0, int end = 0,
float fps = 0.0f, bool loop = true )
{
mBeginFrame = begin;
mEndFrame = end;
mFPS = fps;
mLoop = loop;
}
int mBeginFrame;
int mEndFrame;
float mFPS;
bool mLoop;
};
/**
* animstion state container
*
*/
typedef map<int, AnimState*> tAnimStates;
public:
/**
* Constructor
*
* @param node the animation mesh node
*/
AnimManager( IAnimatedMeshSceneNode *node );
/**
* Destructor
*
*/
~AnimManager();
/**
* add animation state
*
* @param state the state id
* @param begin the begin frame of this state
* @param end the end frame of this state
* @param fps the frames per seconde
* @param bLoop whether a loop animation
*
*/
bool addState( int state, int begin, int end, float fps, bool bLoop = true );
/**
* release
*
*/
void release();
/**
* setState ,
*
* it will set the current animation , and apply this state properties
*
* @param state state id
* @return if sets successfully return true
*/
bool setCurrentState( int state );
/**
* getState
*
* get current animation state
*/
int getCurrentState();
private:
tAnimStates mAnimStates;
IAnimatedMeshSceneNode *mNode;
int mFrameCount;
int mCurrentState;
};
#endif // end _ANIM_MANAGER_H_
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -