Planeshift

pscal3dcallback.h

Go to the documentation of this file.
00001 /*
00002  * Author: Andrew Robberts
00003  *
00004  * Copyright (C) 2005 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
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
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 #ifndef PS_CAL3D_CALLBACK_HEADER
00021 #define PS_CAL3D_CALLBACK_HEADER
00022 
00023 // Cal3D includes
00024 #include <cal3d/animcallback.h>
00025 
00026 // CS includes
00027 #include <csutil/csstring.h>
00028 #include <csutil/ref.h>
00029 #include <imap/reader.h>
00030 
00031 class EEditApp;
00032 
00039 class psCal3DCallbackLoader : public scfImplementation1<psCal3DCallbackLoader, iLoaderPlugin>
00040 {
00041 private:
00042     EEditApp * parentApp;
00043     
00044 public:  
00045     psCal3DCallbackLoader(iObjectRegistry * objreg, EEditApp * app);
00046     virtual ~psCal3DCallbackLoader();
00047     
00048     // used to handle and parse the <addon> tags.
00049     csPtr<iBase> Parse(iDocumentNode * node, iStreamSource*, iLoaderContext * ldr_context, iBase * context);
00050 
00051     bool IsThreadSafe() { return true; }
00052 };
00053 
00057 class psCal3DCallbackEffect : public CalAnimationCallback
00058 {
00059 public:
00060     psCal3DCallbackEffect(iDocumentNode * node, EEditApp * app);
00061     virtual ~psCal3DCallbackEffect();
00062 
00063     void AnimationUpdate(float anim_time, CalModel * model, void * userData);
00064     void AnimationComplete(CalModel * model, void * userData);
00065 
00066 protected:
00067 
00068     EEditApp * parentApp;
00069     
00071     csString effectName;
00072 
00074     float triggerTime;
00075 
00077     float lastUpdateTime;
00078     
00080     bool hasTriggered;
00081 
00083     bool resetPerCycle;
00084 
00086     bool killWithAnimEnd;
00087 
00089     unsigned int effectID;
00090 };
00091 
00094 #endif
00095