ColorDistribution.generated.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Particles
  7. * @{
  8. */
  9. /// <summary>
  10. /// Specifies a color as a distribution, which can include a constant color, random color range or a color gradient.
  11. /// </summary>
  12. [ShowInInspector]
  13. public partial class ColorDistribution : ScriptObject
  14. {
  15. private ColorDistribution(bool __dummy0) { }
  16. /// <summary>Creates a new empty distribution.</summary>
  17. public ColorDistribution()
  18. {
  19. Internal_ColorDistribution(this);
  20. }
  21. /// <summary>Creates a new distribution that returns a constant color.</summary>
  22. public ColorDistribution(Color color)
  23. {
  24. Internal_ColorDistribution0(this, ref color);
  25. }
  26. /// <summary>Creates a new distribution that returns a random color in the specified range.</summary>
  27. public ColorDistribution(Color minColor, Color maxColor)
  28. {
  29. Internal_ColorDistribution1(this, ref minColor, ref maxColor);
  30. }
  31. /// <summary>Creates a new distribution that evaluates a color gradient.</summary>
  32. public ColorDistribution(ColorGradient gradient)
  33. {
  34. Internal_ColorDistribution2(this, gradient);
  35. }
  36. /// <summary>Creates a new distribution that returns a random color in a range determined by two gradients.</summary>
  37. public ColorDistribution(ColorGradient minGradient, ColorGradient maxGradient)
  38. {
  39. Internal_ColorDistribution3(this, minGradient, maxGradient);
  40. }
  41. /// <summary>Returns the type of the represented distribution.</summary>
  42. [ShowInInspector]
  43. public PropertyDistributionType DistributionType
  44. {
  45. get { return Internal_getType(mCachedPtr); }
  46. }
  47. /// <summary>
  48. /// Returns the constant value of the distribution, or the minimal value of a constant range. Undefined if the
  49. /// distribution is represented by a gradient.
  50. /// </summary>
  51. public Color GetMinConstant()
  52. {
  53. Color temp;
  54. Internal_getMinConstant(mCachedPtr, out temp);
  55. return temp;
  56. }
  57. /// <summary>
  58. /// Returns the maximum value of a constant range. Only defined if the distribution represents a non-gradient range.
  59. /// </summary>
  60. public Color GetMaxConstant()
  61. {
  62. Color temp;
  63. Internal_getMaxConstant(mCachedPtr, out temp);
  64. return temp;
  65. }
  66. /// <summary>
  67. /// Returns the gradient representing the distribution, or the first gradient representing a gradient range. Undefined
  68. /// if the distribution is represented by a constant or a non-gradient range.
  69. /// </summary>
  70. public ColorGradient GetMinGradient()
  71. {
  72. return Internal_getMinGradient(mCachedPtr);
  73. }
  74. /// <summary>
  75. /// Returns the curve representing the second gradient of a gradient range. Only defined if the distribution represents
  76. /// a gradient range.
  77. /// </summary>
  78. public ColorGradient GetMaxGradient()
  79. {
  80. return Internal_getMaxGradient(mCachedPtr);
  81. }
  82. /// <summary>Evaluates the value of the distribution.</summary>
  83. /// <param name="t">
  84. /// Time at which to evaluate the distribution. This is only relevant if the distribution contains gradients.
  85. /// </param>
  86. /// <param name="factor">
  87. /// Value in range [0, 1] that determines how to interpolate between min/max value, if the distribution represents a
  88. /// range. Value of 0 will return the minimum value, while value of 1 will return the maximum value, and interpolate the
  89. /// values in-between.
  90. /// </param>
  91. /// <returns>Evaluated color.</returns>
  92. public Color Evaluate(float t, float factor)
  93. {
  94. Color temp;
  95. Internal_evaluate(mCachedPtr, t, factor, out temp);
  96. return temp;
  97. }
  98. /// <summary>Evaluates the value of the distribution.</summary>
  99. /// <param name="t">
  100. /// Time at which to evaluate the distribution. This is only relevant if the distribution contains gradients.
  101. /// </param>
  102. /// <param name="factor">
  103. /// Random number generator that determines the factor. Factor determines how to interpolate between min/max value, if
  104. /// the distribution represents a range.
  105. /// </param>
  106. /// <returns>Evaluated color.</returns>
  107. public Color Evaluate(float t, out Random factor)
  108. {
  109. Color temp;
  110. Internal_evaluate0(mCachedPtr, t, out factor, out temp);
  111. return temp;
  112. }
  113. [MethodImpl(MethodImplOptions.InternalCall)]
  114. private static extern void Internal_ColorDistribution(ColorDistribution managedInstance);
  115. [MethodImpl(MethodImplOptions.InternalCall)]
  116. private static extern void Internal_ColorDistribution0(ColorDistribution managedInstance, ref Color color);
  117. [MethodImpl(MethodImplOptions.InternalCall)]
  118. private static extern void Internal_ColorDistribution1(ColorDistribution managedInstance, ref Color minColor, ref Color maxColor);
  119. [MethodImpl(MethodImplOptions.InternalCall)]
  120. private static extern void Internal_ColorDistribution2(ColorDistribution managedInstance, ColorGradient gradient);
  121. [MethodImpl(MethodImplOptions.InternalCall)]
  122. private static extern void Internal_ColorDistribution3(ColorDistribution managedInstance, ColorGradient minGradient, ColorGradient maxGradient);
  123. [MethodImpl(MethodImplOptions.InternalCall)]
  124. private static extern PropertyDistributionType Internal_getType(IntPtr thisPtr);
  125. [MethodImpl(MethodImplOptions.InternalCall)]
  126. private static extern void Internal_getMinConstant(IntPtr thisPtr, out Color __output);
  127. [MethodImpl(MethodImplOptions.InternalCall)]
  128. private static extern void Internal_getMaxConstant(IntPtr thisPtr, out Color __output);
  129. [MethodImpl(MethodImplOptions.InternalCall)]
  130. private static extern ColorGradient Internal_getMinGradient(IntPtr thisPtr);
  131. [MethodImpl(MethodImplOptions.InternalCall)]
  132. private static extern ColorGradient Internal_getMaxGradient(IntPtr thisPtr);
  133. [MethodImpl(MethodImplOptions.InternalCall)]
  134. private static extern void Internal_evaluate(IntPtr thisPtr, float t, float factor, out Color __output);
  135. [MethodImpl(MethodImplOptions.InternalCall)]
  136. private static extern void Internal_evaluate0(IntPtr thisPtr, float t, out Random factor, out Color __output);
  137. }
  138. /** @} */
  139. }