Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #pragma once
00015
00016 #include "maxheap.h"
00017 #include "meshlib.h"
00018 #include "export.h"
00019 #include "GraphicsTypes.h"
00020
00021
00022 class ParticleSys;
00023
00024 struct SphereData: public MaxHeapOperators{
00025 Point3 center;
00026 float radius,oradius,rsquare,tover4;
00027 };
00028
00029
00036 class CustomParticleDisplay: public MaxHeapOperators {
00037 public:
00046 virtual BOOL DrawParticle(GraphicsWindow *gw,ParticleSys &parts,int i)=0;
00047 };
00048
00064 class ParticleSys : public MaxHeapOperators {
00065 private:
00066 CustomParticleDisplay *draw;
00067
00068 void DrawGW(GraphicsWindow *gw,DWORD flags,MarkerType type);
00069
00070 public:
00071 Tab<Point3> points;
00072 Tab<Point3> vels;
00073 Tab<TimeValue> ages;
00074 Tab<float> radius;
00075 Tab<float> tension;
00076 float size;
00077
00078
00079
00088 DllExport void Render(GraphicsWindow *gw,MarkerType type=POINT_MRKR);
00089
00090
00107 DllExport BOOL HitTest(GraphicsWindow *gw, HitRegion *hr,
00108 int abortOnHit=FALSE,MarkerType type=POINT_MRKR);
00109
00110
00117 DllExport Box3 BoundBox(Matrix3 *tm=NULL);
00118
00119
00123 DllExport void FreeAll();
00124
00125
00137 DllExport void SetCount(int c,DWORD flags);
00138
00141 int Count() {return points.Count();}
00144 Point3& operator[](int i) {return points[i];}
00145
00146
00153 BOOL Alive(int i) {return ages[i]>=0;}
00154
00155
00165 void SetCustomDraw(CustomParticleDisplay *d) {draw=d;}
00166 };
00167
00168
00169 #define PARTICLE_VELS (1<<0)
00170 #define PARTICLE_AGES (1<<1)
00171 #define PARTICLE_RADIUS (1<<2)
00172 #define PARTICLE_TENSION (1<<3)
00173
00174 class MetaParticle: public MaxHeapOperators {
00175 public:
00176 DllExport int CreateMetas(ParticleSys parts,Mesh *mesh,float threshold,float res,float strength,int many=1);
00177 DllExport int CreatePodMetas(SphereData *data,int num,Mesh *mesh,float threshold,float res,int many=1);
00178 };