CLightProbeVolume.generated.cs 6.7 KB

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