More physics in Flint
Today, I added some key features for improving the physics in Flint. Primary among these is the addition of mass and radius properties to the particle class.
The mass property represents the mass of the particle. By default, particles have a mass of 1, meaning all behaviours remain unchanged unless you modify the particle's mass. The mass is used in the collide, friction, drag, bounding box and gravity actions.
The radius property represents the size of the particle when calculating collisions. In collisions, all particles are treated as circles (in 2D) or spheres (in 3D). The radius is used in the collide and bounding box actions.
In addition, the mass and radius are used to calculate the moment of inertia of the particle, which affects rotational friction and rotational drag.
To integrate the scaling into this, the Scale action and ScaleInit behaviours have been split into ScaleImage and ScaleAll actions and ScaleImageInit and ScaleAllInit initializers. The ScaleImage actions and initializers just alter the scale property of the particle (and hence the image size), while the ScaleAll actions and initializers alter the radius and mass as well.
I also added initializers and actions for modifying the mass and collision radius of the particle.
Finally, I updated the examples to work with these changes, and added an example that simulates brownian motion in both 2D and 3D.
Share this post or a comment online -
Also in the collection Flint Particles
- Flint AS3 Particle System
- Flint Particle System Tutorial
- Making fire with Flint
- Version 0.9.2 of Flint released
- Version 0.9.3 of Flint released
- Presentation about Flint in London
- LFPUG Presentation Slides
- Version 0.9.4 of Flint released
- Version 1.0.0 of Flint released
- Flocking behaviour in Flint
- Version 1.0.1 of Flint released
- Version 1.0.2 of Flint released
- Version 1.0.3 of Flint released
- Reorganised SVN for Flint
- Alpha of the 3D version of Flint is available
- After a couple of days relaxing
- Flint 3D plans
- Version 1.0.4 of Flint released
- 3D version of Flint Particle System
- Developer diary
- Away3D renderers for Flint started
- More Away3D and Papervision3D renderer development in Flint
- Improved Papervision3D rendering in Flint
- Papervision pixel renderer for Flint
- Flint does Papervision3D and Away3D
- More 3D Zones in Flint
- Updated Flint examples
- Version 2.0 beta of Flint released
- Performance improvements in Flint
- Version 2.0 of Flint released
- What's in development for Flint
- Version 2.0.1 of Flint released
- Build scripts and other changes to Flint
- Version 2.1.0 of Flint released
- Version 2.1.2 of Flint released
- Version 2.1.3 of Flint released
- Many additions to the Flint documentation
- Version 2.1.4 of Flint released
- Version 2.2.0 of Flint Released
- Flint on GitHub
- Version 2.2.1 of Flint released
- Version 3.0.0 beta of Flint
- Version 3.0.0 of Flint released
- Version 3.0.1 of Flint released
- Flint and Molehill
- Version 4.0.0 of Flint released
- Version 4.0.1 of Flint released