public override void AffectParticles( ParticleSystem system, float timeElapsed )
{
float length = 0.0f;
foreach ( Particle p in system.Particles )
{
if ( _scope > Utility.UnitRandom() )
{
if ( !p.Direction.IsZeroLength )
{
if ( _keepVelocity )
{
length = p.Direction.Length;
}
p.Direction += new Vector3( Utility.RangeRandom( -_randomness, _randomness ) * timeElapsed,
Utility.RangeRandom( -_randomness, _randomness ) * timeElapsed,
Utility.RangeRandom( -_randomness, _randomness ) * timeElapsed );
if ( _keepVelocity )
{
p.Direction *= length / p.Direction.Length;
}
}
}
}
}