2
0

CLightProbeVolume.generated.cs 6.8 KB

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