Panda3D
Public Types | Public Member Functions

SpriteParticleRenderer Class Reference

Renders a particle system with high-speed nasty trick sprites. More...

Inheritance diagram for SpriteParticleRenderer:
BaseParticleRenderer

List of all members.

Public Types

enum  ParticleRendererAlphaMode {
  PRALPHANONE = 0, PRALPHAOUT = 1, PRALPHAIN = 2, PRALPHAINOUT = 3,
  PRALPHAUSER = 4, PRNOTINITIALIZEDYET = 5
}
enum  ParticleRendererBlendMethod { PPNOBLEND = 0, PPBLENDLINEAR = 1, PPBLENDCUBIC = 2 }

Public Member Functions

 SpriteParticleRenderer (SpriteParticleRenderer const copy)
 copy constructor
 SpriteParticleRenderer (Texture tex)
 constructor
 SpriteParticleRenderer ()
 constructor
 addFromNode (NodePath const node_path, string model, string node, bool size_from_texels, bool resize)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addFromNode (NodePath const node_path, string model, string node, bool size_from_texels)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addFromNode (NodePath const node_path, string model, string node)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addFromNode (NodePath const node_path, bool size_from_texels, bool resize)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addFromNode (NodePath const node_path, bool size_from_texels)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addFromNode (NodePath const node_path)
 This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.
 addTexture (Texture tex, float texels_per_unit, bool resize)
 Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.
 addTexture (Texture tex, float texels_per_unit)
 Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.
 addTexture (Texture tex)
 Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.
ParticleRendererBlendMethod getAlphaBlendMethod ()
bool getAlphaDisable ()
ParticleRendererAlphaMode getAlphaMode ()
SpriteAnim getAnim (int n)
bool getAnimAngleFlag ()
bool getAnimateFramesEnable ()
int getAnimateFramesIndex ()
float getAnimateFramesRate ()
list getAnims ()
VBase4 getColor ()
ColorInterpolationManager getColorInterpolationManager ()
float getFinalXScale ()
float getFinalYScale ()
float getHeight ()
 Returns the height of each particle in world units.
bool getIgnoreScale ()
 Returns the "ignore scale" flag.
float getInitialXScale ()
float getInitialYScale ()
SpriteAnim getLastAnim ()
Point2 getLlUv ()
 Returns the UV coordinate of the lower-left corner; see set_ll_uv().
Point2 getLlUv (int anim, int frame)
 Returns the UV coordinate of the lower-left corner; see set_ll_uv().
float getNonanimatedTheta ()
int getNumAnims ()
GeomNode getRenderNode ()
 Query the geomnode pointer.
NodePath getRenderNodePath ()
 Query the geomnode pointer.
Texture getTexture ()
Texture getTexture (int anim, int frame)
Point2 getUrUv ()
 Returns the UV coordinate of the lower-left corner; see set_ur_uv().
Point2 getUrUv (int anim, int frame)
 Returns the UV coordinate of the upper-right corner; see set_ur_uv().
float getUserAlpha ()
 gets alpha for "user" alpha mode
float getWidth ()
 Returns the width of each particle in world units.
bool getXScaleFlag ()
bool getYScaleFlag ()
 output (ostream out)
 Write a string representation of this instance to <out>.
 removeAnimation (int n)
 Removes an animation texture set from the renderer.
 setAlphaBlendMethod (ParticleRendererBlendMethod bm)
 setAlphaDisable (bool ad)
 setAlphaMode (ParticleRendererAlphaMode am)
 setAnimAngleFlag (bool animate_theta)
 setAnimateFramesEnable (bool an)
 setAnimateFramesIndex (int i)
 setAnimateFramesRate (float r)
 setColor (VBase4 const color)
 setColorBlendMode (Mode bm, Operand oa, Operand ob)
 sets the ColorBlendAttrib on the _render_node
 setColorBlendMode (Mode bm)
 sets the ColorBlendAttrib on the _render_node
 setColorBlendMode (Mode bm, Operand oa)
 sets the ColorBlendAttrib on the _render_node
 setFinalXScale (float final_x_scale)
 setFinalYScale (float final_y_scale)
 setFromNode (NodePath const node_path, bool size_from_texels)
 Sets the properties on this renderer from the geometry referenced by the indicated NodePath.
 setFromNode (NodePath const node_path, string model, string node)
 If the source type is important, use this one.
 setFromNode (NodePath const node_path, string model, string node, bool size_from_texels)
 If the source type is important, use this one.
 setFromNode (NodePath const node_path)
 Sets the properties on this renderer from the geometry referenced by the indicated NodePath.
 setIgnoreScale (bool ignore_scale)
 Sets the "ignore scale" flag.
 setInitialXScale (float initial_x_scale)
 setInitialYScale (float initial_y_scale)
 setLlUv (Point2 const ll_uv, int anim, int frame)
 Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer.
 setLlUv (Point2 const ll_uv)
 Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer.
 setNonanimatedTheta (float theta)
 setSize (float width, float height)
 Sets the size of each particle in world units.
 setTexture (Texture tex)
 Sets the renderer up to render the entire texture image.
 setTexture (Texture tex, float texels_per_unit)
 Sets the renderer up to render the entire texture image.
 setUrUv (Point2 const ur_uv, int anim, int frame)
 Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.
 setUrUv (Point2 const ur_uv)
 Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.
 setUserAlpha (float ua)
 sets alpha for "user" alpha mode
 setXScaleFlag (bool animate_x_ratio)
 setYScaleFlag (bool animate_y_ratio)
 write (ostream out)
 Write a string representation of this instance to <out>.
 write (ostream out, int indent)
 Write a string representation of this instance to <out>.

Detailed Description

Renders a particle system with high-speed nasty trick sprites.


Member Enumeration Documentation

enum ParticleRendererAlphaMode [inherited]
Enumerator:
PRALPHANONE 
PRALPHAOUT 
PRALPHAIN 
PRALPHAINOUT 
PRALPHAUSER 
PRNOTINITIALIZEDYET 
enum ParticleRendererBlendMethod [inherited]
Enumerator:
PPNOBLEND 
PPBLENDLINEAR 
PPBLENDCUBIC 

Constructor & Destructor Documentation

copy constructor

SpriteParticleRenderer ( Texture  tex)

constructor

constructor


Member Function Documentation

addFromNode ( NodePath const  node_path,
string  model,
string  node,
bool  size_from_texels,
bool  resize 
)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode ( NodePath const  node_path,
bool  size_from_texels,
bool  resize 
)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode ( NodePath const  node_path,
bool  size_from_texels 
)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode ( NodePath const  node_path)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode ( NodePath const  node_path,
string  model,
string  node,
bool  size_from_texels 
)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addFromNode ( NodePath const  node_path,
string  model,
string  node 
)

This will allow the renderer to randomly choose from more than one texture or sequence at particle birth.

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

If resize is true, or if there are no textures currently on the renderer, it will force the renderer to use the size information from this node from now on. (Default is false)

addTexture ( Texture  tex,
float  texels_per_unit,
bool  resize 
)

Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.

This should only be called after a previous call to set_texture().

addTexture ( Texture  tex,
float  texels_per_unit 
)

Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.

This should only be called after a previous call to set_texture().

addTexture ( Texture  tex)

Adds texture to image pool, effectively creating a single frame animation that can be selected at particle birth.

This should only be called after a previous call to set_texture().

ParticleRendererBlendMethod getAlphaBlendMethod ( )
bool getAlphaDisable ( )
ParticleRendererAlphaMode getAlphaMode ( ) [inherited]
SpriteAnim getAnim ( int  n)
bool getAnimAngleFlag ( )
bool getAnimateFramesEnable ( )
int getAnimateFramesIndex ( )
float getAnimateFramesRate ( )
list getAnims ( )
VBase4 getColor ( )
ColorInterpolationManager getColorInterpolationManager ( )
float getFinalXScale ( )
float getFinalYScale ( )
float getHeight ( )

Returns the height of each particle in world units.

bool getIgnoreScale ( ) [inherited]

Returns the "ignore scale" flag.

See set_ignore_scale().

float getInitialXScale ( )
float getInitialYScale ( )
SpriteAnim getLastAnim ( )
Point2 getLlUv ( )

Returns the UV coordinate of the lower-left corner; see set_ll_uv().

Point2 getLlUv ( int  anim,
int  frame 
)

Returns the UV coordinate of the lower-left corner; see set_ll_uv().

float getNonanimatedTheta ( )
int getNumAnims ( )
GeomNode getRenderNode ( ) [inherited]

Query the geomnode pointer.

NodePath getRenderNodePath ( ) [inherited]

Query the geomnode pointer.

Texture getTexture ( int  anim,
int  frame 
)
Texture getTexture ( )
Point2 getUrUv ( int  anim,
int  frame 
)

Returns the UV coordinate of the upper-right corner; see set_ur_uv().

Point2 getUrUv ( )

Returns the UV coordinate of the lower-left corner; see set_ur_uv().

float getUserAlpha ( ) [inherited]

gets alpha for "user" alpha mode

float getWidth ( )

Returns the width of each particle in world units.

bool getXScaleFlag ( )
bool getYScaleFlag ( )
output ( ostream  out) [inherited]

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

removeAnimation ( int  n)

Removes an animation texture set from the renderer.

setAlphaBlendMethod ( ParticleRendererBlendMethod  bm)
setAlphaDisable ( bool  ad)
setAlphaMode ( ParticleRendererAlphaMode  am) [inherited]
setAnimAngleFlag ( bool  animate_theta)
setAnimateFramesEnable ( bool  an)
setAnimateFramesIndex ( int  i)
setAnimateFramesRate ( float  r)
setColor ( VBase4 const  color)
setColorBlendMode ( Mode  bm,
Operand  oa,
Operand  ob 
) [inherited]

sets the ColorBlendAttrib on the _render_node

setColorBlendMode ( Mode  bm,
Operand  oa 
) [inherited]

sets the ColorBlendAttrib on the _render_node

setColorBlendMode ( Mode  bm) [inherited]

sets the ColorBlendAttrib on the _render_node

setFinalXScale ( float  final_x_scale)
setFinalYScale ( float  final_y_scale)
setFromNode ( NodePath const  node_path,
string  model,
string  node,
bool  size_from_texels 
)

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

This will remove all previously add textures and resize the renderer to match the new geometry.

setFromNode ( NodePath const  node_path,
bool  size_from_texels 
)

Sets the properties on this renderer from the geometry referenced by the indicated NodePath.

This should be a reference to a GeomNode or a SequenceNode; it extracts out the texture and UV range from the node.

This will remove all previously added textures and animations. It will also resize the renderer to match this new geometry.

If node_path refers to a GeomNode(or has one beneath it) the texture, its size, and UV data will be extracted from that.

If node_path references a SequenceNode(or has one beneath it) with multiple GeomNodes beneath it, the size data will correspond only to the first GeomNode found with a valid texture, while the texture and UV information will be stored for each individual node.

If size_from_texels is true, the particle size is based on the number of texels in the source image; otherwise, it is based on the size of the first polygon found in the node.

model and node are the two items used to construct node_path. If the source type is important, use set_from_node(NodePath,string,string,bool) instead.

setFromNode ( NodePath const  node_path,
string  model,
string  node 
)

If the source type is important, use this one.

model and node should lead to node_path like this: node_path = loader.loadModel(model).find(node)

This will remove all previously add textures and resize the renderer to match the new geometry.

setFromNode ( NodePath const  node_path)

Sets the properties on this renderer from the geometry referenced by the indicated NodePath.

This should be a reference to a GeomNode or a SequenceNode; it extracts out the texture and UV range from the node.

This will remove all previously added textures and animations. It will also resize the renderer to match this new geometry.

If node_path refers to a GeomNode(or has one beneath it) the texture, its size, and UV data will be extracted from that.

If node_path references a SequenceNode(or has one beneath it) with multiple GeomNodes beneath it, the size data will correspond only to the first GeomNode found with a valid texture, while the texture and UV information will be stored for each individual node.

If size_from_texels is true, the particle size is based on the number of texels in the source image; otherwise, it is based on the size of the first polygon found in the node.

model and node are the two items used to construct node_path. If the source type is important, use set_from_node(NodePath,string,string,bool) instead.

setIgnoreScale ( bool  ignore_scale) [inherited]

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.

setInitialXScale ( float  initial_x_scale)
setInitialYScale ( float  initial_y_scale)
setLlUv ( Point2 const  ll_uv,
int  anim,
int  frame 
)

Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer.

Normally this is (0, 0), but it might be set to something else to use only a portion of the texture.

setLlUv ( Point2 const  ll_uv)

Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer.

Normally this is (0, 0), but it might be set to something else to use only a portion of the texture.

setNonanimatedTheta ( float  theta)
setSize ( float  width,
float  height 
)

Sets the size of each particle in world units.

setTexture ( Texture  tex,
float  texels_per_unit 
)

Sets the renderer up to render the entire texture image.

The scale of each particle is based on the size of the texture in each dimension, modified by texels_per_unit.

Used to set the size of the particles. Will clear all previously loaded textures and animations.

setTexture ( Texture  tex)

Sets the renderer up to render the entire texture image.

The scale of each particle is based on the size of the texture in each dimension, modified by texels_per_unit.

Used to set the size of the particles. Will clear all previously loaded textures and animations.

setUrUv ( Point2 const  ur_uv,
int  anim,
int  frame 
)

Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.

Normally this is (1, 1), but it might be set to something else to use only a portion of the texture.

setUrUv ( Point2 const  ur_uv)

Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.

Normally this is (1, 1), but it might be set to something else to use only a portion of the texture.

setUserAlpha ( float  ua) [inherited]

sets alpha for "user" alpha mode

setXScaleFlag ( bool  animate_x_ratio)
setYScaleFlag ( bool  animate_y_ratio)
write ( ostream  out,
int  indent 
) [inherited]

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

write ( ostream  out) [inherited]

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

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties