00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LINEPARTICLERENDERER_H
00020 #define LINEPARTICLERENDERER_H
00021
00022 #include "baseParticle.h"
00023 #include "baseParticleRenderer.h"
00024
00025 #include <pointerTo.h>
00026 #include <pointerToArray.h>
00027 #include <geom.h>
00028 #include <geomLine.h>
00029
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDAPHYSICS LineParticleRenderer : public BaseParticleRenderer {
00037 private:
00038
00039 Colorf _head_color;
00040 Colorf _tail_color;
00041
00042 PT(GeomLine) _line_primitive;
00043
00044 PTA_Vertexf _vertex_array;
00045 PTA_Colorf _color_array;
00046
00047 int _max_pool_size;
00048
00049 LPoint3f _aabb_min, _aabb_max;
00050
00051 virtual void birth_particle(int index);
00052 virtual void kill_particle(int index);
00053 virtual void init_geoms(void);
00054 virtual void render(pvector< PT(PhysicsObject) >& po_vector,
00055 int ttl_particles);
00056 virtual void resize_pool(int new_size);
00057
00058 PUBLISHED:
00059 LineParticleRenderer(void);
00060 LineParticleRenderer(const LineParticleRenderer& copy);
00061 LineParticleRenderer(const Colorf& head,
00062 const Colorf& tail,
00063 ParticleRendererAlphaMode alpha_mode);
00064
00065 virtual ~LineParticleRenderer(void);
00066
00067 virtual BaseParticleRenderer *make_copy(void);
00068
00069 INLINE void set_head_color(const Colorf& c);
00070 INLINE void set_tail_color(const Colorf& c);
00071
00072 INLINE const Colorf& get_head_color(void) const;
00073 INLINE const Colorf& get_tail_color(void) const;
00074 };
00075
00076 #include "lineParticleRenderer.I"
00077
00078 #endif // LINEPARTICLERENDERER_H