Hello,
let me introduce to you my particle engine library. This is not really an SFML project but more a libray dependent free project written in C++. However I have just implemented a module for SFML (there is also a module for openGL and one for direct3D is coming) :
DESCRIPTIONSPARK is an opensource particle engine on CPU side written in C++. It was designed to be portable, configurable, evolving, and simple to use. Domains of applications of the library are mainly the rendering of 2D and 3D effect based on particles but it can also be used for slight simulation of numerous physical entities.
FEATURES- Several types of parameters for particles :
- position
- velocity
- lifetime
- color RGBA
- size
- weight
- rotation
- user customizable parameters
- parameters evolution, random generation
- Easy particle management within groups
- Gravity and friction
- Particle sorting
- Physics engine particles vs environment
- callback system for particle birth, update and death
- bounding box for groups and systems
- automatized evolution once configured
- rendering independent from computation
- Modifiers to modify particles' behavior in the universe
- abstract classes insuring system evolutivity :
- Emitters
- Modifiers
- Zones
- Renderers
[/list]
This version contains a set of emitters, modifiers, zones and renderers that will increase in the future :
- Zones :
- Sphere
- Axis Aligned bounded box
- Plane
- Point
- Line
- Emitters :
- straight emitter (along a vector)
- spheric emitter (a portion of sphere)
- Modifiers
- Obstacle : to stop particles and have them bounce
- Destructors : to destroy particles
- point mass : attract or repulse particles
- Renderers
- openGL
- Points : points, circles or point sprites
- Lines
- Quads : billboads orientated camera, direction or arbitrary axis
- SFML
- Points : points, circles or point sprites
- Lines
- Quads
- sf::Drawables (sprites,shapes,postFX,strings...)
[/list][/list]
DOC AND TUTOSSPARK documentation is available online
here. You can also dowload it.
There is no real tutorials but a bunch of examples applications well commentated. There is a demo dedicated to SFML.
RESOURCE 1.01.01THE SFML MODULEI will speak a bit more of the SFML module as this is the SFML forum. It allows to easily implement particle systems with the SFML 2D engine. A class SFMLSystem extends sf::Drawable and a lot of SFML renderers exist to render particles in different ways.
An implementation example is furnished (SFML Demo). It illustrates how to implement a particle system in SFML with SPARK. It is some fires on a tile map. The user can add/remove fires on tile and move/zoom on the map.
commands are :
- F1 : changes the display of text
- F2 : displays or not the grid
- F3 : displays or not the BG
- F4 : pauses the particle systems
- F5 : destroys all particle systems
- space : activate/descativate smoke generation
- Supp : reinit the particle systems
- Esc : quits the app
- left click on an empty tile : adds a fire
- left click on an occupied tile : removes the fire
- mouse wheel : zoom
- mouse on the borders : smoves on the map
The licence of SPARK is the lgpl so it is very permissive.
For more info (in french unfortunately) and screenshots see
here.
Any comments, suggestions, questions are welcome