Particle system animation node. More...
#include <FXViz/nodes/SoParticleAnimation.h>
Base class for particle system animation. Particle system animation is used for generating real-time effects such as fire, chemical flame, explosions, fluid motion, smoke, snow, etc.
A particle system is a set of particles (numParticles) where each particle is defined by the following properties:
All of these properties may fluctuate randomly for each particle within a specified range of values (initialColorVariation, initialOpacityVariation, endColorVariation, lifeSpanVariation...).
Each particle emitted from a predefined shape (emitShapeType) evolves from an initial appearance to a final appearance with a given speed and a life span in real time.
Billboard particles can be textured (particleFilename, particleTexture) to produce interesting realistic effects.
Like classical Open Inventor shapes, each particle is transformed by the current cumulative transformation and is drawn with the current lighting model and drawing style.
Classes derived from SoParticleAnimation have default field values pre-set for conveniently generating specific effects. For example, SoParticleSmoke has predefined field values for generating smoke effects.
Note: By default, particle animation uses transparency type ADD (see transparencyType). Against a white background, particles will not be visible because with this transparency type, colors are added until full saturation is reached. Since white is already fully saturated, no additional visual effect is seen. In this case, use BLEND transparency type instead and change the particle texture from the default (a circular gradient that is gray in the middle and black on the edges) to one that is gray in the middle and white on the edges. For additional realism, you can add transparency to the texture, with zero transparency in the middle increasing linearly to full transparency on the edges.
numParticles | 1000 |
numParticlesVariation | 0.5 |
initialColor | 1 1 1 |
initialColorVariation | 0 0 0 |
initialOpacity | 0.8 |
initialOpacityVariation | 0.1 |
initialSize | 0.7 |
initialSizeVariation | 0.0 |
endColor | 0 0 0 |
endColorVariation | 0 0 0 |
endOpacity | 0.8 |
endOpacityVariation | 0.1 |
endSize | 0.01 |
endSizeVariation | 0.0 |
lifeSpan | 4000 |
lifeSpanVariation | 0.5 |
particleShape | BILLBOARD_SHAPE |
emitShapeType | POINT |
shapeScale | 1 1 1 |
dispersionAngles | 0.01 0.01 |
particleLife | CYCLIC_EMISSION |
speed | 1 |
speedVariation | 0.1 |
particleFilename | "" |
particleTexture | 32 32 ....(white circle on a black background texture ) |
goalFramesPerSecond | 0 |
transparencyType | ADD |
on | TRUE |
SoFXViz, SoParticleChemicalFlame, SoParticleExplosion, SoParticleFlame, SoParticleLightRay, SoParticleSmoke, SoParticleSnow.
Predefined shapes from which particles are emitted.
Type of transparency used by particle.
ADD |
Additive alpha blending. |
BLEND |
Multiplicative alpha blending. |
INHERITED |
Inherited alpha blending defined by SoGLRenderAction::setTransparencyType(). |
SoParticleAnimation::SoParticleAnimation | ( | ) |
Constructor.
static SoType SoParticleAnimation::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoShape.
virtual SoType SoParticleAnimation::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoShape.
Defines two angles (specified in radians) within which particles are randomly emitted.
yaw = dispersionAngles[0] and pitch = dispersionAngles[1]. yaw is an angle measured from y-axis and around the x-axis. pitch is an angle measured from the z-axis and around the y-axis. These two angles are ignored for all solid emitter shapes (SoParticleAnimation::SPHERE, SoParticleAnimation::CYLINDER).
Specifies a predefined shape from which particles are emitted.
Particles are transformed by the current cumulative transformation. Particles can be uniformly emitted from:
Final particle color.
Controls magnitude of random variation in the final particle color.
End Color = endColor + (endColor * endColorVariation * RF) with -1 <= RF <= 1.
Final particle opacity: 0 = fully transparent, 1 = opaque.
Controls magnitude of random variation in the final particle opacity.
End Opacity = endOpacity + (endOpacity * endOpacityVariation * RF) with -1 <= RF <= 1.
Final particle size in world coordinates.
Controls magnitude of random variation in the final particle size.
End Size = endSize + (endSize * endSizeVariation * RF) with -1 <= RF <= 1.
Indicates the goal number of frames per second for refreshing the particles.
Setting the value to 0 requests that particles be refreshed as often as possible.
NOTE: field available since Open Inventor 4.0Initial particle color.
Controls magnitude of random variation in the initial particle color.
Initial Color = initialColor + (initialColor * initialColorVariation * RF) with -1 <= RF <= 1.
Initial particle opacity: 0 is fully transparent, 1 is opaque.
Controls magnitude of random variation in the initial particle opacity.
Initial Opacity = initialOpacity + (initialOpacity * initialOpacityVariation * RF) with -1 <= RF <= 1.
Initial particle size in world coordinates.
Controls magnitude of random variation in the initial particle size.
Initial Size = initialSize + (initialSize * initialSizeVariation * RF) with -1 <= RF <= 1.
Particle life span in milliseconds.
Controls magnitude of random variation in the particle life span.
Life span = lifeSpan + (lifeSpan * lifeSpanVariation * RF) with -1 <= RF <= 1.
Number of emitted particles.
Controls magnitude of random variation in the number of emitted particles.
Emitted particles = numParticles + (numParticles * numParticlesVariation * RF) with -1 <= RF <= 1
Activates/deactivates the particle system.
Specifies the name of the file containing the texture to be applied to the particles.
As soon as the texture in the file is loaded, the field particleTexture is updated. The standard image file formats are supported. See SoRasterImageRW for the list. If the filename is not an absolute path name, the list of directories maintained by SoInput is searched. If the texture is not found in any of those directories, then the file is searched for relative to the directory from which the SoParticleAnimation node was read.
Specifies if particles are emitted one time (SoParticleAnimation::ONE_EMISSION) or cyclically (SoParticleAnimation::CYCLIC_EMISSION).
If one-time emission is selected, particles are emitted when the field trigger is set.
Specifies the shape of the particles.
Only SoParticleAnimation::BILLBOARD_SHAPE shapes are textured.
Specifies an in-memory texture used for particles.
It can be the contents of the file read from particleFilename, an image read directly from an Open Inventor file, or an image defined programmatically using the methods provided by SoSFImage. The default texture is a circular gradient, with gray in the middle and black on the edges. It contains no alpha values.
Specifies a nonuniform scale factor applied to the predefined shape from which particles are emitted.
Not used if emitShapeType == SoParticleAnimation::POINT.
Specifies the particle speed in units per second.
Controls magnitude of random variation in the particle speed.
Particle Speed = speed + (speed * speedVariation * RF) with -1 <= RF <= 1.
Transparency type used for drawing particles.
Has two meanings depending on the value of particleLife:.