CLight.generated.cs 7.9 KB

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