feat: TransformExtensions.TransformVector2D

This commit is contained in:
Syntriax 2024-01-24 12:23:43 +03:00
parent 87bf47eefd
commit b3d404bb6b
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
namespace Syntriax.Engine.Core.Abstract;
public static class TransformExtensions
{
public static Vector2D TransformVector2D(this ITransform transform, Vector2D vector)
=> vector.Scale(transform.Scale)
.Rotate(transform.Rotation * Math.DegreeToRadian)
.Add(transform.Position);
}