MoonTools.Bonk/Bonk/Vector2Extensions.cs

18 lines
481 B
C#
Raw Normal View History

2019-10-25 10:46:47 +00:00
using Microsoft.Xna.Framework;
namespace MoonTools.Core.Bonk.Extensions
{
2019-10-25 19:42:39 +00:00
internal static class Vector2Extensions
2019-10-25 10:46:47 +00:00
{
2019-10-25 19:42:39 +00:00
internal static Vector2 Cross(this Vector2 a, Vector2 b)
2019-10-25 10:46:47 +00:00
{
var vec3 = Vector3.Cross(new Vector3(a.X, a.Y, 0), new Vector3(b.X, b.Y, 0));
return new Vector2(vec3.X, vec3.Y);
}
2019-10-25 19:42:39 +00:00
internal static Vector2 Perpendicular(this Vector2 v)
2019-10-25 10:46:47 +00:00
{
return new Vector2(v.Y, -v.X);
}
}
}