AnimationClip.generated.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Animation
  7. * @{
  8. */
  9. /// <summary>
  10. /// Contains animation curves for translation/rotation/scale of scene objects/skeleton bones, as well as curves for
  11. /// generic property animation.
  12. /// </summary>
  13. public partial class AnimationClip : Resource
  14. {
  15. private AnimationClip(bool __dummy0, bool __dummy1) { }
  16. protected AnimationClip() { }
  17. /// <summary>
  18. /// Creates an animation clip with no curves. After creation make sure to register some animation curves before using it.
  19. /// </summary>
  20. public AnimationClip(bool isAdditive = false)
  21. {
  22. Internal_create(this, isAdditive);
  23. }
  24. /// <summary>Creates an animation clip with specified curves.</summary>
  25. /// <param name="curves">Curves to initialize the animation with.</param>
  26. /// <param name="isAdditive">
  27. /// Determines does the clip contain additive curve data. This will change the behaviour how is the clip blended with
  28. /// other animations.
  29. /// </param>
  30. /// <param name="sampleRate">
  31. /// If animation uses evenly spaced keyframes, number of samples per second. Not relevant if keyframes are unevenly
  32. /// spaced.
  33. /// </param>
  34. /// <param name="rootMotion">
  35. /// Optional set of curves that can be used for animating the root bone. Not used by the animation system directly but is
  36. /// instead provided to the user for manual evaluation.
  37. /// </param>
  38. public AnimationClip(AnimationCurves curves, bool isAdditive = false, uint sampleRate = 1, RootMotion rootMotion = null)
  39. {
  40. Internal_create0(this, curves, isAdditive, sampleRate, rootMotion);
  41. }
  42. /// <summary>Returns a reference wrapper for this resource.</summary>
  43. public RRef<AnimationClip> Ref
  44. {
  45. get { return Internal_GetRef(mCachedPtr); }
  46. }
  47. /// <summary>
  48. /// A set of all curves stored in the animation. Returned value will not be updated if the animation clip curves are
  49. /// added or removed, as it is a copy of clip's internal values.
  50. /// </summary>
  51. public AnimationCurves Curves
  52. {
  53. get { return Internal_getCurves(mCachedPtr); }
  54. set { Internal_setCurves(mCachedPtr, value); }
  55. }
  56. /// <summary>A set of all events to be triggered as the animation is playing.</summary>
  57. public AnimationEvent[] Events
  58. {
  59. get { return Internal_getEvents(mCachedPtr); }
  60. set { Internal_setEvents(mCachedPtr, value); }
  61. }
  62. /// <summary>
  63. /// Returns a set of curves containing motion of the root bone. This allows the user to evaluate the root bone animation
  64. /// curves manually, instead of through the normal animation process. This property is only available if animation clip
  65. /// was imported with root motion import enabled.
  66. /// </summary>
  67. public RootMotion RootMotion
  68. {
  69. get { return Internal_getRootMotion(mCachedPtr); }
  70. }
  71. /// <summary>Checks if animation clip has root motion curves separate from the normal animation curves.</summary>
  72. public bool HasRootMotion
  73. {
  74. get { return Internal_hasRootMotion(mCachedPtr); }
  75. }
  76. /// <summary>
  77. /// Checks are the curves contained within the clip additive. Additive clips are intended to be added on top of other
  78. /// clips.
  79. /// </summary>
  80. public bool IsAddtive
  81. {
  82. get { return Internal_isAdditive(mCachedPtr); }
  83. }
  84. /// <summary>Returns the length of the animation clip, in seconds.</summary>
  85. public float Length
  86. {
  87. get { return Internal_getLength(mCachedPtr); }
  88. }
  89. /// <summary>
  90. /// Number of samples per second the animation clip curves were sampled at. This value is not used by the animation clip
  91. /// or curves directly since unevenly spaced keyframes are supported. But it can be of value when determining the
  92. /// original sample rate of an imported animation or similar.
  93. /// </summary>
  94. public uint SampleRate
  95. {
  96. get { return Internal_getSampleRate(mCachedPtr); }
  97. set { Internal_setSampleRate(mCachedPtr, value); }
  98. }
  99. /// <summary>Returns a reference wrapper for this resource.</summary>
  100. public static implicit operator RRef<AnimationClip>(AnimationClip x)
  101. { return Internal_GetRef(x.mCachedPtr); }
  102. [MethodImpl(MethodImplOptions.InternalCall)]
  103. private static extern RRef<AnimationClip> Internal_GetRef(IntPtr thisPtr);
  104. [MethodImpl(MethodImplOptions.InternalCall)]
  105. private static extern AnimationCurves Internal_getCurves(IntPtr thisPtr);
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern void Internal_setCurves(IntPtr thisPtr, AnimationCurves curves);
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern AnimationEvent[] Internal_getEvents(IntPtr thisPtr);
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern void Internal_setEvents(IntPtr thisPtr, AnimationEvent[] events);
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern RootMotion Internal_getRootMotion(IntPtr thisPtr);
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern bool Internal_hasRootMotion(IntPtr thisPtr);
  116. [MethodImpl(MethodImplOptions.InternalCall)]
  117. private static extern bool Internal_isAdditive(IntPtr thisPtr);
  118. [MethodImpl(MethodImplOptions.InternalCall)]
  119. private static extern float Internal_getLength(IntPtr thisPtr);
  120. [MethodImpl(MethodImplOptions.InternalCall)]
  121. private static extern uint Internal_getSampleRate(IntPtr thisPtr);
  122. [MethodImpl(MethodImplOptions.InternalCall)]
  123. private static extern void Internal_setSampleRate(IntPtr thisPtr, uint sampleRate);
  124. [MethodImpl(MethodImplOptions.InternalCall)]
  125. private static extern void Internal_create(AnimationClip managedInstance, bool isAdditive);
  126. [MethodImpl(MethodImplOptions.InternalCall)]
  127. private static extern void Internal_create0(AnimationClip managedInstance, AnimationCurves curves, bool isAdditive, uint sampleRate, RootMotion rootMotion);
  128. }
  129. /** @} */
  130. }