Recast.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace ET
  4. {
  5. public static class Recast
  6. {
  7. #if UNITY_IPHONE && !UNITY_EDITOR
  8. const string RecastDLL = "__Internal";
  9. #else
  10. const string RecastDLL = "RecastDll";
  11. #endif
  12. public const int MAX_POLYS = 256;
  13. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  14. public static extern IntPtr RecastLoad(byte[] buffer, int n);
  15. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  16. public static extern void RecastClear(IntPtr navPtr);
  17. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  18. public static extern int RecastFind(IntPtr navPtr, float[] extents, float[] startPos, float[] endPos, float[] straightPath);
  19. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  20. public static extern int RecastFindNearestPoint(IntPtr navPtr, float[] extents, float[] pos, float[] nearestPos);
  21. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  22. public static extern int RecastFindRandomPointAroundCircle(IntPtr navPtr, float[] extents, float[] centerPos, float radius, float[] randomPos);
  23. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  24. public static extern int RecastFindRandomPoint(IntPtr navPtr, float[] randomPos);
  25. }
  26. }