qafAnimParticleObj.h

00001 /* 
00002 ** Qaf Framework 1.2
00003 ** June 2006
00004 ** 
00005 ** Pedro Luchini de Moraes, Public Domain - Free Lunch Code
00006 */
00007 
00008 #ifndef QAF_OBJ_ANIMPARTICLEOBJ_H
00009 #define QAF_OBJ_ANIMPARTICLEOBJ_H
00010 
00011 #include "../qafGameObj.h"
00012 #include <hgeanim.h>
00013 
00014 namespace qaf {
00015     
00035     class AnimParticleObj : public GameObj {
00036         public:
00037             
00053             AnimParticleObj (
00054                 const hgeAnimation * anim,
00055                 float x, float y,
00056                 float angle,
00057                 float vx, float vy,
00058                 float vr,
00059                 float ax, float ay,
00060                 float sizeX = 1.0f, float sizeY = 1.0f,
00061                 DWORD color = 0xFFFFFFFF,
00062                 DWORD blendMode = BLEND_DEFAULT );
00063             
00064             
00065             
00069             inline hgeAnimation * getAnimation () {
00070                 return &anim;
00071             }
00072             
00076             inline bool isDead () {
00077                 return !anim.IsPlaying();
00078             }
00079             
00084             void getPos ( float * _x, float * _y, float * _angle ) {
00085                 if ( _x )
00086                     *_x = x;
00087                 if ( _y )
00088                     *_y = y;
00089                 if ( _angle )
00090                     *_angle = angle;
00091             }
00092             
00097             inline void getVel ( float * _vx, float * _vy, float * _vr ) {
00098                 if ( _vx )
00099                     *_vx = vx;
00100                 if ( _vy )
00101                     *_vy = vy;
00102                 if ( _vr )
00103                     *_vr = vr;
00104             }
00105             
00109             inline void getSize ( float * xScale, float * yScale ) {
00110                 if ( xScale )
00111                     *xScale = sizeX;
00112                 if ( yScale )
00113                     *yScale = sizeY;
00114             }
00115             
00116             
00117             
00118             void update ( int objLayer, float dt );
00119             void render ( int objLayer, float scrollX, float scrollY );
00120             
00121         protected:
00122             hgeAnimation anim;
00123             float x, y, angle, vx, vy, vr, ax, ay, sizeX, sizeY;
00124     };
00125     
00126 }
00127 
00128 
00129 
00130 #endif
00131 

Generated on Sun Mar 25 12:32:12 2007 for Qaf Framework by  doxygen 1.5.1-p1