©2004,2008 Jim E. Brooks http://www.palomino3d.org
[2008/08]
The fx module provides graphical objects such as Sprite, Texture, ParticleSystem. The FX class contains and makes special-effects (explosions, smoke, etc). FX::Reset() stops special-effects.
Facade classes are used for many graphics primitives. These lessen dependence on a graphics system, can overcome its limitations, and are more convenient to use. For example, the Sprite class hides an osg::AutoTransform and automatically constructs its nodes.
[2008/02]
The FX class is a container of special-effects objects. Reasons for the FX container are: some FX objects cannot be attached to the scene-graph, a container simplifies destroying all FX objects when program is reset, and particles may out-live the Object that originally spawned them (missile trail can persist after the missile).
Special-effect objects, such as ParticleSystemFX, schedule their deletion with FX, thus turning into zombies, which FX::Tick() destroys.
Source files with the prefix fx_ are private implementations of the FX class.
[2008/02]
ParticleSystemParticleSystemFX
ExplosionParticleSystemFX
SmokeTrailParticleSystemFX
ParticleSystem class is a container of Particles. ParticleSystem registers a timer-tick functor, then ages and animates every particle. New Particles can be dynamically added (expanding smoke trail, explosions). ParticleSystem will destroy Particles past their lifetime.
Particle is derived from the Sprite class. Particle::Tick() is a virtual method, called by ParticleSystem, for doing animation such as altering color, alpha, position, etc.
Custom particle systems can be made by making derivatives
of both ParticleSystem and Particle then overriding both of their Tick() methods.
DerivedParticleSystem::Tick() would add more particles.
DerivedParticle::Tick() would animate an individual particle.
[2008/02]
This derivative is meant to be contained by the FX container. ParticleSystemFX itself has lifetime, and when it expires, it schedules its deletion with the FX container.
[2008/10]
The ParticleSystem classes are private implementations of the FX class. FX shall provide interface methods such as FX::MakeExplosion(). Behind-the-scenes, FX:MakeExplosion() calls "new ExplosionParticleSystemFX" and contains it.
ParticleSystem is a generalized base class which doesn't stand-alone. Its derivative ParticleSystemFX remains generalized and is meant to be contained by FX. ParticleSystemFX has an expiry/lifetime (as Particles have). Specialized derivatives that render explosions, smoke, etc, should derive from ParticleSystemFX. Then, the FX class should be extended with a new method to instantiate it.
[2008/08]
A sprite is 2D textured quad in 3D space aligned to the viewplane. The Sprite class hides an osg::AutoTransform and automatically constructs its nodes.
See Commodore 64 Programmer's Reference Guide.
[2008/02]
The Texture class abstracts a texture image file and/or a texture object. Texture ctor uses ImageCache to cache texture images.
[2008/02]
Caches 2D image files. Used by Texture class.
Last modified: Sat Nov 1 13:33:53 EDT 2008