mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
*** empty log message ***
This commit is contained in:
parent
1196b8fab0
commit
751d6c99f9
@ -20,7 +20,7 @@
|
|||||||
// particles are randomly generated.
|
// particles are randomly generated.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
class EXPCL_PANDAPHYSICS BaseParticleEmitter : public ReferenceCount {
|
class EXPCL_PANDAPHYSICS BaseParticleEmitter : public ReferenceCount {
|
||||||
public:
|
PUBLISHED:
|
||||||
enum emissionType {
|
enum emissionType {
|
||||||
ET_EXPLICIT, // all particles are emitted in the same direction
|
ET_EXPLICIT, // all particles are emitted in the same direction
|
||||||
ET_RADIATE, // all particles radiate away from a single point
|
ET_RADIATE, // all particles radiate away from a single point
|
||||||
|
@ -35,7 +35,7 @@ protected:
|
|||||||
BaseParticleFactory(void);
|
BaseParticleFactory(void);
|
||||||
BaseParticleFactory(const BaseParticleFactory ©);
|
BaseParticleFactory(const BaseParticleFactory ©);
|
||||||
|
|
||||||
public:
|
PUBLISHED:
|
||||||
virtual ~BaseParticleFactory(void);
|
virtual ~BaseParticleFactory(void);
|
||||||
|
|
||||||
INLINE void set_lifespan_base(float lb);
|
INLINE void set_lifespan_base(float lb);
|
||||||
|
@ -35,7 +35,7 @@ disable_alpha(void) {
|
|||||||
// Access : public
|
// Access : public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void BaseParticleRenderer::
|
INLINE void BaseParticleRenderer::
|
||||||
set_alpha_mode(ParticleRendererAlphaMode am) {
|
set_alpha_mode(BaseParticleRenderer::ParticleRendererAlphaMode am) {
|
||||||
update_alpha_mode(am);
|
update_alpha_mode(am);
|
||||||
init_geoms();
|
init_geoms();
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ set_alpha_mode(ParticleRendererAlphaMode am) {
|
|||||||
// Function : get_alpha_mode
|
// Function : get_alpha_mode
|
||||||
// Access : public
|
// Access : public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE ParticleRendererAlphaMode BaseParticleRenderer::
|
INLINE BaseParticleRenderer::ParticleRendererAlphaMode BaseParticleRenderer::
|
||||||
get_alpha_mode(void) const {
|
get_alpha_mode(void) const {
|
||||||
return _alpha_mode;
|
return _alpha_mode;
|
||||||
}
|
}
|
||||||
|
@ -19,20 +19,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
enum ParticleRendererAlphaMode {
|
|
||||||
PR_ALPHA_NONE,
|
|
||||||
PR_ALPHA_OUT,
|
|
||||||
PR_ALPHA_IN,
|
|
||||||
PR_ALPHA_USER,
|
|
||||||
PR_NOT_INITIALIZED_YET
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ParticleRendererBlendMethod {
|
|
||||||
PP_NO_BLEND,
|
|
||||||
PP_BLEND_LINEAR,
|
|
||||||
PP_BLEND_CUBIC
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : BaseParticleRenderer
|
// Class : BaseParticleRenderer
|
||||||
// Description : Pure virtual particle renderer base class
|
// Description : Pure virtual particle renderer base class
|
||||||
@ -65,6 +51,31 @@ private:
|
|||||||
virtual void render(vector< PT(PhysicsObject) >& po_vector,
|
virtual void render(vector< PT(PhysicsObject) >& po_vector,
|
||||||
int ttl_particles) = 0;
|
int ttl_particles) = 0;
|
||||||
|
|
||||||
|
PUBLISHED:
|
||||||
|
enum ParticleRendererAlphaMode {
|
||||||
|
PR_ALPHA_NONE,
|
||||||
|
PR_ALPHA_OUT,
|
||||||
|
PR_ALPHA_IN,
|
||||||
|
PR_ALPHA_USER,
|
||||||
|
PR_NOT_INITIALIZED_YET
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ParticleRendererBlendMethod {
|
||||||
|
PP_NO_BLEND,
|
||||||
|
PP_BLEND_LINEAR,
|
||||||
|
PP_BLEND_CUBIC
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual ~BaseParticleRenderer(void);
|
||||||
|
|
||||||
|
INLINE GeomNode *get_render_node(void) const;
|
||||||
|
|
||||||
|
INLINE void set_alpha_mode(ParticleRendererAlphaMode am);
|
||||||
|
INLINE ParticleRendererAlphaMode get_alpha_mode(void) const;
|
||||||
|
|
||||||
|
INLINE void set_user_alpha(float ua);
|
||||||
|
INLINE float get_user_alpha(void) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GeomNode *_interface_node;
|
GeomNode *_interface_node;
|
||||||
|
|
||||||
@ -83,17 +94,6 @@ protected:
|
|||||||
virtual void resize_pool(int new_size) = 0;
|
virtual void resize_pool(int new_size) = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~BaseParticleRenderer(void);
|
|
||||||
|
|
||||||
INLINE GeomNode *get_render_node(void) const;
|
|
||||||
|
|
||||||
INLINE void set_alpha_mode(ParticleRendererAlphaMode am);
|
|
||||||
INLINE ParticleRendererAlphaMode get_alpha_mode(void) const;
|
|
||||||
|
|
||||||
INLINE void set_user_alpha(float ua);
|
|
||||||
INLINE float get_user_alpha(void) const;
|
|
||||||
|
|
||||||
virtual BaseParticleRenderer *make_copy(void) = 0;
|
virtual BaseParticleRenderer *make_copy(void) = 0;
|
||||||
|
|
||||||
friend class ParticleSystem;
|
friend class ParticleSystem;
|
||||||
|
@ -36,7 +36,7 @@ set_end_color(const Colorf& ec) {
|
|||||||
// Access : Public
|
// Access : Public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void PointParticleRenderer::
|
INLINE void PointParticleRenderer::
|
||||||
set_blend_type(PointParticleBlendType bt) {
|
set_blend_type(PointParticleRenderer::PointParticleBlendType bt) {
|
||||||
_blend_type = bt;
|
_blend_type = bt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ set_blend_type(PointParticleBlendType bt) {
|
|||||||
// Access : Public
|
// Access : Public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE void PointParticleRenderer::
|
INLINE void PointParticleRenderer::
|
||||||
set_blend_method(ParticleRendererBlendMethod bm) {
|
set_blend_method(BaseParticleRenderer::ParticleRendererBlendMethod bm) {
|
||||||
_blend_method = bm;
|
_blend_method = bm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ get_end_color(void) const {
|
|||||||
// Function : get_blend_type
|
// Function : get_blend_type
|
||||||
// Access : Public
|
// Access : Public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE PointParticleBlendType PointParticleRenderer::
|
INLINE PointParticleRenderer::PointParticleBlendType PointParticleRenderer::
|
||||||
get_blend_type(void) const {
|
get_blend_type(void) const {
|
||||||
return _blend_type;
|
return _blend_type;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ get_blend_type(void) const {
|
|||||||
// Function : get_blend_method
|
// Function : get_blend_method
|
||||||
// Access : Public
|
// Access : Public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE ParticleRendererBlendMethod PointParticleRenderer::
|
INLINE BaseParticleRenderer::ParticleRendererBlendMethod PointParticleRenderer::
|
||||||
get_blend_method(void) const {
|
get_blend_method(void) const {
|
||||||
return _blend_method;
|
return _blend_method;
|
||||||
}
|
}
|
||||||
|
@ -15,12 +15,6 @@
|
|||||||
#include <geom.h>
|
#include <geom.h>
|
||||||
#include <geomPoint.h>
|
#include <geomPoint.h>
|
||||||
|
|
||||||
enum PointParticleBlendType {
|
|
||||||
PP_ONE_COLOR,
|
|
||||||
PP_BLEND_LIFE,
|
|
||||||
PP_BLEND_VEL
|
|
||||||
};
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Class : PointParticleRenderer
|
// Class : PointParticleRenderer
|
||||||
// Description : Simple point/point particle renderer. Does NOT
|
// Description : Simple point/point particle renderer. Does NOT
|
||||||
@ -29,33 +23,13 @@ enum PointParticleBlendType {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class EXPCL_PANDAPHYSICS PointParticleRenderer : public BaseParticleRenderer {
|
class EXPCL_PANDAPHYSICS PointParticleRenderer : public BaseParticleRenderer {
|
||||||
private:
|
|
||||||
|
|
||||||
Colorf _start_color, _end_color;
|
|
||||||
float _point_size;
|
|
||||||
|
|
||||||
PT(GeomPoint) _point_primitive;
|
|
||||||
|
|
||||||
PTA_Vertexf _vertex_array;
|
|
||||||
PTA_Colorf _color_array;
|
|
||||||
|
|
||||||
int _max_pool_size;
|
|
||||||
|
|
||||||
PointParticleBlendType _blend_type;
|
|
||||||
ParticleRendererBlendMethod _blend_method;
|
|
||||||
|
|
||||||
LPoint3f _aabb_min, _aabb_max;
|
|
||||||
|
|
||||||
Colorf create_color(const BaseParticle *p);
|
|
||||||
|
|
||||||
virtual void birth_particle(int index);
|
|
||||||
virtual void kill_particle(int index);
|
|
||||||
virtual void init_geoms(void);
|
|
||||||
virtual void render(vector< PT(PhysicsObject) >& po_vector,
|
|
||||||
int ttl_particles);
|
|
||||||
virtual void resize_pool(int new_size);
|
|
||||||
|
|
||||||
PUBLISHED:
|
PUBLISHED:
|
||||||
|
enum PointParticleBlendType {
|
||||||
|
PP_ONE_COLOR,
|
||||||
|
PP_BLEND_LIFE,
|
||||||
|
PP_BLEND_VEL
|
||||||
|
};
|
||||||
|
|
||||||
PointParticleRenderer(const PointParticleRenderer& copy);
|
PointParticleRenderer(const PointParticleRenderer& copy);
|
||||||
PointParticleRenderer(ParticleRendererAlphaMode ad = PR_ALPHA_NONE,
|
PointParticleRenderer(ParticleRendererAlphaMode ad = PR_ALPHA_NONE,
|
||||||
float point_size = 1.0f,
|
float point_size = 1.0f,
|
||||||
@ -79,6 +53,31 @@ PUBLISHED:
|
|||||||
INLINE const Colorf& get_end_color(void) const;
|
INLINE const Colorf& get_end_color(void) const;
|
||||||
INLINE PointParticleBlendType get_blend_type(void) const;
|
INLINE PointParticleBlendType get_blend_type(void) const;
|
||||||
INLINE ParticleRendererBlendMethod get_blend_method(void) const;
|
INLINE ParticleRendererBlendMethod get_blend_method(void) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Colorf _start_color, _end_color;
|
||||||
|
float _point_size;
|
||||||
|
|
||||||
|
PT(GeomPoint) _point_primitive;
|
||||||
|
|
||||||
|
PTA_Vertexf _vertex_array;
|
||||||
|
PTA_Colorf _color_array;
|
||||||
|
|
||||||
|
int _max_pool_size;
|
||||||
|
|
||||||
|
PointParticleBlendType _blend_type;
|
||||||
|
ParticleRendererBlendMethod _blend_method;
|
||||||
|
|
||||||
|
LPoint3f _aabb_min, _aabb_max;
|
||||||
|
|
||||||
|
Colorf create_color(const BaseParticle *p);
|
||||||
|
|
||||||
|
virtual void birth_particle(int index);
|
||||||
|
virtual void kill_particle(int index);
|
||||||
|
virtual void init_geoms(void);
|
||||||
|
virtual void render(vector< PT(PhysicsObject) >& po_vector,
|
||||||
|
int ttl_particles);
|
||||||
|
virtual void resize_pool(int new_size);
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "pointParticleRenderer.I"
|
#include "pointParticleRenderer.I"
|
||||||
|
@ -232,7 +232,7 @@ get_nonanimated_theta(void) const {
|
|||||||
// Function : get_alpha_blend_method
|
// Function : get_alpha_blend_method
|
||||||
// Access : public
|
// Access : public
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE ParticleRendererBlendMethod SpriteParticleRenderer::
|
INLINE BaseParticleRenderer::ParticleRendererBlendMethod SpriteParticleRenderer::
|
||||||
get_alpha_blend_method(void) const {
|
get_alpha_blend_method(void) const {
|
||||||
return _blend_method;
|
return _blend_method;
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@
|
|||||||
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_NONE
|
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_NONE
|
||||||
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_IN
|
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_IN
|
||||||
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_OUT
|
//#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_OUT
|
||||||
#define PARTICLE_RENDERER_ALPHA_MODE PR_ALPHA_USER
|
#define PARTICLE_RENDERER_ALPHA_MODE BaseParticleRenderer::PR_ALPHA_USER
|
||||||
#define PARTICLE_RENDERER_USER_ALPHA 1.0
|
#define PARTICLE_RENDERER_USER_ALPHA 1.0
|
||||||
|
|
||||||
#ifdef GEOM_PARTICLE_RENDERER
|
#ifdef GEOM_PARTICLE_RENDERER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user