summaryrefslogtreecommitdiff
path: root/modules/mono/glue/cs_files
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/glue/cs_files')
-rw-r--r--modules/mono/glue/cs_files/Basis.cs12
-rw-r--r--modules/mono/glue/cs_files/Mathf.cs12
2 files changed, 18 insertions, 6 deletions
diff --git a/modules/mono/glue/cs_files/Basis.cs b/modules/mono/glue/cs_files/Basis.cs
index 89b3e94c35..2e7e5404c4 100644
--- a/modules/mono/glue/cs_files/Basis.cs
+++ b/modules/mono/glue/cs_files/Basis.cs
@@ -49,20 +49,20 @@ namespace Godot
public Vector3 x
{
- get => GetAxis(0);
- set => SetAxis(0, value);
+ get { return GetAxis(0); }
+ set { SetAxis(0, value); }
}
public Vector3 y
{
- get => GetAxis(1);
- set => SetAxis(1, value);
+ get { return GetAxis(1); }
+ set { SetAxis(1, value); }
}
public Vector3 z
{
- get => GetAxis(2);
- set => SetAxis(2, value);
+ get { return GetAxis(2); }
+ set { SetAxis(2, value); }
}
private Vector3 _x;
diff --git a/modules/mono/glue/cs_files/Mathf.cs b/modules/mono/glue/cs_files/Mathf.cs
index 8b9c264d0d..adbcc855ef 100644
--- a/modules/mono/glue/cs_files/Mathf.cs
+++ b/modules/mono/glue/cs_files/Mathf.cs
@@ -257,5 +257,17 @@ namespace Godot
{
return (real_t)Math.Tanh(s);
}
+
+ public static int Wrap(int val, int min, int max)
+ {
+ int rng = max - min;
+ return min + ((((val - min) % rng) + rng) % rng);
+ }
+
+ public static real_t Wrap(real_t val, real_t min, real_t max)
+ {
+ real_t rng = max - min;
+ return min + (val - min) - (rng * Floor((val - min) / rng));
+ }
}
}