mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 01:09:23 +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 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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue