ColorDistribution.generated.cs 5.9 KB

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