CLight.generated.cs 8.1 KB

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