示例#1
0
 /// <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);
     }
 }
示例#2
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);
        }
示例#3
0
 private static extern bool InWater(IntPtr pFfxiNavClassObject, PositionT pos);
示例#4
0
 private static extern sbyte GetRotation(IntPtr pFfxiNavClassObject, PositionT start, PositionT end);
示例#5
0
 private static extern double GetDistanceToWall(IntPtr pFfxiNavClassObject, PositionT start);
示例#6
0
 private static extern bool FindRandomPath(IntPtr pFfxiNavClassObject, PositionT start, float maxRadius,
                                           sbyte maxTurns, bool useCustom);
示例#7
0
 private static extern void findPath(IntPtr pFfxiNavClassObject, PositionT start, PositionT end,
                                     bool useCustomNavMesh);
示例#8
0
 private static extern bool EnableNearestPoly(IntPtr pFfxiNavClassObject, PositionT pos, bool enable,
                                              bool useCustomMesh);
示例#9
0
 /// <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));
 }
示例#10
0
 /// <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));
 }
示例#11
0
 /// <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));
 }
示例#12
0
 /// <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));
 }
示例#13
0
 /// <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);
 }
示例#14
0
 /// <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);
 }
示例#15
0
 /// <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));
 }
示例#16
0
 private static extern bool IsValidPosition(IntPtr pFfxiNavClassObject, PositionT start, bool useCustom);
示例#17
0
 private static extern bool CanSeeDestination(IntPtr pFfxiNavClassObject, PositionT start, PositionT end);
示例#18
0
 /// <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));
 }