Recast.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  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(int id, byte[] buffer, int n);
  15. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  16. public static extern IntPtr RecastGet(int id);
  17. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  18. public static extern void RecastClear();
  19. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  20. public static extern int RecastFind(IntPtr navPtr, float[] extents, float[] startPos, float[] endPos, float[] straightPath);
  21. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  22. public static extern int RecastFindNearestPoint(IntPtr navPtr, float[] extents, float[] pos, float[] nearestPos);
  23. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  24. public static extern int RecastFindRandomPointAroundCircle(IntPtr navPtr, float[] extents, float[] centerPos, float radius, float[] randomPos);
  25. [DllImport(RecastDLL, CallingConvention=CallingConvention.Cdecl)]
  26. public static extern int RecastFindRandomPoint(IntPtr navPtr, float[] randomPos);
  27. }
  28. }