SplinePath.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // SplinePath.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
  18. {
  19. /// <summary>
  20. /// Spline for creating smooth movement based on Speed along a set of Control Points modified by the Interpolation Mode.
  21. /// </summary>
  22. public unsafe partial class SplinePath : Component
  23. {
  24. unsafe partial void OnSplinePathCreated ();
  25. [Preserve]
  26. public SplinePath (IntPtr handle) : base (handle)
  27. {
  28. OnSplinePathCreated ();
  29. }
  30. [Preserve]
  31. protected SplinePath (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnSplinePathCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int SplinePath_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (SplinePath_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr SplinePath_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (SplinePath_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int SplinePath_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(SplinePath));
  54. return new StringHash (SplinePath_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr SplinePath_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(SplinePath));
  61. return Marshal.PtrToStringAnsi (SplinePath_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public SplinePath () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr SplinePath_SplinePath (IntPtr context);
  69. [Preserve]
  70. public SplinePath (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(SplinePath));
  73. handle = SplinePath_SplinePath ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnSplinePathCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void SplinePath_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(SplinePath));
  85. SplinePath_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void SplinePath_ApplyAttributes (IntPtr handle);
  89. /// <summary>
  90. /// Apply Attributes to the SplinePath.
  91. /// </summary>
  92. public override void ApplyAttributes ()
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. SplinePath_ApplyAttributes (handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void SplinePath_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  99. /// <summary>
  100. /// Draw the Debug Geometry.
  101. /// </summary>
  102. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. SplinePath_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void SplinePath_AddControlPoint (IntPtr handle, IntPtr point, uint index);
  109. /// <summary>
  110. /// Add a Node to the SplinePath as a Control Point.
  111. /// </summary>
  112. public void AddControlPoint (Node point, uint index = uint.MaxValue)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. SplinePath_AddControlPoint (handle, (object)point == null ? IntPtr.Zero : point.Handle, index);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void SplinePath_RemoveControlPoint (IntPtr handle, IntPtr point);
  119. /// <summary>
  120. /// Remove a Node Control Point from the SplinePath.
  121. /// </summary>
  122. public void RemoveControlPoint (Node point)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. SplinePath_RemoveControlPoint (handle, (object)point == null ? IntPtr.Zero : point.Handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void SplinePath_ClearControlPoints (IntPtr handle);
  129. /// <summary>
  130. /// Clear the Control Points from the SplinePath.
  131. /// </summary>
  132. public void ClearControlPoints ()
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. SplinePath_ClearControlPoints (handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void SplinePath_SetInterpolationMode (IntPtr handle, InterpolationMode interpolationMode);
  139. /// <summary>
  140. /// Set the Interpolation Mode.
  141. /// </summary>
  142. private void SetInterpolationMode (InterpolationMode interpolationMode)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. SplinePath_SetInterpolationMode (handle, interpolationMode);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void SplinePath_SetSpeed (IntPtr handle, float speed);
  149. /// <summary>
  150. /// Set the movement Speed.
  151. /// </summary>
  152. private void SetSpeed (float speed)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. SplinePath_SetSpeed (handle, speed);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void SplinePath_SetPosition (IntPtr handle, float factor);
  159. /// <summary>
  160. /// Set the controlled Node's position on the SplinePath.
  161. /// </summary>
  162. public void SetPosition (float factor)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. SplinePath_SetPosition (handle, factor);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void SplinePath_SetControlledNode (IntPtr handle, IntPtr controlled);
  169. /// <summary>
  170. /// Set the Node to be moved along the SplinePath.
  171. /// </summary>
  172. private void SetControlledNode (Node controlled)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. SplinePath_SetControlledNode (handle, (object)controlled == null ? IntPtr.Zero : controlled.Handle);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern InterpolationMode SplinePath_GetInterpolationMode (IntPtr handle);
  179. /// <summary>
  180. /// Get the Interpolation Mode.
  181. /// </summary>
  182. private InterpolationMode GetInterpolationMode ()
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return SplinePath_GetInterpolationMode (handle);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern float SplinePath_GetSpeed (IntPtr handle);
  189. /// <summary>
  190. /// Get the movement Speed.
  191. /// </summary>
  192. private float GetSpeed ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return SplinePath_GetSpeed (handle);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern float SplinePath_GetLength (IntPtr handle);
  199. /// <summary>
  200. /// Get the length of SplinePath;
  201. /// </summary>
  202. private float GetLength ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return SplinePath_GetLength (handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern Vector3 SplinePath_GetPosition (IntPtr handle);
  209. /// <summary>
  210. /// Get the parent Node's last position on the spline.
  211. /// </summary>
  212. private Vector3 GetPosition ()
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return SplinePath_GetPosition (handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern IntPtr SplinePath_GetControlledNode (IntPtr handle);
  219. /// <summary>
  220. /// Get the controlled Node.
  221. /// </summary>
  222. private Node GetControlledNode ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return Runtime.LookupObject<Node> (SplinePath_GetControlledNode (handle));
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern Vector3 SplinePath_GetPoint (IntPtr handle, float factor);
  229. /// <summary>
  230. /// Get a point on the SplinePath from 0.f to 1.f where 0 is the start and 1 is the end.
  231. /// </summary>
  232. public Vector3 GetPoint (float factor)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. return SplinePath_GetPoint (handle, factor);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void SplinePath_Move (IntPtr handle, float timeStep);
  239. /// <summary>
  240. /// Move the controlled Node to the next position along the SplinePath based off the Speed value.
  241. /// </summary>
  242. public void Move (float timeStep)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. SplinePath_Move (handle, timeStep);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void SplinePath_Reset (IntPtr handle);
  249. /// <summary>
  250. /// Reset movement along the path.
  251. /// </summary>
  252. public void Reset ()
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. SplinePath_Reset (handle);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern bool SplinePath_IsFinished (IntPtr handle);
  259. /// <summary>
  260. /// Returns whether the movement along the SplinePath is complete.
  261. /// </summary>
  262. private bool IsFinished ()
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return SplinePath_IsFinished (handle);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void SplinePath_SetControlledIdAttr (IntPtr handle, uint value);
  269. /// <summary>
  270. /// Set Controlled Node ID attribute.
  271. /// </summary>
  272. private void SetControlledIdAttr (uint value)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. SplinePath_SetControlledIdAttr (handle, value);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern uint SplinePath_GetControlledIdAttr (IntPtr handle);
  279. /// <summary>
  280. /// Get Controlled Node ID attribute.
  281. /// </summary>
  282. private uint GetControlledIdAttr ()
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. return SplinePath_GetControlledIdAttr (handle);
  286. }
  287. public override StringHash Type {
  288. get {
  289. return UrhoGetType ();
  290. }
  291. }
  292. public override string TypeName {
  293. get {
  294. return GetTypeName ();
  295. }
  296. }
  297. [Preserve]
  298. public new static StringHash TypeStatic {
  299. get {
  300. return GetTypeStatic ();
  301. }
  302. }
  303. public new static string TypeNameStatic {
  304. get {
  305. return GetTypeNameStatic ();
  306. }
  307. }
  308. /// <summary>
  309. /// Get the Interpolation Mode.
  310. /// Or
  311. /// Set the Interpolation Mode.
  312. /// </summary>
  313. public InterpolationMode InterpolationMode {
  314. get {
  315. return GetInterpolationMode ();
  316. }
  317. set {
  318. SetInterpolationMode (value);
  319. }
  320. }
  321. /// <summary>
  322. /// Get the movement Speed.
  323. /// Or
  324. /// Set the movement Speed.
  325. /// </summary>
  326. public float Speed {
  327. get {
  328. return GetSpeed ();
  329. }
  330. set {
  331. SetSpeed (value);
  332. }
  333. }
  334. /// <summary>
  335. /// Get the parent Node's last position on the spline.
  336. /// </summary>
  337. public Vector3 Position {
  338. get {
  339. return GetPosition ();
  340. }
  341. }
  342. /// <summary>
  343. /// Get the controlled Node.
  344. /// Or
  345. /// Set the Node to be moved along the SplinePath.
  346. /// </summary>
  347. public Node ControlledNode {
  348. get {
  349. return GetControlledNode ();
  350. }
  351. set {
  352. SetControlledNode (value);
  353. }
  354. }
  355. /// <summary>
  356. /// Get the length of SplinePath;
  357. /// </summary>
  358. public float Length {
  359. get {
  360. return GetLength ();
  361. }
  362. }
  363. /// <summary>
  364. /// Returns whether the movement along the SplinePath is complete.
  365. /// </summary>
  366. public bool Finished {
  367. get {
  368. return IsFinished ();
  369. }
  370. }
  371. /// <summary>
  372. /// Get Controlled Node ID attribute.
  373. /// Or
  374. /// Set Controlled Node ID attribute.
  375. /// </summary>
  376. public uint ControlledIdAttr {
  377. get {
  378. return GetControlledIdAttr ();
  379. }
  380. set {
  381. SetControlledIdAttr (value);
  382. }
  383. }
  384. }
  385. }