summaryrefslogtreecommitdiff
path: root/modules/mono/glue
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2019-10-14 16:33:45 -0400
committerAaron Franke <arnfranke@yahoo.com>2019-10-14 16:46:54 -0400
commit86922ff70ba533b376a6680f965f542894e8c614 (patch)
treeb99bc39067ce17ec257ad44199becdc61b69d3c2 /modules/mono/glue
parent1fed266bf5452b30376db62495f4985f6975f2c1 (diff)
Make is_equal_approx separate for structures
This commit adds exposed behavior for C#
Diffstat (limited to 'modules/mono/glue')
-rw-r--r--modules/mono/glue/Managed/Files/AABB.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Basis.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Color.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Plane.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Quat.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Rect2.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Transform.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Transform2D.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Vector2.cs5
-rw-r--r--modules/mono/glue/Managed/Files/Vector3.cs5
10 files changed, 50 insertions, 0 deletions
diff --git a/modules/mono/glue/Managed/Files/AABB.cs b/modules/mono/glue/Managed/Files/AABB.cs
index 98a73382f4..6a4f785551 100644
--- a/modules/mono/glue/Managed/Files/AABB.cs
+++ b/modules/mono/glue/Managed/Files/AABB.cs
@@ -458,6 +458,11 @@ namespace Godot
return _position == other._position && _size == other._size;
}
+ public bool IsEqualApprox(AABB other)
+ {
+ return _position.IsEqualApprox(other._position) && _size.IsEqualApprox(other._size);
+ }
+
public override int GetHashCode()
{
return _position.GetHashCode() ^ _size.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Basis.cs b/modules/mono/glue/Managed/Files/Basis.cs
index 0eb76e9c63..c5e62b77c8 100644
--- a/modules/mono/glue/Managed/Files/Basis.cs
+++ b/modules/mono/glue/Managed/Files/Basis.cs
@@ -654,6 +654,11 @@ namespace Godot
return Row0.Equals(other.Row0) && Row1.Equals(other.Row1) && Row2.Equals(other.Row2);
}
+ public bool IsEqualApprox(Basis other)
+ {
+ return Row0.IsEqualApprox(other.Row0) && Row1.IsEqualApprox(other.Row1) && Row2.IsEqualApprox(other.Row2);
+ }
+
public override int GetHashCode()
{
return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Color.cs b/modules/mono/glue/Managed/Files/Color.cs
index 3a52a1a13b..f44634f4e5 100644
--- a/modules/mono/glue/Managed/Files/Color.cs
+++ b/modules/mono/glue/Managed/Files/Color.cs
@@ -664,6 +664,11 @@ namespace Godot
return Mathf.IsEqualApprox(r, other.r) && Mathf.IsEqualApprox(g, other.g) && Mathf.IsEqualApprox(b, other.b) && Mathf.IsEqualApprox(a, other.a);
}
+ public bool IsEqualApprox(Color other)
+ {
+ return Mathf.IsEqualApprox(r, other.r) && Mathf.IsEqualApprox(g, other.g) && Mathf.IsEqualApprox(b, other.b) && Mathf.IsEqualApprox(a, other.a);
+ }
+
public override int GetHashCode()
{
return r.GetHashCode() ^ g.GetHashCode() ^ b.GetHashCode() ^ a.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Plane.cs b/modules/mono/glue/Managed/Files/Plane.cs
index a13161d2e6..e7ad68ab49 100644
--- a/modules/mono/glue/Managed/Files/Plane.cs
+++ b/modules/mono/glue/Managed/Files/Plane.cs
@@ -206,6 +206,11 @@ namespace Godot
return _normal == other._normal && Mathf.IsEqualApprox(D, other.D);
}
+ public bool IsEqualApprox(Plane other)
+ {
+ return _normal.IsEqualApprox(other._normal) && Mathf.IsEqualApprox(D, other.D);
+ }
+
public override int GetHashCode()
{
return _normal.GetHashCode() ^ D.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Quat.cs b/modules/mono/glue/Managed/Files/Quat.cs
index 845c7c730e..52f0305b16 100644
--- a/modules/mono/glue/Managed/Files/Quat.cs
+++ b/modules/mono/glue/Managed/Files/Quat.cs
@@ -366,6 +366,11 @@ namespace Godot
return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z) && Mathf.IsEqualApprox(w, other.w);
}
+ public bool IsEqualApprox(Quat other)
+ {
+ return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z) && Mathf.IsEqualApprox(w, other.w);
+ }
+
public override int GetHashCode()
{
return y.GetHashCode() ^ x.GetHashCode() ^ z.GetHashCode() ^ w.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Rect2.cs b/modules/mono/glue/Managed/Files/Rect2.cs
index 99542d0c0a..91e614dc7b 100644
--- a/modules/mono/glue/Managed/Files/Rect2.cs
+++ b/modules/mono/glue/Managed/Files/Rect2.cs
@@ -231,6 +231,11 @@ namespace Godot
return _position.Equals(other._position) && _size.Equals(other._size);
}
+ public bool IsEqualApprox(Rect2 other)
+ {
+ return _position.IsEqualApprox(other._position) && _size.IsEqualApprox(other.Size);
+ }
+
public override int GetHashCode()
{
return _position.GetHashCode() ^ _size.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Transform.cs b/modules/mono/glue/Managed/Files/Transform.cs
index cc4d26158d..0b84050f07 100644
--- a/modules/mono/glue/Managed/Files/Transform.cs
+++ b/modules/mono/glue/Managed/Files/Transform.cs
@@ -185,6 +185,11 @@ namespace Godot
return basis.Equals(other.basis) && origin.Equals(other.origin);
}
+ public bool IsEqualApprox(Transform other)
+ {
+ return basis.IsEqualApprox(other.basis) && origin.IsEqualApprox(other.origin);
+ }
+
public override int GetHashCode()
{
return basis.GetHashCode() ^ origin.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Transform2D.cs b/modules/mono/glue/Managed/Files/Transform2D.cs
index 814332dc07..77ea3e5830 100644
--- a/modules/mono/glue/Managed/Files/Transform2D.cs
+++ b/modules/mono/glue/Managed/Files/Transform2D.cs
@@ -357,6 +357,11 @@ namespace Godot
return x.Equals(other.x) && y.Equals(other.y) && origin.Equals(other.origin);
}
+ public bool IsEqualApprox(Transform2D other)
+ {
+ return x.IsEqualApprox(other.x) && y.IsEqualApprox(other.y) && origin.IsEqualApprox(other.origin);
+ }
+
public override int GetHashCode()
{
return x.GetHashCode() ^ y.GetHashCode() ^ origin.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Vector2.cs b/modules/mono/glue/Managed/Files/Vector2.cs
index 0daa94057e..70d6cd382a 100644
--- a/modules/mono/glue/Managed/Files/Vector2.cs
+++ b/modules/mono/glue/Managed/Files/Vector2.cs
@@ -458,6 +458,11 @@ namespace Godot
return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y);
}
+ public bool IsEqualApprox(Vector2 other)
+ {
+ return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y);
+ }
+
public override int GetHashCode()
{
return y.GetHashCode() ^ x.GetHashCode();
diff --git a/modules/mono/glue/Managed/Files/Vector3.cs b/modules/mono/glue/Managed/Files/Vector3.cs
index 9076dbd3b0..7b1080c266 100644
--- a/modules/mono/glue/Managed/Files/Vector3.cs
+++ b/modules/mono/glue/Managed/Files/Vector3.cs
@@ -516,6 +516,11 @@ namespace Godot
return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z);
}
+ public bool IsEqualApprox(Vector3 other)
+ {
+ return Mathf.IsEqualApprox(x, other.x) && Mathf.IsEqualApprox(y, other.y) && Mathf.IsEqualApprox(z, other.z);
+ }
+
public override int GetHashCode()
{
return y.GetHashCode() ^ x.GetHashCode() ^ z.GetHashCode();