Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SpriteParticleRenderer Class Reference

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

#include <pandadoc.hpp>

Inheritance diagram for SpriteParticleRenderer:
BaseParticleRenderer ReferenceCount SpriteParticleRendererExt

Public Member Functions

 __init__ (const SpriteParticleRenderer copy)
 copy constructor
 
 __init__ (Texture tex)
 constructor
 
 addFromNode (const NodePath 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 (const NodePath node_path, str model, str 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.
 
 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.
 
BaseParticleRenderer::ParticleRendererBlendMethod getAlphaBlendMethod ()
 
bool getAlphaDisable ()
 
SpriteAnim getAnim (const int n)
 
bool getAnimAngleFlag ()
 
bool getAnimateFramesEnable ()
 
int getAnimateFramesIndex ()
 
float getAnimateFramesRate ()
 
list getAnims ()
 
LColor getColor ()
 
ColorInterpolationManager getColorInterpolationManager ()
 
float getFinalXScale ()
 
float getFinalYScale ()
 
float getHeight ()
 Returns the height of each particle in world units.
 
float getInitialXScale ()
 
float getInitialYScale ()
 
SpriteAnim getLastAnim ()
 
LTexCoord getLlUv ()
 Returns the UV coordinate of the lower-left corner; see set_ll_uv().
 
LTexCoord getLlUv (const int anim, const int frame)
 Returns the UV coordinate of the lower-left corner; see set_ll_uv().
 
float getNonanimatedTheta ()
 
int getNumAnims ()
 
Texture getTexture ()
 
Texture getTexture (const int anim, const int frame)
 
LTexCoord getUrUv ()
 Returns the UV coordinate of the lower-left corner; see set_ur_uv().
 
LTexCoord getUrUv (const int anim, const int frame)
 Returns the UV coordinate of the upper-right corner; see set_ur_uv().
 
float getWidth ()
 Returns the width of each particle in world units.
 
bool getXScaleFlag ()
 
bool getYScaleFlag ()
 
 removeAnimation (const int n)
 Removes an animation texture set from the renderer.
 
 setAlphaBlendMethod (BaseParticleRenderer::ParticleRendererBlendMethod bm)
 
 setAlphaDisable (bool ad)
 
 setAnimAngleFlag (bool animate_theta)
 
 setAnimateFramesEnable (bool an)
 
 setAnimateFramesIndex (int i)
 
 setAnimateFramesRate (float r)
 
 setColor (const LColor color)
 
 setFinalXScale (float final_x_scale)
 
 setFinalYScale (float final_y_scale)
 
 setFromNode (const NodePath node_path, bool size_from_texels)
 Sets the properties on this renderer from the geometry referenced by the indicated NodePath.
 
 setFromNode (const NodePath node_path, str model, str node, bool size_from_texels)
 If the source type is important, use this one.
 
 setInitialXScale (float initial_x_scale)
 
 setInitialYScale (float initial_y_scale)
 
 setLlUv (const LTexCoord ll_uv)
 Sets the UV coordinate of the lower-left corner of all the sprites generated by this renderer.
 
 setLlUv (const LTexCoord ll_uv, const int anim, const int frame)
 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, float texels_per_unit)
 Sets the renderer up to render the entire texture image.
 
 setUrUv (const LTexCoord ur_uv)
 Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.
 
 setUrUv (const LTexCoord ur_uv, const int anim, const int frame)
 Sets the UV coordinate of the upper-right corner of all the sprites generated by this renderer.
 
 setXScaleFlag (bool animate_x_ratio)
 
 setYScaleFlag (bool animate_y_ratio)
 
- Public Member Functions inherited from BaseParticleRenderer
BaseParticleRenderer::ParticleRendererAlphaMode getAlphaMode ()
 
bool getIgnoreScale ()
 Returns the "ignore scale" flag.
 
GeomNode getRenderNode ()
 Query the geomnode pointer.
 
NodePath getRenderNodePath ()
 Query the geomnode pointer.
 
float getUserAlpha ()
 gets alpha for "user" alpha mode
 
 output (Ostream out)
 Write a string representation of this instance to <out>.
 
 setAlphaMode (BaseParticleRenderer::ParticleRendererAlphaMode am)
 
 setColorBlendMode (ColorBlendAttrib::Mode bm, ColorBlendAttrib::Operand oa, ColorBlendAttrib::Operand ob)
 sets the ColorBlendAttrib on the _render_node
 
 setIgnoreScale (bool ignore_scale)
 Sets the "ignore scale" flag.
 
 setUserAlpha (float ua)
 sets alpha for "user" alpha mode
 
 write (Ostream out, int indent)
 Write a string representation of this instance to <out>.
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count.
 
 ref ()
 Explicitly increments the reference count.
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus.
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
 
bool unref ()
 Explicitly decrements the reference count.
 

Additional Inherited Members

- Public Types inherited from BaseParticleRenderer
enum  ParticleRendererAlphaMode {
  PR_ALPHA_NONE = 0 , PR_ALPHA_OUT = 1 , PR_ALPHA_IN = 2 , PR_ALPHA_IN_OUT = 3 ,
  PR_ALPHA_USER = 4 , PR_NOT_INITIALIZED_YET = 5
}
 
enum  ParticleRendererBlendMethod { PP_NO_BLEND = 0 , PP_BLEND_LINEAR = 1 , PP_BLEND_CUBIC = 2 }
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count.
 

Detailed Description

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

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const SpriteParticleRenderer copy)

copy constructor

◆ __init__() [2/2]

__init__ ( Texture tex)

constructor

◆ addFromNode() [1/2]

addFromNode ( const NodePath 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() [2/2]

addFromNode ( const NodePath node_path,
str model,
str 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)

◆ addTexture()

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().

◆ getAlphaBlendMethod()

◆ getAlphaDisable()

bool getAlphaDisable ( )

◆ getAnim()

SpriteAnim getAnim ( const int n)

◆ getAnimAngleFlag()

bool getAnimAngleFlag ( )

◆ getAnimateFramesEnable()

bool getAnimateFramesEnable ( )

◆ getAnimateFramesIndex()

int getAnimateFramesIndex ( )

◆ getAnimateFramesRate()

float getAnimateFramesRate ( )

◆ getAnims()

list getAnims ( )

◆ getColor()

LColor getColor ( )

◆ getColorInterpolationManager()

ColorInterpolationManager getColorInterpolationManager ( )

◆ getFinalXScale()

float getFinalXScale ( )

◆ getFinalYScale()

float getFinalYScale ( )

◆ getHeight()

float getHeight ( )

Returns the height of each particle in world units.

◆ getInitialXScale()

float getInitialXScale ( )

◆ getInitialYScale()

float getInitialYScale ( )

◆ getLastAnim()

SpriteAnim getLastAnim ( )

◆ getLlUv() [1/2]

LTexCoord getLlUv ( )

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

◆ getLlUv() [2/2]

LTexCoord getLlUv ( const int anim,
const int frame )

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

◆ getNonanimatedTheta()

float getNonanimatedTheta ( )

◆ getNumAnims()

int getNumAnims ( )

◆ getTexture() [1/2]

Texture getTexture ( )

◆ getTexture() [2/2]

Texture getTexture ( const int anim,
const int frame )

◆ getUrUv() [1/2]

LTexCoord getUrUv ( )

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

◆ getUrUv() [2/2]

LTexCoord getUrUv ( const int anim,
const int frame )

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

◆ getWidth()

float getWidth ( )

Returns the width of each particle in world units.

◆ getXScaleFlag()

bool getXScaleFlag ( )

◆ getYScaleFlag()

bool getYScaleFlag ( )

◆ removeAnimation()

removeAnimation ( const int n)

Removes an animation texture set from the renderer.

◆ setAlphaBlendMethod()

◆ setAlphaDisable()

setAlphaDisable ( bool ad)

◆ setAnimAngleFlag()

setAnimAngleFlag ( bool animate_theta)

◆ setAnimateFramesEnable()

setAnimateFramesEnable ( bool an)

◆ setAnimateFramesIndex()

setAnimateFramesIndex ( int i)

◆ setAnimateFramesRate()

setAnimateFramesRate ( float r)

◆ setColor()

setColor ( const LColor color)

◆ setFinalXScale()

setFinalXScale ( float final_x_scale)

◆ setFinalYScale()

setFinalYScale ( float final_y_scale)

◆ setFromNode() [1/2]

setFromNode ( const NodePath 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() [2/2]

setFromNode ( const NodePath node_path,
str model,
str 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.

◆ setInitialXScale()

setInitialXScale ( float initial_x_scale)

◆ setInitialYScale()

setInitialYScale ( float initial_y_scale)

◆ setLlUv() [1/2]

setLlUv ( const LTexCoord 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.

◆ setLlUv() [2/2]

setLlUv ( const LTexCoord ll_uv,
const int anim,
const 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.

◆ setNonanimatedTheta()

setNonanimatedTheta ( float theta)

◆ setSize()

setSize ( float width,
float height )

Sets the size of each particle in world units.

◆ setTexture()

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.

◆ setUrUv() [1/2]

setUrUv ( const LTexCoord 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.

◆ setUrUv() [2/2]

setUrUv ( const LTexCoord ur_uv,
const int anim,
const 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.

◆ setXScaleFlag()

setXScaleFlag ( bool animate_x_ratio)

◆ setYScaleFlag()

setYScaleFlag ( bool animate_y_ratio)