private void Release(Vector2 position, int numToRelease) { var iterator = Buffer.Release(numToRelease); while (iterator.HasNext) { var particle = iterator.Next(); Axis heading; Profile.GetOffsetAndHeading(out particle->Position, out heading); particle->Age = 0f; particle->Inception = _totalSeconds; particle->Position += position; particle->TriggerPos = position; var speed = FastRand.NextSingle(Parameters.Speed); particle->Velocity = heading * speed; FastRand.NextColor(out particle->Color, Parameters.Color); particle->Opacity = FastRand.NextSingle(Parameters.Opacity); var scale = FastRand.NextSingle(Parameters.Scale); particle->Scale = new Vector2(scale, scale); particle->Rotation = FastRand.NextSingle(Parameters.Rotation); particle->Mass = FastRand.NextSingle(Parameters.Mass); } }
public void Trigger(LineSegment line) { var numToRelease = FastRand.NextInteger(Parameters.Quantity); var lineVector = line.ToVector(); for (var i = 0; i < numToRelease; i++) { var offset = lineVector * FastRand.NextSingle(); Release(line.Origin + offset, 1); } }
public void Trigger(Vector2 position) { var numToRelease = FastRand.NextInteger(Parameters.Quantity); Release(position + Offset, numToRelease); }