Truncate Vector2 : Vector « Development Class « C# / C Sharp
- C# / C Sharp
- Development Class
- Vector
Truncate Vector2
using Microsoft.Xna.Framework;
namespace Core
{
public class Vector2Utilities
{
public static void Truncate(Vector2 original, float max)
{
if (original.Length() > max)
{
original.Normalize();
original *= max;
}
}
}
}
Related examples in the same category