Blender V2.61 - r43446

BL_ActionManager.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * Contributor(s): Mitchell Stokes.
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00027 #ifndef __BL_ACTIONMANAGER
00028 #define __BL_ACTIONMANAGER
00029 
00030 #include "BL_Action.h"
00031 
00032 #define MAX_ACTION_LAYERS 8
00033 
00037 class BL_ActionManager
00038 {
00039 private:
00040     BL_Action* m_layers[MAX_ACTION_LAYERS];
00041 
00042 public:
00043     BL_ActionManager(class KX_GameObject* obj);
00044     ~BL_ActionManager();
00045 
00046     bool PlayAction(const char* name,
00047                     float start,
00048                     float end,
00049                     short layer=0,
00050                     short priority=0,
00051                     float blendin=0.f,
00052                     short play_mode=0,
00053                     float layer_weight=0.f,
00054                     short ipo_flags=0,
00055                     float playback_speed=1.f);
00059     float GetActionFrame(short layer);
00060 
00064     void SetActionFrame(short layer, float frame);
00065     
00069     struct bAction *GetCurrentAction(short layer);
00070 
00074     void SetPlayMode(short layer, short mode);
00075 
00079     void SetTimes(short layer, float start, float end);
00080 
00084     void StopAction(short layer);
00085 
00089     bool IsActionDone(short layer);
00090 
00094     void Update(float);
00095 
00096 #ifdef WITH_CXX_GUARDEDALLOC
00097 public:
00098     void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ActionManager"); }
00099     void operator delete( void *mem ) { MEM_freeN(mem); }
00100 #endif
00101 };
00102 
00103 #endif //BL_ACTIONMANAGER
00104