24 BaseParticleRenderer::
25 BaseParticleRenderer(ParticleRendererAlphaMode alpha_mode) :
26 _alpha_mode(PR_NOT_INITIALIZED_YET) {
27 _render_node =
new GeomNode(
"BaseParticleRenderer render node");
28 _render_node_path =
NodePath(_render_node);
31 _ignore_scale =
false;
33 update_alpha_mode(alpha_mode);
39 BaseParticleRenderer::
41 _alpha_mode(PR_ALPHA_NONE) {
42 _render_node =
new GeomNode(
"BaseParticleRenderer render node");
43 _render_node_path =
NodePath(_render_node);
45 _user_alpha = copy._user_alpha;
46 set_ignore_scale(copy._ignore_scale);
48 update_alpha_mode(copy._alpha_mode);
69 _ignore_scale = ignore_scale;
72 _render_node->set_effect(CompassEffect::make(
NodePath(), CompassEffect::P_scale));
74 _render_node->clear_effect(CompassEffect::get_class_type());
84 out<<
"BaseParticleRenderer";
94 out.width(
indent); out<<
""; out<<
"BaseParticleRenderer:\n";
95 out.width(
indent+2); out<<
""; out<<
"_render_node "<<_render_node_path<<
"\n";
96 out.width(
indent+2); out<<
""; out<<
"_user_alpha "<<_user_alpha<<
"\n";
104 void BaseParticleRenderer::
105 update_alpha_mode(ParticleRendererAlphaMode am) {
106 if (_alpha_mode == am)
109 if ((am == PR_ALPHA_NONE) && (_alpha_mode != PR_ALPHA_NONE))
111 else if ((am != PR_ALPHA_NONE) && (_alpha_mode == PR_ALPHA_NONE))
120 void BaseParticleRenderer::
122 _render_state = RenderState::make(TransparencyAttrib::make(TransparencyAttrib::M_alpha),
123 ColorAttrib::make_vertex());
129 void BaseParticleRenderer::
131 _render_state = RenderState::make(TransparencyAttrib::make(TransparencyAttrib::M_none),
132 ColorAttrib::make_vertex());
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual ~BaseParticleRenderer()
Destructor.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Pure virtual particle renderer base class.
void set_ignore_scale(bool ignore_scale)
Sets the "ignore scale" flag.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A node that holds Geom objects, renderable pieces of geometry.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.