DynamicNavigationMesh.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // DynamicNavigationMesh.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Navigation
  18. {
  19. /// <summary>
  20. /// Constructor.
  21. /// </summary>
  22. public unsafe partial class DynamicNavigationMesh : NavigationMesh
  23. {
  24. unsafe partial void OnDynamicNavigationMeshCreated ();
  25. [Preserve]
  26. public DynamicNavigationMesh (IntPtr handle) : base (handle)
  27. {
  28. OnDynamicNavigationMeshCreated ();
  29. }
  30. [Preserve]
  31. protected DynamicNavigationMesh (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnDynamicNavigationMeshCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int DynamicNavigationMesh_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (DynamicNavigationMesh_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr DynamicNavigationMesh_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (DynamicNavigationMesh_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int DynamicNavigationMesh_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(DynamicNavigationMesh));
  54. return new StringHash (DynamicNavigationMesh_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr DynamicNavigationMesh_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(DynamicNavigationMesh));
  61. return Marshal.PtrToStringAnsi (DynamicNavigationMesh_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public DynamicNavigationMesh () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr DynamicNavigationMesh_DynamicNavigationMesh (IntPtr param1);
  69. [Preserve]
  70. public DynamicNavigationMesh (Context param1) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(DynamicNavigationMesh));
  73. handle = DynamicNavigationMesh_DynamicNavigationMesh ((object)param1 == null ? IntPtr.Zero : param1.Handle);
  74. Runtime.RegisterObject (this);
  75. OnDynamicNavigationMeshCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void DynamicNavigationMesh_RegisterObject (IntPtr param1);
  79. /// <summary>
  80. /// Register with engine context.
  81. /// </summary>
  82. public new static void RegisterObject (Context param1)
  83. {
  84. Runtime.Validate (typeof(DynamicNavigationMesh));
  85. DynamicNavigationMesh_RegisterObject ((object)param1 == null ? IntPtr.Zero : param1.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern bool DynamicNavigationMesh_Allocate (IntPtr handle, ref Urho.BoundingBox boundingBox, uint maxTiles);
  89. /// <summary>
  90. /// Allocate the navigation mesh without building any tiles. Bounding box is not padded. Return true if successful.
  91. /// </summary>
  92. public override bool Allocate (Urho.BoundingBox boundingBox, uint maxTiles)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. return DynamicNavigationMesh_Allocate (handle, ref boundingBox, maxTiles);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern bool DynamicNavigationMesh_Build (IntPtr handle);
  99. /// <summary>
  100. /// Build/rebuild the entire navigation mesh.
  101. /// </summary>
  102. public override bool Build ()
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. return DynamicNavigationMesh_Build (handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool DynamicNavigationMesh_Build0 (IntPtr handle, ref Urho.BoundingBox boundingBox);
  109. /// <summary>
  110. /// Build/rebuild a portion of the navigation mesh.
  111. /// </summary>
  112. public override bool Build (Urho.BoundingBox boundingBox)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. return DynamicNavigationMesh_Build0 (handle, ref boundingBox);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern bool DynamicNavigationMesh_Build1 (IntPtr handle, ref Urho.IntVector2 from, ref Urho.IntVector2 to);
  119. /// <summary>
  120. /// Rebuild part of the navigation mesh in the rectangular area. Return true if successful.
  121. /// </summary>
  122. public override bool Build (Urho.IntVector2 from, Urho.IntVector2 to)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. return DynamicNavigationMesh_Build1 (handle, ref from, ref to);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool DynamicNavigationMesh_IsObstacleInTile (IntPtr handle, IntPtr obstacle, ref Urho.IntVector2 tile);
  129. /// <summary>
  130. /// Return whether the Obstacle is touching the given tile.
  131. /// </summary>
  132. public bool IsObstacleInTile (Obstacle obstacle, Urho.IntVector2 tile)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return DynamicNavigationMesh_IsObstacleInTile (handle, (object)obstacle == null ? IntPtr.Zero : obstacle.Handle, ref tile);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void DynamicNavigationMesh_RemoveTile (IntPtr handle, ref Urho.IntVector2 tile);
  139. /// <summary>
  140. /// Remove tile from navigation mesh.
  141. /// </summary>
  142. public override void RemoveTile (Urho.IntVector2 tile)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. DynamicNavigationMesh_RemoveTile (handle, ref tile);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void DynamicNavigationMesh_RemoveAllTiles (IntPtr handle);
  149. /// <summary>
  150. /// Remove all tiles from navigation mesh.
  151. /// </summary>
  152. public override void RemoveAllTiles ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. DynamicNavigationMesh_RemoveAllTiles (handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void DynamicNavigationMesh_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  159. /// <summary>
  160. /// Visualize the component as debug geometry.
  161. /// </summary>
  162. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. DynamicNavigationMesh_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void DynamicNavigationMesh_DrawDebugGeometry2 (IntPtr handle, bool depthTest);
  169. /// <summary>
  170. /// Add debug geometry to the debug renderer.
  171. /// </summary>
  172. public override void DrawDebugGeometry (bool depthTest)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. DynamicNavigationMesh_DrawDebugGeometry2 (handle, depthTest);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void DynamicNavigationMesh_SetMaxObstacles (IntPtr handle, uint maxObstacles);
  179. /// <summary>
  180. /// Set the maximum number of obstacles allowed.
  181. /// </summary>
  182. private void SetMaxObstacles (uint maxObstacles)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. DynamicNavigationMesh_SetMaxObstacles (handle, maxObstacles);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void DynamicNavigationMesh_SetMaxLayers (IntPtr handle, uint maxLayers);
  189. /// <summary>
  190. /// Set the maximum number of layers that navigation construction can create.
  191. /// </summary>
  192. private void SetMaxLayers (uint maxLayers)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. DynamicNavigationMesh_SetMaxLayers (handle, maxLayers);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern uint DynamicNavigationMesh_GetMaxObstacles (IntPtr handle);
  199. /// <summary>
  200. /// Return the maximum number of obstacles allowed.
  201. /// </summary>
  202. private uint GetMaxObstacles ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return DynamicNavigationMesh_GetMaxObstacles (handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern uint DynamicNavigationMesh_GetMaxLayers (IntPtr handle);
  209. /// <summary>
  210. /// Return the maximum number of layers permitted to build.
  211. /// </summary>
  212. private uint GetMaxLayers ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return DynamicNavigationMesh_GetMaxLayers (handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void DynamicNavigationMesh_SetDrawObstacles (IntPtr handle, bool enable);
  219. /// <summary>
  220. /// Draw debug geometry for Obstacles.
  221. /// </summary>
  222. private void SetDrawObstacles (bool enable)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. DynamicNavigationMesh_SetDrawObstacles (handle, enable);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern bool DynamicNavigationMesh_GetDrawObstacles (IntPtr handle);
  229. /// <summary>
  230. /// Return whether to draw Obstacles.
  231. /// </summary>
  232. private bool GetDrawObstacles ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return DynamicNavigationMesh_GetDrawObstacles (handle);
  236. }
  237. public override StringHash Type {
  238. get {
  239. return UrhoGetType ();
  240. }
  241. }
  242. public override string TypeName {
  243. get {
  244. return GetTypeName ();
  245. }
  246. }
  247. [Preserve]
  248. public new static StringHash TypeStatic {
  249. get {
  250. return GetTypeStatic ();
  251. }
  252. }
  253. public new static string TypeNameStatic {
  254. get {
  255. return GetTypeNameStatic ();
  256. }
  257. }
  258. /// <summary>
  259. /// Return the maximum number of obstacles allowed.
  260. /// Or
  261. /// Set the maximum number of obstacles allowed.
  262. /// </summary>
  263. public uint MaxObstacles {
  264. get {
  265. return GetMaxObstacles ();
  266. }
  267. set {
  268. SetMaxObstacles (value);
  269. }
  270. }
  271. /// <summary>
  272. /// Return the maximum number of layers permitted to build.
  273. /// Or
  274. /// Set the maximum number of layers that navigation construction can create.
  275. /// </summary>
  276. public uint MaxLayers {
  277. get {
  278. return GetMaxLayers ();
  279. }
  280. set {
  281. SetMaxLayers (value);
  282. }
  283. }
  284. /// <summary>
  285. /// Return whether to draw Obstacles.
  286. /// Or
  287. /// Draw debug geometry for Obstacles.
  288. /// </summary>
  289. public bool DrawObstacles {
  290. get {
  291. return GetDrawObstacles ();
  292. }
  293. set {
  294. SetDrawObstacles (value);
  295. }
  296. }
  297. }
  298. }