Panda3D
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

BaseParticleRenderer Class Reference

Pure virtual particle renderer base class. More...

#include "baseParticleRenderer.h"

Inheritance diagram for BaseParticleRenderer:
ReferenceCount MemoryBase GeomParticleRenderer LineParticleRenderer PointParticleRenderer SparkleParticleRenderer SpriteParticleRenderer

List of all members.

Public Types

enum  ParticleRendererAlphaMode {
  PR_ALPHA_NONE, PR_ALPHA_OUT, PR_ALPHA_IN, PR_ALPHA_IN_OUT,
  PR_ALPHA_USER, PR_NOT_INITIALIZED_YET
}
enum  ParticleRendererBlendMethod { PP_NO_BLEND, PP_BLEND_LINEAR, PP_BLEND_CUBIC }

Public Member Functions

virtual ~BaseParticleRenderer ()
 Destructor.
ParticleRendererAlphaMode get_alpha_mode () const
bool get_ignore_scale () const
 Returns the "ignore scale" flag.
GeomNodeget_render_node () const
 Query the geomnode pointer.
NodePath get_render_node_path () const
 Query the geomnode pointer.
PN_stdfloat get_user_alpha () const
 gets alpha for "user" alpha mode
virtual BaseParticleRenderermake_copy ()=0
virtual void output (ostream &out) const
 Write a string representation of this instance to <out>.
void set_alpha_mode (ParticleRendererAlphaMode am)
void set_color_blend_mode (ColorBlendAttrib::Mode bm, ColorBlendAttrib::Operand oa=ColorBlendAttrib::O_zero, ColorBlendAttrib::Operand ob=ColorBlendAttrib::O_zero)
 sets the ColorBlendAttrib on the _render_node
void set_ignore_scale (bool ignore_scale)
 Sets the "ignore scale" flag.
void set_user_alpha (PN_stdfloat ua)
 sets alpha for "user" alpha mode
virtual void write (ostream &out, int indent=0) const
 Write a string representation of this instance to <out>.

Protected Member Functions

 BaseParticleRenderer (ParticleRendererAlphaMode alpha_decay=PR_ALPHA_NONE)
 Default Constructor.
 BaseParticleRenderer (const BaseParticleRenderer &copy)
 Copy Constructor.
 CPT (RenderState) _render_state
void disable_alpha ()
 kills the intermediate alpha node/arc
void enable_alpha ()
 Builds an intermediate node and transition that enables alpha channeling.
PN_stdfloat get_cur_alpha (BaseParticle *bp)
 gets current alpha for a particle
virtual void resize_pool (int new_size)=0
void update_alpha_mode (ParticleRendererAlphaMode am)
 handles the base class part of alpha updating.

Protected Attributes

ParticleRendererAlphaMode _alpha_mode

Friends

class ParticleSystem

Detailed Description

Pure virtual particle renderer base class.

Definition at line 34 of file baseParticleRenderer.h.


Constructor & Destructor Documentation

BaseParticleRenderer::~BaseParticleRenderer ( ) [virtual]

Destructor.

Definition at line 62 of file baseParticleRenderer.cxx.

BaseParticleRenderer::BaseParticleRenderer ( ParticleRendererAlphaMode  alpha_decay = PR_ALPHA_NONE) [protected]

Default Constructor.

Definition at line 28 of file baseParticleRenderer.cxx.

References update_alpha_mode().

BaseParticleRenderer::BaseParticleRenderer ( const BaseParticleRenderer copy) [protected]

Copy Constructor.

Definition at line 45 of file baseParticleRenderer.cxx.

References set_ignore_scale(), and update_alpha_mode().


Member Function Documentation

void BaseParticleRenderer::disable_alpha ( ) [protected]

kills the intermediate alpha node/arc

Definition at line 154 of file baseParticleRenderer.cxx.

Referenced by update_alpha_mode().

void BaseParticleRenderer::enable_alpha ( ) [protected]

Builds an intermediate node and transition that enables alpha channeling.

Definition at line 143 of file baseParticleRenderer.cxx.

Referenced by update_alpha_mode().

PN_stdfloat BaseParticleRenderer::get_cur_alpha ( BaseParticle bp) [inline, protected]

gets current alpha for a particle

Definition at line 109 of file baseParticleRenderer.I.

bool BaseParticleRenderer::get_ignore_scale ( ) const [inline]

Returns the "ignore scale" flag.

See set_ignore_scale().

Definition at line 99 of file baseParticleRenderer.I.

GeomNode * BaseParticleRenderer::get_render_node ( ) const [inline]

Query the geomnode pointer.

Definition at line 21 of file baseParticleRenderer.I.

Referenced by SpriteParticleRenderer::~SpriteParticleRenderer().

NodePath BaseParticleRenderer::get_render_node_path ( ) const [inline]

Query the geomnode pointer.

Definition at line 31 of file baseParticleRenderer.I.

PN_stdfloat BaseParticleRenderer::get_user_alpha ( ) const [inline]

gets alpha for "user" alpha mode

Definition at line 70 of file baseParticleRenderer.I.

void BaseParticleRenderer::output ( ostream &  out) const [virtual]

Write a string representation of this instance to <out>.

Reimplemented in GeomParticleRenderer, LineParticleRenderer, PointParticleRenderer, SparkleParticleRenderer, and SpriteParticleRenderer.

Definition at line 96 of file baseParticleRenderer.cxx.

void BaseParticleRenderer::set_color_blend_mode ( ColorBlendAttrib::Mode  bm,
ColorBlendAttrib::Operand  oa = ColorBlendAttrib::O_zero,
ColorBlendAttrib::Operand  ob = ColorBlendAttrib::O_zero 
) [inline]

sets the ColorBlendAttrib on the _render_node

Definition at line 80 of file baseParticleRenderer.I.

void BaseParticleRenderer::set_ignore_scale ( bool  ignore_scale)

Sets the "ignore scale" flag.

When this is true, particles will be drawn as if they had no scale, regardless of whatever scale might be inherited from above the render node in the scene graph.

This flag is mainly useful to support legacy code that was written for a very early version of Panda, whose sprite particle renderer had a bug that incorrectly ignored the inherited scale.

Definition at line 79 of file baseParticleRenderer.cxx.

Referenced by BaseParticleRenderer().

void BaseParticleRenderer::set_user_alpha ( PN_stdfloat  ua) [inline]

sets alpha for "user" alpha mode

Definition at line 60 of file baseParticleRenderer.I.

void BaseParticleRenderer::update_alpha_mode ( ParticleRendererAlphaMode  am) [protected]

handles the base class part of alpha updating.

Definition at line 124 of file baseParticleRenderer.cxx.

References disable_alpha(), and enable_alpha().

Referenced by BaseParticleRenderer().

void BaseParticleRenderer::write ( ostream &  out,
int  indent = 0 
) const [virtual]

Write a string representation of this instance to <out>.

Reimplemented in GeomParticleRenderer, LineParticleRenderer, PointParticleRenderer, SparkleParticleRenderer, and SpriteParticleRenderer.

Definition at line 109 of file baseParticleRenderer.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations