-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Required are nav files which can be generated by uthgard-opensource/builnav
- Loading branch information
Showing
38 changed files
with
10,779 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ | |
/old/build | ||
/old/Debug | ||
/old/Release | ||
/Pathing/Detour/build | ||
**/*.csproj.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Numerics; | ||
|
||
namespace DOL.GS | ||
{ | ||
static class Extensions | ||
{ | ||
public static bool IsInRange(this Vector3 value, Vector3 target, float range) | ||
{ | ||
// SH: Removed Z checks when one of the two Z values is zero(on ground) | ||
if (value.Z == 0 || target.Z == 0) | ||
return Vector2.DistanceSquared(value.ToVector2(), target.ToVector2()) <= range * range; | ||
return Vector3.DistanceSquared(value, target) <= range * range; | ||
} | ||
|
||
public static Vector2 ToVector2(this Vector3 value) | ||
{ | ||
return new Vector2(value.X, value.Y); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System.Numerics; | ||
using System.Threading.Tasks; | ||
|
||
namespace DOL.GS | ||
{ | ||
public interface IPathingMgr | ||
{ | ||
/// <summary> | ||
/// Initializes the PathingMgr by loading all available navmeshes | ||
/// </summary> | ||
/// <returns></returns> | ||
bool Init(); | ||
|
||
/// <summary> | ||
/// Stops the PathingMgr and releases all loaded navmeshes | ||
/// </summary> | ||
void Stop(); | ||
|
||
/// <summary> | ||
/// Returns a path that prevents collisions with the navmesh, but floats freely otherwise | ||
/// </summary> | ||
/// <param name="zone"></param> | ||
/// <param name="start">Start in GlobalXYZ</param> | ||
/// <param name="end">End in GlobalXYZ</param> | ||
/// <returns></returns> | ||
WrappedPathingResult GetPathStraightAsync(Zone zone, Vector3 start, Vector3 end); | ||
|
||
/// <summary> | ||
/// Returns a random point on the navmesh around the given position | ||
/// </summary> | ||
/// <param name="zone">Zone</param> | ||
/// <param name="position">Start in GlobalXYZ</param> | ||
/// <param name="radius">End in GlobalXYZ</param> | ||
/// <returns>null if no point found, Vector3 with point otherwise</returns> | ||
Vector3? GetRandomPointAsync(Zone zone, Vector3 position, float radius); | ||
|
||
/// <summary> | ||
/// Returns the closest point on the navmesh, if available, or no point found. | ||
/// Returns the input position if no navmesh is available | ||
/// </summary> | ||
Vector3? GetClosestPointAsync(Zone zone, Vector3 position, float xRange = 256f, float yRange = 256f, float zRange = 256f); | ||
|
||
/// <summary> | ||
/// True if pathing is enabled for the specified zone | ||
/// </summary> | ||
/// <param name="zone"></param> | ||
/// <returns></returns> | ||
bool HasNavmesh(Zone zone); | ||
|
||
/// <summary> | ||
/// True if currently running & working | ||
/// </summary> | ||
bool IsAvailable { get; } | ||
} | ||
} |
Oops, something went wrong.