// Copyright (c) Craftwork Games. All rights reserved. // Licensed under the MIT license. // See LICENSE file in the project root for full license information. using Microsoft.Xna.Framework; namespace MonoGame.Extended.Particles.Profiles; /// /// A profile that emits all particles from a single point with random headings. /// /// /// The is the simplest emission profile, where all particles originate exactly at the /// emitter position with no offset. Each particle is given a random heading in any direction, creating a radial /// dispersion pattern. /// public sealed class PointProfile : Profile { /// /// Computes the offset and heading for a new particle. /// /// A pointer to the Vector2 where the offset from the emitter position will be stored. /// A pointer to the Vector2 where the unit direction vector will be stored. /// /// The offset is always set to (0,0), meaning particles will spawn exactly at the emitter position. /// public override unsafe void GetOffsetAndHeading(Vector2* offset, Vector2* heading) { offset->X = 0.0f; offset->Y = 0.0f; FastRandom.Shared.NextUnitVector(heading); } }