Software
Particle Engine 2v1.3
A particle engine written in C++ with OpenGL, capable of 3D particle movement using genuine Newtonian equations.
About
This is the second incarnation of my particle engine. I have written it entirely from scratch and it contains a lot of new features:
- The emitters can now be larger than a single point meaning the particles can cover a larger area.
- The emitters can now emit point particles, square particles and textured particles. Point particles can be rendered much quicker meaning more of them can be displayed without slowing the program down too much.
- The engine now has gravity points, which are essentially point masses which can attract the particles towards them with gravity.
- The engine now has point charges which can attract or repel the particles with an electric field.
- The life of the particles is now based on time instead of how many frames have passed.
- The particles can now travel in 3D space (although a 2D mode is available).
- The engine uses real physics equations to calculate the motion of the particles such as 's=ut+1/2at^2' and 'F=GMm/r^2'.
The engine has been written using C++ with OpenGL and is available to download as a Windows dynamic library (*.dll) with header file (*.h) and import library (*.lib).
Dependencies
The library requires OpenGL (opengl32.lib). A program should be linked with opengl32.lib before it is linked with pe2lib.lib (Particle Engine 2 library).
About
The demo program for my Particle Engine 2 has been written in C++ with SDL and OpenGL. It shows several hundred point and textured particles being emitted by a 3D emitter and gravitationally attracted downwards by a point mass which has the same approximate mass as the Earth and is the same approximate distance below as the Earth's radius.
Keyboard Controls
- Press 'D' to activate and deactivate the emitter.
- Press 'V' to see vector lines for the velocity and acceleration of the particles.
- Press 'G' to see vector lines for the gravitational force acting on the particles.
- Press 'B' to activate and deactivate automatic burst mode (one burst of particles every 3/4 seconds).
- Press 'M' to activate and deactivate manual burst mode.
- Press 'N' when manual burst mode is active to create a burst of particles.
- Press 'U' to make the particles change colour.
- Press the escape key to quit the program.
Altering the Number of Particles Emitted
Following these steps will allow you to change the number of particles that the emitter in the program creates.
- Create a shortcut to the program (engine2demo.exe) if there isn't one already.
- Right click on the shortcut and click 'Properties'.
- At the end of the 'Target' text box, after the quotation mark, put a space and then the number of particles you want (e.g. 2000).
- Click 'OK' then double-click the shortcut to run the program.
Note: More particles means more CPU and RAM usage.
Library
- Textured particles may appear slightly squashed.
- When drawing a particle path line, the particles may change direction slightly, with a possible change in velocity.
- The particle path line will only display the average, initial direction for the particles.
- When, for example, there are a couple of hundred textured particles and a few thousand point particles being emitted by the same emitter, the textured particles may appear to be emitting in bursts.
- When a program is paused while emitting particles that change colour (when grabbing the window with the mouse, for example), the colours may change in an unexpected way.
- Emitters may emit one particle after being created.
- If automatic burst mode is activated when manual burst mode is active, the program will crash (and vice versa).
Demo Application
- If automatic burst mode is activated when manual burst mode is active, the program will crash (and vice versa).
Library
- 1.2
Bug Fixes
- Fixed a blending issue with textured particles.
- Trying to deactivate an emitter while it is releasing automatic bursts will now work.
- Fixed velocity and acceleration vector lines not displaying for textured particles.
- Automatic bursts are now improved somewhat.
- Turning off manual burst mode will now not cause an emission of loads of particles.
Features/Improvements
- You can now customise the amount of time it takes for particles to fade away.
- Particles now fade away after they die rather than before.
- Each particle now has its own end colour values.
- You can now customise the number of particles emitted in a burst when in automatic burst mode.
- Emitters can now emit more than one type of particle at a time.
- Particles can now have random colours.
- Point particles are now smooth (i.e. round instead of square).
- You can now change the size of point particles.
- Particles can now change colour more than once before they die.
- You can now customise the amount of time it takes for a particle to change colour.
- Particles can now have infinite life.
- Improved the ability to change the colour of the particles while the program is running.
- 1.1
- Added automatic burst mode.
- Added manual burst mode.
- Changed static library to dynamic library (DLL).
- Added 2D mode.
- Changed name of header file to 'pe2lib.h'.
- Particles can now be set to fade away when they die.
- 1.0
- Added charge points.
- Fixed an acceleration issue.
- Added a dev/debug mode for seeing particle vector lines.
- Added ability to create square, non-textured particles.
Demo Application
- 1.3 Removed particle path line. Removed framerate limiter. Changed icon. Changed emitter settings. Removed charge point. Moved gravity point. Now uses Particle Engine 2 1.2.
- 1.2 Added automatic and manual burst modes. Particles now fade away when they die. Now uses Particle Engine 2 1.1.
- 1.1 Added a charge point (left). Fixed an acceleration issue. Added ability to see particle vector lines. Increased default number of particles from 750 to 1000. Added ability to change the number of particles emitted with the program shortcut.
