00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GEE_PATH_TO_PARTICLES_H
00021 #define GEE_PATH_TO_PARTICLES_H
00022
00023 #include <gee_param_writer.h>
00024 #include <gee_particle_object.h>
00025 #include <gee_path_to_x.h>
00026
00027 #include <vee_random.h>
00028 #include <vee_render_class.h>
00029
00030 class GEE_PathToParticles : public GEE_PathToX
00031 {
00032 public:
00033 GEE_PathToParticles(GEE_id_t pathId = -1,
00034 GEE_id_t particleId = -1,
00035 GEE_id_t headPathId = -1);
00036 virtual ~GEE_PathToParticles();
00037
00038 virtual bool start(GEE_World *, const GEE_TimeStamp &);
00039 virtual bool stop(GEE_World *, const GEE_TimeStamp &);
00040
00041 virtual bool read(GEE_Io *);
00042 virtual bool write(GEE_Io *);
00043 virtual const char * type() { return "GEE_PathToParticles"; }
00044
00045 static GEE_Operator * create();
00046
00047 void setRate(float r) { m_rate = r; }
00048 void setRadius(float r) { m_radius = r; }
00049 void setRadiusExaggerate(float e) { m_exaggerateRadius = e; }
00050 void setRadiusNorm(float n) { m_radiusNorm = n; }
00051
00052 void setUseNapra(bool use) { m_useNapra = use; }
00053
00054 GEE_ParticleData & particle() { return m_particle; }
00055
00056 void setTextureName(const std::string &);
00057
00058 void setAlignment(int type) { m_alignType = type; }
00059 void setColorMix(float mix) { m_colorMix = mix; }
00060
00061 void setModulateParticleSize(bool m) { m_modulateParticleSize = m; }
00062
00063 static void alignParticle(GEE_ParticleData *,
00064 const GEE_PathVertex3D &,
00065 const VEE_Vector3 & headLoc,
00066 VEE_MotionAlign alignType,
00067 float baseSize,
00068 bool adjustSizeOfParticle,
00069 float * particleSize = 0);
00070
00071 protected:
00072
00073 virtual bool handleNewVertex(GEE_Path3D::iterator &);
00074
00075 virtual bool handleNewVertices(GEE_Path3D::iterator &,
00076 GEE_Path3D::iterator &);
00077
00078 bool createParticles(GEE_Path3D::iterator & it,
00079 GEE_Path3D::iterator & it2);
00080
00081 GEE_ParamWriter m_writer;
00082
00083 GEE_id_t m_particleId;
00084
00085 VEE_Vector3 m_prevVertex;
00086 float m_rate;
00087 float m_radius;
00088 float m_exaggerateRadius;
00089 float m_radiusNorm;
00090 float m_toolCenterWeight;
00092 float m_randomize;
00093 uint m_randomSeed;
00094 float m_remaining;
00095 float m_prevTime;
00096 VEE_RandomUniform m_rand;
00097
00098 bool m_useNapra;
00099 bool m_modulateParticleSize;
00100
00101 int m_alignType;
00102 float m_colorMix;
00103 int m_version;
00104
00105 GEE_ParticleData m_particle;
00106 VEE_RefPtr<GEE_Geometry> m_particles;
00107 };
00108
00109 #endif