1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-15 05:38:46 +02:00

added vector flooring

This commit is contained in:
Ellpeck 2019-08-07 00:45:40 +02:00
parent f1dc81ae36
commit 4cb2285c43

View file

@ -1,4 +1,5 @@
using System;
using Microsoft.Xna.Framework;
namespace MLEM.Extensions {
public static class NumberExtensions {
@ -11,6 +12,17 @@ namespace MLEM.Extensions {
return (int) Math.Ceiling(f);
}
public static Vector2 Floor(this Vector2 vec) {
return new Vector2(vec.X.Floor(), vec.Y.Floor());
}
public static Vector3 Floor(this Vector3 vec) {
return new Vector3(vec.X.Floor(), vec.Y.Floor(), vec.Z.Floor());
}
public static Vector4 Floor(this Vector4 vec) {
return new Vector4(vec.X.Floor(), vec.Y.Floor(), vec.Z.Floor(), vec.W.Floor());
}
}
}