Add ScaleFactor to math, since some trap locations are too close to others
This commit is contained in:
parent
136774eb71
commit
ba6cc767d9
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<Version>2.5</Version>
|
||||
<Version>2.6</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -4,13 +4,18 @@ namespace Pal.Common
|
||||
{
|
||||
public class PalaceMath
|
||||
{
|
||||
private static readonly Vector3 ScaleFactor = new Vector3(5);
|
||||
|
||||
public static bool IsNearlySamePosition(Vector3 a, Vector3 b)
|
||||
{
|
||||
a *= ScaleFactor;
|
||||
b *= ScaleFactor;
|
||||
return (int)a.X == (int)b.X && (int)a.Y == (int)b.Y && (int)a.Z == (int)b.Z;
|
||||
}
|
||||
|
||||
public static int GetHashCode(Vector3 v)
|
||||
{
|
||||
v *= ScaleFactor;
|
||||
return HashCode.Combine((int)v.X, (int)v.Y, (int)v.Z);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user