Files
Christopher Whitley 168d8fbc36 High-Performance Particle System Rewrite (#990)
* Refactor particle system

* Use correct alloc

* Use original ParticleIterator imlementation for zero allications.

* Move ParticleIterator to its own class instead of a nested class

* Mark nullable

* Add fallback mechanism for loading textures when it's an image file and not an xnb
2025-05-28 15:57:58 -04:00

36 lines
926 B
C#

using System;
using Microsoft.Xna.Framework;
using MonoGame.Extended.Particles.Profiles;
namespace MonoGame.Extended.Tests.Particles.Profiles
{
public class PointProfileTests
{
[Fact]
public unsafe void ReturnsZeroOffset()
{
PointProfile subject = new PointProfile();
Vector2 offset;
Vector2 heading;
subject.GetOffsetAndHeading(&offset, &heading);
Assert.Equal(0f, offset.X);
Assert.Equal(0f, offset.Y);
}
[Fact]
public unsafe void ReturnsHeadingAsUnitVector()
{
PointProfile subject = new PointProfile();
Vector2 offset;
Vector2 heading;
subject.GetOffsetAndHeading(&offset, &heading);
double length = Math.Sqrt(heading.X * heading.X + heading.Y * heading.Y);
Assert.Equal(1f, length, 6);
}
}
}