/// <summary> /// Finds the distance from the specified position to the nearest polygon wall (NavMesh Edge). /// </summary> /// <param name="start">The start.</param> /// <returns>System.Double.</returns> public double DistanceToWall(PositionT start) { try { if (start.X != 0 && start.Z != 0) { return(GetDistanceToWall(_mPNativeObject, start)); } return(0); } catch (Exception ex) { Console.WriteLine(ex.ToString()); return(0); } }
/// <summary> /// Gets the way points wrapper, used for returning Way-points from the DLL. /// </summary> /// <returns>An array of PositionT objects containing the current waypoints from DLL</returns> /// <exception cref="InvalidOperationException"></exception> private PositionT[] Get_WayPoints_Wrapper() { var numberOfElements = Get_WayPoints(_mPNativeObject, out var unmanagedPointerToVector); var sizeOfElement = Marshal.SizeOf(typeof(PositionT)); var returnArray = new PositionT[numberOfElements]; for (var x = 0; x < numberOfElements; x++) { var unmanagedPointerToVectorEntry = new IntPtr(unmanagedPointerToVector.ToInt32() + x * sizeOfElement); returnArray[x] = (PositionT)Marshal.PtrToStructure(unmanagedPointerToVectorEntry, typeof(PositionT)); } return(returnArray); }
private static extern bool InWater(IntPtr pFfxiNavClassObject, PositionT pos);
private static extern sbyte GetRotation(IntPtr pFfxiNavClassObject, PositionT start, PositionT end);
private static extern double GetDistanceToWall(IntPtr pFfxiNavClassObject, PositionT start);
private static extern bool FindRandomPath(IntPtr pFfxiNavClassObject, PositionT start, float maxRadius, sbyte maxTurns, bool useCustom);
private static extern void findPath(IntPtr pFfxiNavClassObject, PositionT start, PositionT end, bool useCustomNavMesh);
private static extern bool EnableNearestPoly(IntPtr pFfxiNavClassObject, PositionT pos, bool enable, bool useCustomMesh);
/// <summary> /// Determines whether [valid position on the mesh] [the specified start]. /// </summary> /// <param name="start">The start.</param> /// <param name="useCustom">always leave false if you are using meshes made with FFXINAV.dll or XIExporter, set true /// if meshes were built with obj's files from noesis <c> true </c> [use custom].</param> /// <returns><c> true </c> if [is valid position] [the specified start]; otherwise, <c> false </c>.</returns> public bool IsValidPosition(PositionT start, bool useCustom) { return(IsValidPosition(_mPNativeObject, start, useCustom)); }
/// <summary> /// Determines whether [is position in water] [the specified position]. /// </summary> /// <param name="position">The position.</param> /// <returns><c> true </c> if [is position in water] [the specified position]; otherwise, <c> false </c>.</returns> public bool IsPositionInWater(PositionT position) { return(InWater(_mPNativeObject, position)); }
/// <summary> /// Gets the Rotation between two points. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <returns>System.SByte.</returns> public sbyte Getrotation(PositionT start, PositionT end) { return(GetRotation(_mPNativeObject, start, end)); }
/// <summary> /// Finds a random path Looks for a random location on the NavMesh within the reach of /// specified location, then finds a path to that location. /// </summary> /// <param name="start">The start.</param> /// <param name="maxRadius">The maximum radius.</param> /// <param name="maxTurns">The maximum turns.</param> /// <param name="useCustom">always leave false if you are using meshes made with FFXINAV.dll or XIExporter, set true /// if meshes were built with obj's files from noesis <c> true </c> [use custom].</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public bool FindRandomPath(PositionT start, float maxRadius, sbyte maxTurns, bool useCustom) { return(FindRandomPath(_mPNativeObject, start, maxRadius, maxTurns, useCustom)); }
/// <summary> /// Finds the path to position. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <param name="useCustonNavMeshes">always leave false if you are using meshes made with FFXINAV.dll or XIExporter, set true /// if meshes were built with obj's files from noesis <c> true </c> [use custom].</param> public void FindPathToPosi(PositionT start, PositionT end, bool useCustonNavMeshes) { findPath(_mPNativeObject, start, end, useCustonNavMeshes); }
/// <summary> /// Finds the closest path. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <param name="useCustonNavMeshes">always leave false if you are using meshes made with FFXINAV.dll or XIExporter, set true /// if meshes were built with obj's files from noesis <c> true </c> [use custom].</param> public void FindClosestPath(PositionT start, PositionT end, bool useCustonNavMeshes) { FindClosestPath(_mPNativeObject, start, end, useCustonNavMeshes); }
/// <summary> /// Sets the user defined flags for the specified polygon. Enable/Disable nearest polygon. /// </summary> /// <param name="pos">The position.</param> /// <param name="enable">if set to <c> true </c> [enable].</param> /// <param name="useCustom">always leave false if you are using meshes made with FFXINAV.dll or XIExporter, set true /// if meshes were built with obj's files from noesis <c> true </c> [use custom].</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public bool EnableOrDisableNearestPoly(PositionT pos, bool enable, bool useCustom) { return(EnableNearestPoly(_mPNativeObject, pos, enable, useCustom)); }
private static extern bool IsValidPosition(IntPtr pFfxiNavClassObject, PositionT start, bool useCustom);
private static extern bool CanSeeDestination(IntPtr pFfxiNavClassObject, PositionT start, PositionT end);
/// <summary> /// Determines whether this instance [can see destination] the specified start. Raycast /// check between two points. /// </summary> /// <param name="start">The start.</param> /// <param name="end">The end.</param> /// <returns><c> true </c> if this instance [can see destination] the specified start; otherwise, <c> /// false </c> .</returns> public bool CanWeSeeDestination(PositionT start, PositionT end) { return(CanSeeDestination(_mPNativeObject, start, end)); }