RcVec2f, 3f, string ToString

This commit is contained in:
ikpil 2023-06-13 14:53:51 +09:00
parent ca51085826
commit b1941432aa
2 changed files with 15 additions and 0 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.Runtime.CompilerServices;
namespace DotRecast.Core
{
@ -28,6 +29,7 @@ namespace DotRecast.Core
return Equals((RcVec2f)obj);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(RcVec2f other)
{
return x.Equals(other.x) &&
@ -41,14 +43,21 @@ namespace DotRecast.Core
return hash;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(RcVec2f left, RcVec2f right)
{
return left.Equals(right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(RcVec2f left, RcVec2f right)
{
return !left.Equals(right);
}
public override string ToString()
{
return $"{x}, {y}";
}
}
}

View File

@ -193,6 +193,7 @@ namespace DotRecast.Core
return Equals((RcVec3f)obj);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(RcVec3f other)
{
return x.Equals(other.x) &&
@ -256,6 +257,11 @@ namespace DotRecast.Core
z = Math.Max(z, @in[i + 2]);
}
public override string ToString()
{
return $"{x}, {y}, {z}";
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(RcVec3f left, RcVec3f right)
{