mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04:00
initial navmesh stuff
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DotNetZip">
|
||||
@@ -51,6 +52,7 @@
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
@@ -351,5 +351,32 @@ namespace FFXIVClassic.Common
|
||||
{
|
||||
return (value >> bits) | (value << (16 - bits));
|
||||
}
|
||||
|
||||
public static float Clamp(float val, float min, float max)
|
||||
{
|
||||
|
||||
return Math.Max(Math.Min(max, val), min);
|
||||
}
|
||||
|
||||
public static float Distance(float x, float y, float z, float x2, float y2, float z2)
|
||||
{
|
||||
if (x == x2 && y == y2 && z == z2)
|
||||
return 0.0f;
|
||||
|
||||
return (float)Math.Sqrt(DistanceSquared(x, y, z, x2, y2, z2));
|
||||
}
|
||||
|
||||
public static float DistanceSquared(float x, float y, float z, float x2, float y2, float z2)
|
||||
{
|
||||
if (x == x2 && y == y2 && z == z2)
|
||||
return 0.0f;
|
||||
|
||||
// todo: my maths is shit
|
||||
var dx = x - x2;
|
||||
var dy = y - y2;
|
||||
var dz = z - z2;
|
||||
|
||||
return dx * dx + dy * dy + dz * dz;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user