ColorDistribution.generated.cs 5.8 KB

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