mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 14:38:34 +01:00
added vector flooring
This commit is contained in:
parent
f1dc81ae36
commit
4cb2285c43
1 changed files with 12 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
|
||||||
namespace MLEM.Extensions {
|
namespace MLEM.Extensions {
|
||||||
public static class NumberExtensions {
|
public static class NumberExtensions {
|
||||||
|
@ -11,6 +12,17 @@ namespace MLEM.Extensions {
|
||||||
return (int) Math.Ceiling(f);
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue