diff --git a/panda/src/particlesystem/baseParticle.h b/panda/src/particlesystem/baseParticle.h index 4a6952d58b..1f5df02141 100644 --- a/panda/src/particlesystem/baseParticle.h +++ b/panda/src/particlesystem/baseParticle.h @@ -19,8 +19,8 @@ #ifndef BASEPARTICLE_H #define BASEPARTICLE_H -#include -#include +#include "pandabase.h" +#include "physicsObject.h" //////////////////////////////////////////////////////////////////// // Class : BaseParticle diff --git a/panda/src/particlesystem/baseParticleEmitter.h b/panda/src/particlesystem/baseParticleEmitter.h index 3b7a902dda..6910a961d8 100644 --- a/panda/src/particlesystem/baseParticleEmitter.h +++ b/panda/src/particlesystem/baseParticleEmitter.h @@ -19,15 +19,15 @@ #ifndef BASEPARTICLEEMITTER_H #define BASEPARTICLEEMITTER_H -#include -#include -#include +#include "pandabase.h" +#include "referenceCount.h" +#include "luse.h" #include "particleCommonFuncs.h" -#include +#include "mathNumbers.h" -//////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////// ////// // Class : BaseParticleEmitter // Description : Describes a physical region in space in which // particles are randomly generated. diff --git a/panda/src/particlesystem/baseParticleFactory.h b/panda/src/particlesystem/baseParticleFactory.h index d15e6eb73d..eaa9889814 100644 --- a/panda/src/particlesystem/baseParticleFactory.h +++ b/panda/src/particlesystem/baseParticleFactory.h @@ -19,8 +19,8 @@ #ifndef BASEPARTICLEFACTORY_H #define BASEPARTICLEFACTORY_H -#include -#include +#include "pandabase.h" +#include "referenceCount.h" #include "baseParticle.h" #include "particleCommonFuncs.h" @@ -32,22 +32,6 @@ // Description : Pure Virtual base class for creating particles //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS BaseParticleFactory : public ReferenceCount { -private: - float _lifespan_base; - float _lifespan_spread; - - float _mass_base; - float _mass_spread; - - float _terminal_velocity_base; - float _terminal_velocity_spread; - - virtual void populate_child_particle(BaseParticle *bp) const = 0; - -protected: - BaseParticleFactory(); - BaseParticleFactory(const BaseParticleFactory ©); - PUBLISHED: virtual ~BaseParticleFactory(); @@ -68,6 +52,22 @@ PUBLISHED: virtual BaseParticle *alloc_particle() const = 0; void populate_particle(BaseParticle* bp); + +protected: + BaseParticleFactory(); + BaseParticleFactory(const BaseParticleFactory ©); + +private: + float _lifespan_base; + float _lifespan_spread; + + float _mass_base; + float _mass_spread; + + float _terminal_velocity_base; + float _terminal_velocity_spread; + + virtual void populate_child_particle(BaseParticle *bp) const = 0; }; #include "baseParticleFactory.I" diff --git a/panda/src/particlesystem/baseParticleRenderer.h b/panda/src/particlesystem/baseParticleRenderer.h index 7143944366..081d35eda7 100644 --- a/panda/src/particlesystem/baseParticleRenderer.h +++ b/panda/src/particlesystem/baseParticleRenderer.h @@ -62,6 +62,11 @@ PUBLISHED: virtual void output(ostream &out, unsigned int indent=0) const; +public: + virtual BaseParticleRenderer *make_copy() = 0; + + friend class ParticleSystem; + protected: ParticleRendererAlphaMode _alpha_mode; @@ -98,11 +103,6 @@ private: virtual void init_geoms() = 0; virtual void render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles) = 0; - -public: - virtual BaseParticleRenderer *make_copy() = 0; - - friend class ParticleSystem; }; #include "baseParticleRenderer.I" diff --git a/panda/src/particlesystem/boxEmitter.h b/panda/src/particlesystem/boxEmitter.h index 353a9b22c3..a621afaa9e 100644 --- a/panda/src/particlesystem/boxEmitter.h +++ b/panda/src/particlesystem/boxEmitter.h @@ -27,15 +27,6 @@ // particles are generated. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS BoxEmitter : public BaseParticleEmitter { -private: - LPoint3f _vmin, _vmax; - - // CUSTOM EMISSION PARAMETERS - // none - - virtual void assign_initial_position(LPoint3f& pos); - virtual void assign_initial_velocity(LVector3f& vel); - PUBLISHED: BoxEmitter(); BoxEmitter(const BoxEmitter ©); @@ -48,6 +39,15 @@ PUBLISHED: INLINE LPoint3f get_min_bound() const; INLINE LPoint3f get_max_bound() const; + +private: + LPoint3f _vmin, _vmax; + + // CUSTOM EMISSION PARAMETERS + // none + + virtual void assign_initial_position(LPoint3f& pos); + virtual void assign_initial_velocity(LVector3f& vel); }; #include "boxEmitter.I" diff --git a/panda/src/particlesystem/config_particlesystem.h b/panda/src/particlesystem/config_particlesystem.h index d41f3f2f11..c603d5208a 100644 --- a/panda/src/particlesystem/config_particlesystem.h +++ b/panda/src/particlesystem/config_particlesystem.h @@ -19,9 +19,9 @@ #ifndef CONFIG_PARTICLESYSTEM_H #define CONFIG_PARTICLESYSTEM_H -#include -#include -#include +#include "pandabase.h" +#include "notifyCategoryProxy.h" +#include "dconfig.h" ConfigureDecl(config_particlesystem, EXPCL_PANDAPHYSICS, EXPTP_PANDAPHYSICS); NotifyCategoryDecl(particlesystem, EXPCL_PANDAPHYSICS, EXPTP_PANDAPHYSICS); diff --git a/panda/src/particlesystem/discEmitter.h b/panda/src/particlesystem/discEmitter.h index 2de6b997ca..b04e1f52ac 100644 --- a/panda/src/particlesystem/discEmitter.h +++ b/panda/src/particlesystem/discEmitter.h @@ -27,24 +27,6 @@ // are generated //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS DiscEmitter : public BaseParticleEmitter { -private: - float _radius; - - // CUSTOM EMISSION PARAMETERS - float _outer_aoe, _inner_aoe; - float _outer_magnitude, _inner_magnitude; - bool _cubic_lerping; - - /////////////////////////////// - // scratch variables that carry over from position calc to velocity calc - float _distance_from_center; - float _sinf_theta; - float _cosf_theta; - /////////////////////////////// - - virtual void assign_initial_position(LPoint3f& pos); - virtual void assign_initial_velocity(LVector3f& vel); - PUBLISHED: DiscEmitter(); DiscEmitter(const DiscEmitter ©); @@ -65,6 +47,24 @@ PUBLISHED: INLINE float get_outer_magnitude() const; INLINE float get_inner_magnitude() const; INLINE bool get_cubic_lerping() const; + +private: + float _radius; + + // CUSTOM EMISSION PARAMETERS + float _outer_aoe, _inner_aoe; + float _outer_magnitude, _inner_magnitude; + bool _cubic_lerping; + + /////////////////////////////// + // scratch variables that carry over from position calc to velocity calc + float _distance_from_center; + float _sinf_theta; + float _cosf_theta; + /////////////////////////////// + + virtual void assign_initial_position(LPoint3f& pos); + virtual void assign_initial_velocity(LVector3f& vel); }; #include "discEmitter.I" diff --git a/panda/src/particlesystem/geomParticleRenderer.h b/panda/src/particlesystem/geomParticleRenderer.h index 290d64d07d..fda43be424 100644 --- a/panda/src/particlesystem/geomParticleRenderer.h +++ b/panda/src/particlesystem/geomParticleRenderer.h @@ -29,6 +29,17 @@ #include "pvector.h" class EXPCL_PANDAPHYSICS GeomParticleRenderer : public BaseParticleRenderer { +PUBLISHED: + GeomParticleRenderer(ParticleRendererAlphaMode am = PR_ALPHA_NONE, + PandaNode *geom_node = (PandaNode *) NULL); + GeomParticleRenderer(const GeomParticleRenderer& copy); + virtual ~GeomParticleRenderer(); + + INLINE void set_geom_node(PandaNode *node); + INLINE PandaNode *get_geom_node(); + + virtual BaseParticleRenderer *make_copy(); + private: PT(PandaNode) _geom_node; @@ -48,17 +59,6 @@ private: virtual void resize_pool(int new_size); void kill_nodes(); - -PUBLISHED: - GeomParticleRenderer(ParticleRendererAlphaMode am = PR_ALPHA_NONE, - PandaNode *geom_node = (PandaNode *) NULL); - GeomParticleRenderer(const GeomParticleRenderer& copy); - virtual ~GeomParticleRenderer(); - - INLINE void set_geom_node(PandaNode *node); - INLINE PandaNode *get_geom_node(); - - virtual BaseParticleRenderer *make_copy(); }; #include "geomParticleRenderer.I" diff --git a/panda/src/particlesystem/lineParticleRenderer.h b/panda/src/particlesystem/lineParticleRenderer.h index 96e1cb1311..e9ee9a8946 100644 --- a/panda/src/particlesystem/lineParticleRenderer.h +++ b/panda/src/particlesystem/lineParticleRenderer.h @@ -22,10 +22,10 @@ #include "baseParticle.h" #include "baseParticleRenderer.h" -#include -#include -#include -#include +#include "pointerTo.h" +#include "pointerToArray.h" +#include "geom.h" +#include "geomLine.h" //////////////////////////////////////////////////////////////////// // Class : LineParticleRenderer @@ -34,25 +34,6 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS LineParticleRenderer : public BaseParticleRenderer { -PUBLISHED: - LineParticleRenderer(); - LineParticleRenderer(const LineParticleRenderer& copy); - LineParticleRenderer(const Colorf& head, - const Colorf& tail, - ParticleRendererAlphaMode alpha_mode); - - virtual ~LineParticleRenderer(); - - virtual BaseParticleRenderer *make_copy(); - - INLINE void set_head_color(const Colorf& c); - INLINE void set_tail_color(const Colorf& c); - - INLINE const Colorf& get_head_color() const; - INLINE const Colorf& get_tail_color() const; - - virtual void output(ostream &out, unsigned int indent=0) const; - private: Colorf _head_color; Colorf _tail_color; @@ -72,6 +53,25 @@ private: virtual void render(pvector< PT(PhysicsObject) >& po_vector, int ttl_particles); virtual void resize_pool(int new_size); + +PUBLISHED: + LineParticleRenderer(); + LineParticleRenderer(const LineParticleRenderer& copy); + LineParticleRenderer(const Colorf& head, + const Colorf& tail, + ParticleRendererAlphaMode alpha_mode); + + virtual ~LineParticleRenderer(); + + virtual BaseParticleRenderer *make_copy(); + + INLINE void set_head_color(const Colorf& c); + INLINE void set_tail_color(const Colorf& c); + + INLINE const Colorf& get_head_color() const; + INLINE const Colorf& get_tail_color() const; + + virtual void output(ostream &out, unsigned int indent=0) const; }; #include "lineParticleRenderer.I" diff --git a/panda/src/particlesystem/orientedParticleFactory.h b/panda/src/particlesystem/orientedParticleFactory.h index 7565de6ba2..7f587aec23 100644 --- a/panda/src/particlesystem/orientedParticleFactory.h +++ b/panda/src/particlesystem/orientedParticleFactory.h @@ -21,7 +21,7 @@ #include "baseParticleFactory.h" -#include +#include "luse.h" //////////////////////////////////////////////////////////////////// // Class : OrientedParticleFactory diff --git a/panda/src/particlesystem/particleSystem.h b/panda/src/particlesystem/particleSystem.h index 630ba4b3d5..9cf8c51762 100644 --- a/panda/src/particlesystem/particleSystem.h +++ b/panda/src/particlesystem/particleSystem.h @@ -45,56 +45,6 @@ class ParticleSystemManager; // Description : Contains and manages a particle system. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS ParticleSystem : public Physical { -private: - -#ifdef PSSANITYCHECK - int sanity_check(); -#endif - - bool birth_particle(); - void kill_particle(int pool_index); - void birth_litter(); - void resize_pool(int size); - - pdeque< int > _free_particle_fifo; - - int _particle_pool_size; - int _living_particles; - float _birth_rate; - float _tics_since_birth; - int _litter_size; - int _litter_spread; - float _system_age; - float _system_lifespan; - - PT(BaseParticleFactory) _factory; - PT(BaseParticleEmitter) _emitter; - PT(BaseParticleRenderer) _renderer; - ParticleSystemManager *_manager; - - bool _template_system_flag; - - // _render_parent is the ALREADY ALLOC'D node under which this - // system will render its particles. - - PT(PandaNode) _render_parent; - PT(PandaNode) _render_node; - - bool _active_system_flag; - bool _local_velocity_flag; - bool _system_grows_older_flag; - - // information for systems that will spawn - - bool _spawn_on_death_flag; - PT(PandaNode) _spawn_render_node; - pvector< PT(ParticleSystem) > _spawn_templates; - - void spawn_child_system(BaseParticle *bp); - - // information for spawned systems - bool _i_was_spawned_flag; - PUBLISHED: // constructor/destructor @@ -149,6 +99,55 @@ PUBLISHED: INLINE void induce_labor(); void update(float dt); +private: + #ifdef PSSANITYCHECK + int sanity_check(); + #endif + + bool birth_particle(); + void kill_particle(int pool_index); + void birth_litter(); + void resize_pool(int size); + + pdeque< int > _free_particle_fifo; + + int _particle_pool_size; + int _living_particles; + float _birth_rate; + float _tics_since_birth; + int _litter_size; + int _litter_spread; + float _system_age; + float _system_lifespan; + + PT(BaseParticleFactory) _factory; + PT(BaseParticleEmitter) _emitter; + PT(BaseParticleRenderer) _renderer; + ParticleSystemManager *_manager; + + bool _template_system_flag; + + // _render_parent is the ALREADY ALLOC'D node under which this + // system will render its particles. + + PT(PandaNode) _render_parent; + PT(PandaNode) _render_node; + + bool _active_system_flag; + bool _local_velocity_flag; + bool _system_grows_older_flag; + + // information for systems that will spawn + + bool _spawn_on_death_flag; + PT(PandaNode) _spawn_render_node; + pvector< PT(ParticleSystem) > _spawn_templates; + + void spawn_child_system(BaseParticle *bp); + + // information for spawned systems + bool _i_was_spawned_flag; + public: friend class ParticleSystemManager; }; diff --git a/panda/src/particlesystem/particleSystemManager.h b/panda/src/particlesystem/particleSystemManager.h index 82b884994b..f835a809de 100644 --- a/panda/src/particlesystem/particleSystemManager.h +++ b/panda/src/particlesystem/particleSystemManager.h @@ -19,7 +19,7 @@ #ifndef PARTICLESYSTEMMANAGER_H #define PARTICLESYSTEMMANAGER_H -#include +#include "pandabase.h" #include "plist.h" #include "particleSystem.h" @@ -32,13 +32,6 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS ParticleSystemManager { -private: - - plist< PT(ParticleSystem) > _ps_list; - - int _nth_frame; - int _cur_frame; - PUBLISHED: ParticleSystemManager(int every_nth_frame = 1); @@ -50,6 +43,12 @@ PUBLISHED: INLINE void clear(); void do_particles(float dt); + +private: + plist< PT(ParticleSystem) > _ps_list; + + int _nth_frame; + int _cur_frame; }; #include "particleSystemManager.I" diff --git a/panda/src/particlesystem/pointEmitter.h b/panda/src/particlesystem/pointEmitter.h index 399d741f19..ded7a546ce 100644 --- a/panda/src/particlesystem/pointEmitter.h +++ b/panda/src/particlesystem/pointEmitter.h @@ -27,15 +27,6 @@ // particles are generated. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS PointEmitter : public BaseParticleEmitter { -private: - LPoint3f _location; - - // CUSTOM EMISSION PARAMETERS - // none - - virtual void assign_initial_position(LPoint3f& pos); - virtual void assign_initial_velocity(LVector3f& vel); - PUBLISHED: PointEmitter(void); PointEmitter(const PointEmitter ©); @@ -45,6 +36,15 @@ PUBLISHED: INLINE void set_location(const LPoint3f& p); INLINE LPoint3f get_location(void) const; + +private: + LPoint3f _location; + + // CUSTOM EMISSION PARAMETERS + // none + + virtual void assign_initial_position(LPoint3f& pos); + virtual void assign_initial_velocity(LVector3f& vel); }; #include "pointEmitter.I" diff --git a/panda/src/particlesystem/pointParticleFactory.h b/panda/src/particlesystem/pointParticleFactory.h index c7cb68d004..9d21ade6a5 100644 --- a/panda/src/particlesystem/pointParticleFactory.h +++ b/panda/src/particlesystem/pointParticleFactory.h @@ -27,14 +27,14 @@ //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS PointParticleFactory : public BaseParticleFactory { -private: - virtual BaseParticle *alloc_particle() const; - virtual void populate_child_particle(BaseParticle *bp) const; - PUBLISHED: PointParticleFactory(); PointParticleFactory(const PointParticleFactory ©); virtual ~PointParticleFactory(); + +private: + virtual BaseParticle *alloc_particle() const; + virtual void populate_child_particle(BaseParticle *bp) const; }; #endif // POINTPARTICLEFACTORY_H diff --git a/panda/src/particlesystem/pointParticleRenderer.h b/panda/src/particlesystem/pointParticleRenderer.h index 5375487326..f082dd7cf0 100644 --- a/panda/src/particlesystem/pointParticleRenderer.h +++ b/panda/src/particlesystem/pointParticleRenderer.h @@ -22,11 +22,11 @@ #include "baseParticleRenderer.h" #include "baseParticle.h" -#include -#include -#include -#include -#include +#include "pointerTo.h" +#include "pointerToArray.h" +#include "luse.h" +#include "geom.h" +#include "geomPoint.h" //////////////////////////////////////////////////////////////////// // Class : PointParticleRenderer diff --git a/panda/src/particlesystem/ringEmitter.h b/panda/src/particlesystem/ringEmitter.h index 7212a62a4b..37b71850bd 100644 --- a/panda/src/particlesystem/ringEmitter.h +++ b/panda/src/particlesystem/ringEmitter.h @@ -27,6 +27,19 @@ // particles are generated. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS RingEmitter : public BaseParticleEmitter { +PUBLISHED: + RingEmitter(); + RingEmitter(const RingEmitter ©); + virtual ~RingEmitter(); + + virtual BaseParticleEmitter *make_copy(); + + INLINE void set_radius(float r); + INLINE void set_angle(float angle); + + INLINE float get_radius() const; + INLINE float get_angle() const; + private: float _radius; @@ -41,19 +54,6 @@ private: virtual void assign_initial_position(LPoint3f& pos); virtual void assign_initial_velocity(LVector3f& vel); - -PUBLISHED: - RingEmitter(); - RingEmitter(const RingEmitter ©); - virtual ~RingEmitter(); - - virtual BaseParticleEmitter *make_copy(); - - INLINE void set_radius(float r); - INLINE void set_angle(float angle); - - INLINE float get_radius() const; - INLINE float get_angle() const; }; #include "ringEmitter.I" diff --git a/panda/src/particlesystem/sparkleParticleRenderer.h b/panda/src/particlesystem/sparkleParticleRenderer.h index 74dce53dcc..e75bb05dc2 100644 --- a/panda/src/particlesystem/sparkleParticleRenderer.h +++ b/panda/src/particlesystem/sparkleParticleRenderer.h @@ -22,10 +22,10 @@ #include "baseParticle.h" #include "baseParticleRenderer.h" -#include -#include -#include -#include +#include "pointerTo.h" +#include "pointerToArray.h" +#include "geom.h" +#include "geomLine.h" enum SparkleParticleLifeScale { SP_NO_SCALE, @@ -69,7 +69,6 @@ PUBLISHED: INLINE SparkleParticleLifeScale get_life_scale() const; private: - Colorf _center_color; Colorf _edge_color; diff --git a/panda/src/particlesystem/sphereSurfaceEmitter.h b/panda/src/particlesystem/sphereSurfaceEmitter.h index ee6c1f86dc..e7d77dc8e8 100644 --- a/panda/src/particlesystem/sphereSurfaceEmitter.h +++ b/panda/src/particlesystem/sphereSurfaceEmitter.h @@ -27,15 +27,6 @@ // particles are generated. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS SphereSurfaceEmitter : public BaseParticleEmitter { -private: - float _radius; - - // CUSTOM EMISSION PARAMETERS - // none - - virtual void assign_initial_position(LPoint3f& pos); - virtual void assign_initial_velocity(LVector3f& vel); - PUBLISHED: SphereSurfaceEmitter(); SphereSurfaceEmitter(const SphereSurfaceEmitter ©); @@ -45,6 +36,15 @@ PUBLISHED: INLINE void set_radius(float r); INLINE float get_radius() const; + +private: + float _radius; + + // CUSTOM EMISSION PARAMETERS + // none + + virtual void assign_initial_position(LPoint3f& pos); + virtual void assign_initial_velocity(LVector3f& vel); }; #include "sphereSurfaceEmitter.I" diff --git a/panda/src/particlesystem/sphereVolumeEmitter.h b/panda/src/particlesystem/sphereVolumeEmitter.h index 05601519d3..87577c6be1 100644 --- a/panda/src/particlesystem/sphereVolumeEmitter.h +++ b/panda/src/particlesystem/sphereVolumeEmitter.h @@ -27,6 +27,16 @@ // particles are generated. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS SphereVolumeEmitter : public BaseParticleEmitter { +PUBLISHED: + SphereVolumeEmitter(void); + SphereVolumeEmitter(const SphereVolumeEmitter ©); + virtual ~SphereVolumeEmitter(void); + + virtual BaseParticleEmitter *make_copy(void); + + INLINE void set_radius(float r); + INLINE float get_radius(void) const; + private: float _radius; @@ -40,16 +50,6 @@ private: virtual void assign_initial_position(LPoint3f& pos); virtual void assign_initial_velocity(LVector3f& vel); - -PUBLISHED: - SphereVolumeEmitter(void); - SphereVolumeEmitter(const SphereVolumeEmitter ©); - virtual ~SphereVolumeEmitter(void); - - virtual BaseParticleEmitter *make_copy(void); - - INLINE void set_radius(float r); - INLINE float get_radius(void) const; }; #include "sphereVolumeEmitter.I" diff --git a/panda/src/particlesystem/spriteParticleRenderer.h b/panda/src/particlesystem/spriteParticleRenderer.h index abb6116d57..cd93b18ef8 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.h +++ b/panda/src/particlesystem/spriteParticleRenderer.h @@ -38,7 +38,6 @@ class NodePath; // trick sprites. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS SpriteParticleRenderer : public BaseParticleRenderer { - PUBLISHED: // This enumerated type indicates the source of the sprite texture: // whether it came from an explicit call to set_texture(), or @@ -48,38 +47,6 @@ PUBLISHED: ST_from_node, }; -private: - PT(GeomSprite) _sprite_primitive; - PTA_Vertexf _vertex_array; - PTA_Colorf _color_array; - PTA_float _x_texel_array; - PTA_float _y_texel_array; - PTA_float _theta_array; - - Colorf _color; - - float _initial_x_texel_ratio, _final_x_texel_ratio; - float _initial_y_texel_ratio, _final_y_texel_ratio; - float _theta; - - bool _animate_x_ratio, _animate_y_ratio; - bool _animate_theta; - - ParticleRendererBlendMethod _blend_method; - - Vertexf _aabb_min, _aabb_max; - - int _pool_size; - SourceType _source_type; - - virtual void birth_particle(int index); - virtual void kill_particle(int index); - virtual void init_geoms(); - virtual void render(pvector< PT(PhysicsObject) > &po_vector, - int ttl_particles); - virtual void resize_pool(int new_size); - -PUBLISHED: SpriteParticleRenderer(Texture *tex = (Texture *) NULL); SpriteParticleRenderer(const SpriteParticleRenderer ©); virtual ~SpriteParticleRenderer(); @@ -119,6 +86,37 @@ PUBLISHED: INLINE float get_nonanimated_theta() const; INLINE ParticleRendererBlendMethod get_alpha_blend_method() const; INLINE bool get_alpha_disable() const; + +private: + PT(GeomSprite) _sprite_primitive; + PTA_Vertexf _vertex_array; + PTA_Colorf _color_array; + PTA_float _x_texel_array; + PTA_float _y_texel_array; + PTA_float _theta_array; + + Colorf _color; + + float _initial_x_texel_ratio, _final_x_texel_ratio; + float _initial_y_texel_ratio, _final_y_texel_ratio; + float _theta; + + bool _animate_x_ratio, _animate_y_ratio; + bool _animate_theta; + + ParticleRendererBlendMethod _blend_method; + + Vertexf _aabb_min, _aabb_max; + + int _pool_size; + SourceType _source_type; + + virtual void birth_particle(int index); + virtual void kill_particle(int index); + virtual void init_geoms(); + virtual void render(pvector< PT(PhysicsObject) > &po_vector, + int ttl_particles); + virtual void resize_pool(int new_size); }; #include "spriteParticleRenderer.I" diff --git a/panda/src/particlesystem/tangentRingEmitter.h b/panda/src/particlesystem/tangentRingEmitter.h index 79ade494b9..7ca68d06f6 100644 --- a/panda/src/particlesystem/tangentRingEmitter.h +++ b/panda/src/particlesystem/tangentRingEmitter.h @@ -28,6 +28,16 @@ // fly off tangential to the ring. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS TangentRingEmitter : public BaseParticleEmitter { +PUBLISHED: + TangentRingEmitter(); + TangentRingEmitter(const TangentRingEmitter ©); + virtual ~TangentRingEmitter(); + + virtual BaseParticleEmitter *make_copy(); + + INLINE void set_radius(float r); + INLINE float get_radius() const; + private: float _radius; @@ -41,16 +51,6 @@ private: virtual void assign_initial_position(LPoint3f& pos); virtual void assign_initial_velocity(LVector3f& vel); - -PUBLISHED: - TangentRingEmitter(); - TangentRingEmitter(const TangentRingEmitter ©); - virtual ~TangentRingEmitter(); - - virtual BaseParticleEmitter *make_copy(); - - INLINE void set_radius(float r); - INLINE float get_radius() const; }; #include "tangentRingEmitter.I" diff --git a/panda/src/particlesystem/zSpinParticle.h b/panda/src/particlesystem/zSpinParticle.h index f45a66c832..3717316114 100644 --- a/panda/src/particlesystem/zSpinParticle.h +++ b/panda/src/particlesystem/zSpinParticle.h @@ -30,13 +30,6 @@ // oriented (i.e. angry quat math), use this. //////////////////////////////////////////////////////////////////// class EXPCL_PANDAPHYSICS ZSpinParticle : public BaseParticle { -private: - float _initial_angle; - float _final_angle; - float _cur_angle; - float _angular_velocity; - bool _bUseAngularVelocity; - public: ZSpinParticle(); ZSpinParticle(const ZSpinParticle ©); @@ -63,6 +56,13 @@ public: INLINE void enable_angular_velocity(bool bEnabled); INLINE bool get_angular_velocity_enabled() const; + +private: + float _initial_angle; + float _final_angle; + float _cur_angle; + float _angular_velocity; + bool _bUseAngularVelocity; }; #include "zSpinParticle.I" diff --git a/panda/src/particlesystem/zSpinParticleFactory.h b/panda/src/particlesystem/zSpinParticleFactory.h index c0cc3aaa11..b69243274a 100644 --- a/panda/src/particlesystem/zSpinParticleFactory.h +++ b/panda/src/particlesystem/zSpinParticleFactory.h @@ -25,18 +25,7 @@ // Class : ZSpinParticleFactory // Description : //////////////////////////////////////////////////////////////////// -class EXPCL_PANDAPHYSICS ZSpinParticleFactory : - public BaseParticleFactory { -private: - virtual void populate_child_particle(BaseParticle *bp) const; - virtual BaseParticle *alloc_particle() const; - - float _initial_angle,_initial_angle_spread; - float _final_angle,_final_angle_spread; - float _angular_velocity,_angular_velocity_spread; - bool _bUseAngularVelocity; - - +class EXPCL_PANDAPHYSICS ZSpinParticleFactory : public BaseParticleFactory { PUBLISHED: ZSpinParticleFactory(); ZSpinParticleFactory(const ZSpinParticleFactory ©); @@ -60,6 +49,15 @@ PUBLISHED: INLINE void enable_angular_velocity(bool bEnabled); INLINE bool get_angular_velocity_enabled() const; + +private: + virtual void populate_child_particle(BaseParticle *bp) const; + virtual BaseParticle *alloc_particle() const; + + float _initial_angle,_initial_angle_spread; + float _final_angle,_final_angle_spread; + float _angular_velocity,_angular_velocity_spread; + bool _bUseAngularVelocity; }; #include "zSpinParticleFactory.I"