private void Release(Vector 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.NextColour(out particle->Colour, Parameters.Colour); particle->Opacity = FastRand.NextSingle(Parameters.Opacity); var scale = FastRand.NextSingle(Parameters.Scale); particle->Scale = new Vector(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); } }