CLight.generated.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Rendering
  7. * @{
  8. */
  9. /// <summary>Illuminates a portion of the scene covered by the light.</summary>
  10. [ShowInInspector]
  11. public partial class Light : Component
  12. {
  13. private Light(bool __dummy0) { }
  14. protected Light() { }
  15. /// <summary>Determines the type of the light.</summary>
  16. [ShowInInspector]
  17. public LightType Type
  18. {
  19. get { return Internal_getType(mCachedPtr); }
  20. set { Internal_setType(mCachedPtr, value); }
  21. }
  22. /// <summary>Determines does this light cast shadows when rendered.</summary>
  23. [ShowInInspector]
  24. public bool CastsShadow
  25. {
  26. get { return Internal_getCastsShadow(mCachedPtr); }
  27. set { Internal_setCastsShadow(mCachedPtr, value); }
  28. }
  29. /// <summary>
  30. /// Shadow bias determines offset at which the shadows are rendered from the shadow caster. Bias value of 0 means the
  31. /// shadow will be renderered exactly at the casters position. If your geometry has thin areas this will produce an
  32. /// artifact called shadow acne, in which case you can increase the shadow bias value to eliminate it. Note that
  33. /// increasing the shadow bias will on the other hand make the shadow be offset from the caster and may make the caster
  34. /// appear as if floating (Peter Panning artifact). Neither is perfect, so it is preferable to ensure all your geometry
  35. /// has thickness and keep the bias at zero, or even at negative values.
  36. ///
  37. /// Default value is 0.5. Should be in rough range [-1, 1].
  38. /// </summary>
  39. [ShowInInspector]
  40. public float ShadowBias
  41. {
  42. get { return Internal_getShadowBias(mCachedPtr); }
  43. set { Internal_setShadowBias(mCachedPtr, value); }
  44. }
  45. /// <summary>Determines the color emitted by the light.</summary>
  46. [ShowInInspector]
  47. public Color Color
  48. {
  49. get
  50. {
  51. Color temp;
  52. Internal_getColor(mCachedPtr, out temp);
  53. return temp;
  54. }
  55. set { Internal_setColor(mCachedPtr, ref value); }
  56. }
  57. /// <summary>
  58. /// Range at which the light contribution fades out to zero. Use setUseAutoAttenuation to provide a radius automatically
  59. /// dependant on light intensity. The radius will cut-off light contribution and therefore manually set very small radius
  60. /// can end up being very physically incorrect.
  61. /// </summary>
  62. [ShowInInspector]
  63. public float AttenuationRadius
  64. {
  65. get { return Internal_getAttenuationRadius(mCachedPtr); }
  66. set { Internal_setAttenuationRadius(mCachedPtr, value); }
  67. }
  68. /// <summary>
  69. /// Radius of the light source. If non-zero then this light represents an area light, otherwise it is a punctual light.
  70. /// Area lights have different attenuation then punctual lights, and their appearance in specular reflections is
  71. /// realistic. Shape of the area light depends on light type: - For directional light the shape is a disc projected on
  72. /// the hemisphere on the sky. This parameter represents angular radius (in degrees) of the disk and should be very small
  73. /// (think of how much space the Sun takes on the sky - roughly 0.25 degree radius). - For radial light the shape is a
  74. /// sphere and the source radius is the radius of the sphere. - For spot lights the shape is a disc oriented in the
  75. /// direction of the spot light and the source radius is the radius of the disc.
  76. /// </summary>
  77. [ShowInInspector]
  78. public float SourceRadius
  79. {
  80. get { return Internal_getSourceRadius(mCachedPtr); }
  81. set { Internal_setSourceRadius(mCachedPtr, value); }
  82. }
  83. /// <summary>
  84. /// Determines the power of the light source. This will be luminous flux for radial & spot lights, luminance for
  85. /// directional lights with no area, and illuminance for directional lights with area (non-zero source radius).
  86. /// </summary>
  87. [ShowInInspector]
  88. public float Intensity
  89. {
  90. get { return Internal_getIntensity(mCachedPtr); }
  91. set { Internal_setIntensity(mCachedPtr, value); }
  92. }
  93. /// <summary>Determines the total angle covered by a spot light.</summary>
  94. [ShowInInspector]
  95. public Degree SpotAngle
  96. {
  97. get
  98. {
  99. Degree temp;
  100. Internal_getSpotAngle(mCachedPtr, out temp);
  101. return temp;
  102. }
  103. set { Internal_setSpotAngle(mCachedPtr, ref value); }
  104. }
  105. /// <summary>
  106. /// Determines the falloff angle covered by a spot light. Falloff angle determines at what point does light intensity
  107. /// starts quadratically falling off as the angle approaches the total spot angle.
  108. /// </summary>
  109. [ShowInInspector]
  110. public Degree SpotAngleFalloff
  111. {
  112. get
  113. {
  114. Degree temp;
  115. Internal_getSpotFalloffAngle(mCachedPtr, out temp);
  116. return temp;
  117. }
  118. set { Internal_setSpotFalloffAngle(mCachedPtr, ref value); }
  119. }
  120. /// <summary>
  121. /// If enabled the attenuation radius will automatically be controlled in order to provide reasonable light radius,
  122. /// depending on its intensity.
  123. /// </summary>
  124. [ShowInInspector]
  125. public bool UseAutoAttenuation
  126. {
  127. get { return Internal_getUseAutoAttenuation(mCachedPtr); }
  128. set { Internal_setUseAutoAttenuation(mCachedPtr, value); }
  129. }
  130. /// <summary>Returns world space bounds that completely encompass the light's area of influence.</summary>
  131. [ShowInInspector]
  132. public Sphere Bounds
  133. {
  134. get
  135. {
  136. Sphere temp;
  137. Internal_getBounds(mCachedPtr, out temp);
  138. return temp;
  139. }
  140. }
  141. [MethodImpl(MethodImplOptions.InternalCall)]
  142. private static extern void Internal_setType(IntPtr thisPtr, LightType type);
  143. [MethodImpl(MethodImplOptions.InternalCall)]
  144. private static extern LightType Internal_getType(IntPtr thisPtr);
  145. [MethodImpl(MethodImplOptions.InternalCall)]
  146. private static extern void Internal_setCastsShadow(IntPtr thisPtr, bool castsShadow);
  147. [MethodImpl(MethodImplOptions.InternalCall)]
  148. private static extern bool Internal_getCastsShadow(IntPtr thisPtr);
  149. [MethodImpl(MethodImplOptions.InternalCall)]
  150. private static extern void Internal_setShadowBias(IntPtr thisPtr, float bias);
  151. [MethodImpl(MethodImplOptions.InternalCall)]
  152. private static extern float Internal_getShadowBias(IntPtr thisPtr);
  153. [MethodImpl(MethodImplOptions.InternalCall)]
  154. private static extern void Internal_setColor(IntPtr thisPtr, ref Color color);
  155. [MethodImpl(MethodImplOptions.InternalCall)]
  156. private static extern void Internal_getColor(IntPtr thisPtr, out Color __output);
  157. [MethodImpl(MethodImplOptions.InternalCall)]
  158. private static extern void Internal_setAttenuationRadius(IntPtr thisPtr, float radius);
  159. [MethodImpl(MethodImplOptions.InternalCall)]
  160. private static extern float Internal_getAttenuationRadius(IntPtr thisPtr);
  161. [MethodImpl(MethodImplOptions.InternalCall)]
  162. private static extern void Internal_setSourceRadius(IntPtr thisPtr, float radius);
  163. [MethodImpl(MethodImplOptions.InternalCall)]
  164. private static extern float Internal_getSourceRadius(IntPtr thisPtr);
  165. [MethodImpl(MethodImplOptions.InternalCall)]
  166. private static extern void Internal_setIntensity(IntPtr thisPtr, float intensity);
  167. [MethodImpl(MethodImplOptions.InternalCall)]
  168. private static extern float Internal_getIntensity(IntPtr thisPtr);
  169. [MethodImpl(MethodImplOptions.InternalCall)]
  170. private static extern void Internal_setSpotAngle(IntPtr thisPtr, ref Degree spotAngle);
  171. [MethodImpl(MethodImplOptions.InternalCall)]
  172. private static extern void Internal_getSpotAngle(IntPtr thisPtr, out Degree __output);
  173. [MethodImpl(MethodImplOptions.InternalCall)]
  174. private static extern void Internal_setSpotFalloffAngle(IntPtr thisPtr, ref Degree spotAngle);
  175. [MethodImpl(MethodImplOptions.InternalCall)]
  176. private static extern void Internal_getSpotFalloffAngle(IntPtr thisPtr, out Degree __output);
  177. [MethodImpl(MethodImplOptions.InternalCall)]
  178. private static extern void Internal_setUseAutoAttenuation(IntPtr thisPtr, bool enabled);
  179. [MethodImpl(MethodImplOptions.InternalCall)]
  180. private static extern bool Internal_getUseAutoAttenuation(IntPtr thisPtr);
  181. [MethodImpl(MethodImplOptions.InternalCall)]
  182. private static extern void Internal_getBounds(IntPtr thisPtr, out Sphere __output);
  183. }
  184. /** @} */
  185. }