Version 1.0.4 released
This will be the final version on the 1.0.x branch. It incorporates a few minor changes that were already in the code repository. The next version released will be the first 3D version. New features and changes in this version are
- Added a Collide action that manages collisions between particles.
- Added bounce parameter to the Bounding Box action, to control the amount of bounce in the collisions.
- Fixed TurnTowardsMouse and TurnTowardsPoint actions to stop the particles oscillating when travelling approximately towards the target.
- Added maximumFrameTime property to Emitter to prevent the system jumping when outside influences pause the system (e.g. when resizing the browser window).
- Added conditional tests to Emitter to prevent errors when a renderer hasn’t been assigned to the Emitter.
- Altered Emitter and BitmapRenderer so that the particles array is in creation order, rather than reverse creation order, because this is more logical.
- Added run-time error to DiscZone and DiscSectorZone to check that the outerRadius is not smaller than the innerRadius.
Posted on 21 August 2008
3D plans
Because I had a lot of client work on, I haven’t done much work on Flint since April. That’s now changing since the large job I was working on is complete and I have some time to myself again. I thought I’d outline the plans for the next major version of Flint.
The next major version will do 3D particle systems as well as the 2D systems it currently does. There will be some architecture changes that will benefit the 2D version as well as the 3D version and then there’s a lot of work on implementing the 3D version. Much of this work is now done, and can be checked out from the three_d branch of the code repository.
2D changes
The main architectural change involves completely separating the renderer from the rest of the system. Making the emitter independent of its renderer allows a single renderer to display multiple emitters, and multiple renderers to display the same emitter.
I have also separated the update tick from the emitter so that developers can supply their own update tick if they want to (from systems like the GoEngine) and also can update the particle system at a different rate from the frame-rate. The current system, where Flint provides an update tick that matches the frame-rate, is still the default.
Both these changes are already checked in to the branch.
3D implementation
The 3D implementation involves converting the core system and the various behaviours to 3D. This is now almost complete - a few behaviours remain but these relate to the mouse position and I haven’t decided how, or if, to implement these (specifically how to relate the mouse’s 2D position to the 3D space). The code is checked in to the branch but still needs to be optimized for speed.
The 3D implementation also requires renderers. My goal is to have a set of stand-alone renderers, plus a set of renderers for each of the major 3D systems. The stand-alone renderers are part done - the current versions work but lack many desirable features. I’m working with the Away3D team on developing renderers for Away3D and hope to work with the Papervision and Sandy teams also. If I can’t get collaboration from them it will take a little longer to create renderers for these platforms since I’m not yet as familiar with them as I need to be to complete the work.
There are a couple of 3D examples checked in to the branch if you want to see it in action and have some code to start playing from.
And
Also, the documentation needs a lot of work.
So, that’s the plan. I hope to have this complete sometime in August, and may move it over to trunk before then if it’s stable and the 2D stuff in particular is thoroughly tested.
Finally, I’ll be talking about Flint at Flash on the Beach in September. If you’re available, come along. It’s the best Flash conference I’ve been to and I’m very pleased to be speaking there for the first time this year.
Posted on 15 July 2008
Reorganised SVN
I reorganised the SVN repository today. You may need to check-out the code all over again - sorry about that. It’s a minor change but the repository’s structure is more logical this way. I don’t anticipate altering it again so it seemed sensible to get this change out the way as soon as possible.
Posted on 23 June 2008
Alpha of the 3D version is available
I’ve added the alpha of the next version of Flint to the SVN code repository. You can check it out anonymously from
http://flint-particle-system.googlecode.com/svn/branches/three_d/
This version will support 3D particle systems in addition to 2D particle systems as supported by the current version.
The 2D content in this alpha should be stable and has some features not present in the current version 1.0.3 - specifically, it supports the display of multiple emitters within a single renderer and the display of a single emitter within multiple renderers.
The 3D content still needs a lot of work. It has a simple renderer, which I will be doing a lot more work on in the next few days, but needs renderers for the various 3D libraries that are out there. It doesn’t yet support rotation of the particles but I have converted most of the non-rotational effects in the 2D system to 3D. I hope to do frequent updates to this alpha in the coming weeks - it all depends on time. Feedback on the architecture and suggested features (including code) are very welcome.
Posted on 23 June 2008
Version 1.0.3 released
This version adds some minor enhancements
- KeyDownCounter - this new meta-counter causes an associated counter to only emit particles if a particular key is down.
- KeyDownAction - this new meta-action causes an associated action to only occur if a particular key is down.
- ZonedAction - this new meta-action causes an associated action to only affect particles that are within a particular zone.
- LinearReactangleZone - this new Zone is like the RectangleZone but the getLocation method returns a sequential set of locations within the zone rather than a random point.
- Palette maps - the Bitmap Emitter can now use a palette map to alter the color of the particles.
- removedFromEmitter() - this new method has been added to the Action, Initializer and Activity classes and is called when the behaviour is removed from the emitter.
- Protected methods - a number of methods and properties have been changed from private to protected, while others have been exposed via getter/setters.
- Optimizations - some general speed optimizations have been added to the library. These don’t affect the API.
Posted on 5 June 2008
Version 1.0.2 released
This version fixes a couple of minor bugs.
- When setting the dimensions of the canvas on a BitmapRenderer, it didn’t correctly remove the previous canvas, causing the dimensions of the renderer to appear wrong. This has been fixed.
- The Velocity and Position initializers didn’t always correctly reflect the rotation of the emitter. This has been fixed.
Also added, PositionAbsolute and RotationAbsolute initializers that are independent of the emitter’s location - they operate relative to the coordinate system of the particles.
Posted on 23 April 2008
Version 1.0.1 released
I uploaded version 1.0.1 this morning. The main change is to fix a limitation in the BitmapRenderer and PixelRenderer classes.
The BitmapRenderer and PixelRenderer create a canvas for drawing the particles in. In previous versions this canvas covered the stage. This has caused problems for some developers who want more flexibility over the size and placement of this canvas.
It makes sense for the generic BitmapRenderer to allow the developer to specify the size and position of this canvas, so that is what it now does. This requires a single parameter in the constructor for the BitmapRenderer. This parameter is a rectangle and specifies what region within the renderer (i.e. within the coordinate space of the particle system) where the canvas should be drawn. The same change has been made to the PixelRenderer.
The old behaviour, a canvas that covers the stage, now exists within two more specific classes - the FullStageBitmapRenderer and the FullStagePixelRenderer. Changing all references to BitmapRenderer and PixelRenderer to these new classes will enable any previous scripts to work as before.
Other minor changes - all renderers now have mouseEnabled and mouseChildren set to false by default, so that they don’t respond to mouse events and it is possible to click through renderers to buttons and other objects below. To enable mouse events, set one or both of these properties to true as required.
Posted on 14 April 2008
Flocking behaviour in particles
Among the new actions added in version 1.0 are three that cause interaction between particles. These are
ApproachNeighbours which causes nearby particles to move towards each other.
MinimumDistance which causes particles to keep a minimum distance between themselves.
MatchVelocity which causes particles to adjust their velocity to match the average of all near neighbours.
By combining these actions, we can create flocking behaviour, where particles approach each other, but not too close, and match the velocity of the particles around them. I’ve added an example to the examples section of the site.
Posted on 10 April 2008
Version 1.0.0 released
I uploaded version 1.0.0 this morning. This version features a number of additions and a couple of key structural changes.
The structural changes are
Changes to setCounter
The counter in the emitter is now a getter/setter so rather than
emitter.setCounter( someCounter );
you need
emitter.counter = someCounter
Changes to Rendering
The rendering has been moved out of the emittter into a separate set of classes. So rather than
var emitter:DisplayObjectEmitter = new DisplayObjectEmitter(); addChild( emitter );
You need
var emitter:Emitter = new Emitter(); var renderer:DisplayObjectRenderer = new DisplayObjectRenderer(); emitter.renderer = renderer; addChild( renderer );
This allows much greater flexibility over the renderers, which is particularly important when moving flint over to use in 3D environments, which is the next stage in the project.
All the examples on this site have been updated to reflect these changes. I’ll write about the new additions and add some examples to illustrate them over the next few days.
Posted on 7 April 2008
Version 0.9.4 released
Now in SVN and download. The core features haven’t changed but I have added a number of new behaviours.
- Access all properties in Actions, Initializers, Counters and Activities so they can be modified while the emitter is running.
- AlphaInit initializer sets the initial alpha value for all particles
- ImageClasses and SharedImages initializers set the particle image to one selected from a group, with weighting to adjust the selection
- MouseExplosion action pushes particles away from the mouse
- MouseGravity action pulls particles towards the mouse
- TurnAwayFromMouse action causes particles to turn away from the mouse
- GreyscaleZone uses a greyscale image to define a zone, with weighting based on the luminence of each pixel
- Pulse counter emits particles in regular bursts
- PerformanceAdjusted counter adjusts the rate of particle emission if the frame-rate drops
- TwoWay energyEasing functions have an energy peak half-way through the particle’s lifetime
Posted on 6 March 2008
