mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-21 17:59:31 +00:00
168d8fbc36
* 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
36 lines
926 B
C#
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);
|
|
}
|
|
}
|
|
}
|