SdlDotNet.Particles
From SDL.NET
SdlDotNet.Particles is the official particle engine library for SDL.NET written by Rob Loach. It is a very powerful library capabible of manipulating a vaste amount of random particles in an easy fashion. Please refer to the Particles Example for a demonstration of the assembly in action. The core foundation of the particle engine is built around basic particles, particle manipulators, particle emitters and particle systems.
| Table of contents |
Particles
The particles are the actual objects rendered on screen. These can be anything as they around derived from the Particles class. The SdlDotNet.Particles namespace contains basic particle implementations such as ParticlePixel (using a pixel to represent the particle) and ParticleSprite (using a sprite to represent the particle). Here is a complete list of the official particle interpretations:
- BaseParticle - The base particle. If you plan on creating your own particle representation, you should derive from this class.
- ParticlePixel - A particle represented by a pixel.
- ParticleCircle - A circle is used to represent the particle.
- ParticleSprite - Any sprite can represent this particle.
- ParticleSurface - Uses a surfaces to render the particle.
Particle Manipulators
The particle manipulators change the particles in real time. They can change their velocity, their location, their look, anything about the particle. It all depends on how the class implements the IParticleManipulator interface. The SdlDotNet.Particles namespace has various interpretations of the IParticleManipulator including basic gravity, vortexes, boundries, etc. Here is the complete list:
- IParticleManipulator - The base manipulator interface.
- ParticleGravity - Pulls all particles in the given direction and speed.
- ParticleVortex - Pulls all particles to a common point.
- ParticleFriction - Slows down the speed of particles.
- ParticleBoundry - Keeps particles within a certain boundry.
Particle Emitters
Particles emitters give the ability to instantaniously create particles on the fly with randomness in thought. They are actually derived from the Particle class, which means that you can have the particle emitter manipulated by particle manipulators. They shoot out particles with randomized attributes between the set range. Since they are derived from BaseParticle, they have their own life and can die out when their life reaches 0. Setting the life to -1 will prevent the emitter from dying out.
Particle Systems
The systems are what put it all together. They take a collection of particles, and a collection of manipulators, mash it all together, and get a working particle simulation out of it. Although this process sounds rather complex, it is actually relatively simple as there are many helper methods and functions to ease the work load.
Conclusion
With the number of manipulators and abstractness of particles, one can almost create any type of particle system with this setup. Play around with the Particle Example and see what kind of systems you can get in place.
See Also
- Particles Example
- Tutorials
- View Source (http://svn.sourceforge.net/viewcvs.cgi/cs-sdl/trunk/SdlDotNet/examples/Particles/)

