Skeleton.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Skeleton.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. /// Hierarchical collection of bones.
  21. /// </summary>
  22. public unsafe partial class Skeleton
  23. {
  24. unsafe partial void OnSkeletonCreated ();
  25. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  26. internal static extern bool Skeleton_Load_File (IntPtr handle, IntPtr source);
  27. /// <summary>
  28. /// Read from a stream. Return true if successful.
  29. /// </summary>
  30. public bool Load (File source)
  31. {
  32. Runtime.ValidateObject (this);
  33. return Skeleton_Load_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern bool Skeleton_Load_MemoryBuffer (IntPtr handle, IntPtr source);
  37. /// <summary>
  38. /// Read from a stream. Return true if successful.
  39. /// </summary>
  40. public bool Load (MemoryBuffer source)
  41. {
  42. Runtime.ValidateObject (this);
  43. return Skeleton_Load_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  44. }
  45. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  46. internal static extern bool Skeleton_Save_File (IntPtr handle, IntPtr dest);
  47. /// <summary>
  48. /// Write to a stream. Return true if successful.
  49. /// </summary>
  50. public bool Save (File dest)
  51. {
  52. Runtime.ValidateObject (this);
  53. return Skeleton_Save_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  54. }
  55. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  56. internal static extern bool Skeleton_Save_MemoryBuffer (IntPtr handle, IntPtr dest);
  57. /// <summary>
  58. /// Write to a stream. Return true if successful.
  59. /// </summary>
  60. public bool Save (MemoryBuffer dest)
  61. {
  62. Runtime.ValidateObject (this);
  63. return Skeleton_Save_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  64. }
  65. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  66. internal static extern void Skeleton_SetRootBoneIndex (IntPtr handle, uint index);
  67. /// <summary>
  68. /// Set root bone's index.
  69. /// </summary>
  70. public void SetRootBoneIndex (uint index)
  71. {
  72. Runtime.ValidateObject (this);
  73. Skeleton_SetRootBoneIndex (handle, index);
  74. }
  75. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  76. internal static extern void Skeleton_ClearBones (IntPtr handle);
  77. /// <summary>
  78. /// Clear bones.
  79. /// </summary>
  80. public void ClearBones ()
  81. {
  82. Runtime.ValidateObject (this);
  83. Skeleton_ClearBones (handle);
  84. }
  85. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  86. internal static extern void Skeleton_Reset (IntPtr handle);
  87. /// <summary>
  88. /// Reset all animating bones to initial positions.
  89. /// </summary>
  90. public void Reset ()
  91. {
  92. Runtime.ValidateObject (this);
  93. Skeleton_Reset (handle);
  94. }
  95. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  96. internal static extern uint Skeleton_GetNumBones (IntPtr handle);
  97. /// <summary>
  98. /// Return number of bones.
  99. /// </summary>
  100. private uint GetNumBones ()
  101. {
  102. Runtime.ValidateObject (this);
  103. return Skeleton_GetNumBones (handle);
  104. }
  105. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  106. internal static extern Bone* Skeleton_GetRootBone (IntPtr handle);
  107. /// <summary>
  108. /// Return root bone.
  109. /// </summary>
  110. private Bone* GetRootBone ()
  111. {
  112. Runtime.ValidateObject (this);
  113. return Skeleton_GetRootBone (handle);
  114. }
  115. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  116. internal static extern Bone* Skeleton_GetBone (IntPtr handle, uint index);
  117. /// <summary>
  118. /// Return bone by index.
  119. /// </summary>
  120. public Bone* GetBone (uint index)
  121. {
  122. Runtime.ValidateObject (this);
  123. return Skeleton_GetBone (handle, index);
  124. }
  125. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  126. internal static extern Bone* Skeleton_GetBone0 (IntPtr handle, int boneNameHash);
  127. /// <summary>
  128. /// Return bone by name hash.
  129. /// </summary>
  130. public Bone* GetBone (StringHash boneNameHash)
  131. {
  132. Runtime.ValidateObject (this);
  133. return Skeleton_GetBone0 (handle, boneNameHash.Code);
  134. }
  135. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  136. internal static extern void Skeleton_ResetSilent (IntPtr handle);
  137. /// <summary>
  138. /// Reset all animating bones to initial positions without marking the nodes dirty. Requires the node dirtying to be performed later.
  139. /// </summary>
  140. public void ResetSilent ()
  141. {
  142. Runtime.ValidateObject (this);
  143. Skeleton_ResetSilent (handle);
  144. }
  145. /// <summary>
  146. /// Return number of bones.
  147. /// </summary>
  148. public uint NumBones {
  149. get {
  150. return GetNumBones ();
  151. }
  152. }
  153. /// <summary>
  154. /// Return root bone.
  155. /// </summary>
  156. public Bone* RootBone {
  157. get {
  158. return GetRootBone ();
  159. }
  160. }
  161. }
  162. }