Go to the documentation of this file.00001 #pragma once
00002 #include "GGraphicsObject.h"
00003 #include "GVec4f.h"
00004 #include "GMatrix16.h"
00005
00006 class GParticleEmitter;
00007
00008 class GParticle : public GGraphicsObject
00009 {
00010 protected:
00011 bool isActive;
00012
00013 float startTime;
00014 float lifeTime;
00015 float fadeOutTime;
00016
00017 GVec4f startPosition;
00018 GVec4f direction;
00019
00020 GMatrix16 worldmatrix;
00021
00022 GParticleEmitter *owner;
00023 public:
00024 GParticle(GParticleEmitter *parent);
00025 ~GParticle(void);
00026
00027 bool IsActive();
00028
00029 int Enable(float starttime);
00030 int Disable();
00031
00032 int Initialize(float life, float fadeout, const GVec4f &direction, const GVec4f &start);
00033
00034 float GetStartTime();
00035 float GetLifeTime();
00036 float GetFadeoutTime();
00037 GParticleEmitter *GetEmitter();
00038 GVec4f *GetDirection();
00039
00040 int Update(double time, double dtime);
00041
00042 virtual int Draw(double time, double dtime, GMatrix16 *viewmatrix, GMatrix16 *worldmatrix, int FLAGS);
00043 virtual int DrawSprites(double time, double dtime, GMatrix16 *viewmatrix, GMatrix16 *worldmatrix, int FLAGS);
00044
00045
00046 static bool BackToFront(const GParticle *a, const GParticle *b);
00047 static bool FrontToBack(const GParticle *a, const GParticle *b);
00048 };