CLightProbeVolume.generated.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Rendering
  7. * @{
  8. */
  9. /// <summary>
  10. /// Allows you to define a volume of light probes that will be used for indirect lighting. Lighting information in the
  11. /// scene will be interpolated from nearby probes to calculate the amount of indirect lighting at that position. It is up
  12. /// to the caller to place the light probes in areas where the lighting changes in order to yield the best results.
  13. ///
  14. /// The volume can never have less than 4 probes.
  15. /// </summary>
  16. [ShowInInspector]
  17. public partial class LightProbeVolume : Component
  18. {
  19. private LightProbeVolume(bool __dummy0) { }
  20. protected LightProbeVolume() { }
  21. /// <summary>Returns the volume that's used for adding probes in a uniform grid pattern.</summary>
  22. [ShowInInspector]
  23. public AABox GridVolume
  24. {
  25. get
  26. {
  27. AABox temp;
  28. Internal_getGridVolume(mCachedPtr, out temp);
  29. return temp;
  30. }
  31. }
  32. /// <summary>Returns the cell count that's used for determining the density of probes within a grid volume.</summary>
  33. [ShowInInspector]
  34. public Vector3I CellCount
  35. {
  36. get
  37. {
  38. Vector3I temp;
  39. Internal_getCellCount(mCachedPtr, out temp);
  40. return temp;
  41. }
  42. }
  43. /// <summary>
  44. /// Adds a new probe at the specified position and returns a handle to the probe. The position is relative to the volume
  45. /// origin.
  46. /// </summary>
  47. public uint AddProbe(Vector3 position)
  48. {
  49. return Internal_addProbe(mCachedPtr, ref position);
  50. }
  51. /// <summary>Updates the position of the probe with the specified handle.</summary>
  52. public void SetProbePosition(uint handle, Vector3 position)
  53. {
  54. Internal_setProbePosition(mCachedPtr, handle, ref position);
  55. }
  56. /// <summary>Retrieves the position of the probe with the specified handle.</summary>
  57. public Vector3 GetProbePosition(uint handle)
  58. {
  59. Vector3 temp;
  60. Internal_getProbePosition(mCachedPtr, handle, out temp);
  61. return temp;
  62. }
  63. /// <summary>
  64. /// Removes the probe with the specified handle. Note that if this is one of the last four remaining probes in the volume
  65. /// it cannot be removed.
  66. /// </summary>
  67. public void RemoveProbe(uint handle)
  68. {
  69. Internal_removeProbe(mCachedPtr, handle);
  70. }
  71. /// <summary>Returns a list of positions of all light probes in the volume.</summary>
  72. public LightProbeInfo[] GetProbes()
  73. {
  74. return Internal_getProbes(mCachedPtr);
  75. }
  76. /// <summary>
  77. /// Causes the information for this specific light probe to be updated. You generally want to call this when the probe is
  78. /// moved or the scene around the probe changes.
  79. /// </summary>
  80. public void RenderProbe(uint handle)
  81. {
  82. Internal_renderProbe(mCachedPtr, handle);
  83. }
  84. /// <summary>
  85. /// Causes the information for all lights probes to be updated. You generally want to call this if you move the entire
  86. /// light volume or the scene around the volume changes.
  87. /// </summary>
  88. public void RenderProbes()
  89. {
  90. Internal_renderProbes(mCachedPtr);
  91. }
  92. /// <summary>
  93. /// Resizes the light probe grid and inserts new light probes, if the new size is larger than previous size. New probes
  94. /// are inserted in a grid pattern matching the new size and density parameters.
  95. ///
  96. /// Note that shrinking the volume will not remove light probes. In order to remove probes outside of the new volume call
  97. /// clip().
  98. ///
  99. /// Resize will not change the positions of current light probes. If you wish to reset all probes to the currently set
  100. /// grid position, call reset().
  101. /// </summary>
  102. /// <param name="volume">Axis aligned volume to be covered by the light probes.</param>
  103. /// <param name="cellCount">
  104. /// Number of grid cells to split the volume into. Minimum number of 1, in which case each corner of the volume is
  105. /// represented by a single probe. Higher values subdivide the volume in an uniform way.
  106. /// </param>
  107. public void Resize(AABox volume, Vector3I cellCount)
  108. {
  109. Internal_resize(mCachedPtr, ref volume, ref cellCount);
  110. }
  111. /// <summary>Removes any probes outside of the current grid volume.</summary>
  112. public void Clip()
  113. {
  114. Internal_clip(mCachedPtr);
  115. }
  116. /// <summary>
  117. /// Resets all probes to match the original grid pattern. This will reset probe positions, as well as add/remove probes
  118. /// as necessary, essentially losing any custom changes to the probes.
  119. /// </summary>
  120. public void Reset()
  121. {
  122. Internal_reset(mCachedPtr);
  123. }
  124. /// <summary>
  125. /// Resizes the light probe grid and inserts new light probes, if the new size is larger than previous size. New probes
  126. /// are inserted in a grid pattern matching the new size and density parameters.
  127. ///
  128. /// Note that shrinking the volume will not remove light probes. In order to remove probes outside of the new volume call
  129. /// clip().
  130. ///
  131. /// Resize will not change the positions of current light probes. If you wish to reset all probes to the currently set
  132. /// grid position, call reset().
  133. /// </summary>
  134. /// <param name="volume">Axis aligned volume to be covered by the light probes.</param>
  135. public void Resize(AABox volume)
  136. {
  137. Vector3I cellCount = new Vector3I(1, 1, 1);
  138. Internal_resize(mCachedPtr, ref volume, ref cellCount);
  139. }
  140. [MethodImpl(MethodImplOptions.InternalCall)]
  141. private static extern uint Internal_addProbe(IntPtr thisPtr, ref Vector3 position);
  142. [MethodImpl(MethodImplOptions.InternalCall)]
  143. private static extern void Internal_setProbePosition(IntPtr thisPtr, uint handle, ref Vector3 position);
  144. [MethodImpl(MethodImplOptions.InternalCall)]
  145. private static extern void Internal_getProbePosition(IntPtr thisPtr, uint handle, out Vector3 __output);
  146. [MethodImpl(MethodImplOptions.InternalCall)]
  147. private static extern void Internal_removeProbe(IntPtr thisPtr, uint handle);
  148. [MethodImpl(MethodImplOptions.InternalCall)]
  149. private static extern LightProbeInfo[] Internal_getProbes(IntPtr thisPtr);
  150. [MethodImpl(MethodImplOptions.InternalCall)]
  151. private static extern void Internal_renderProbe(IntPtr thisPtr, uint handle);
  152. [MethodImpl(MethodImplOptions.InternalCall)]
  153. private static extern void Internal_renderProbes(IntPtr thisPtr);
  154. [MethodImpl(MethodImplOptions.InternalCall)]
  155. private static extern void Internal_resize(IntPtr thisPtr, ref AABox volume, ref Vector3I cellCount);
  156. [MethodImpl(MethodImplOptions.InternalCall)]
  157. private static extern void Internal_clip(IntPtr thisPtr);
  158. [MethodImpl(MethodImplOptions.InternalCall)]
  159. private static extern void Internal_reset(IntPtr thisPtr);
  160. [MethodImpl(MethodImplOptions.InternalCall)]
  161. private static extern void Internal_getGridVolume(IntPtr thisPtr, out AABox __output);
  162. [MethodImpl(MethodImplOptions.InternalCall)]
  163. private static extern void Internal_getCellCount(IntPtr thisPtr, out Vector3I __output);
  164. }
  165. /** @} */
  166. }