Light.pkg 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. $#include "Light.h"
  2. /// %Light types.
  3. enum LightType
  4. {
  5. LIGHT_DIRECTIONAL = 0,
  6. LIGHT_SPOT,
  7. LIGHT_POINT
  8. };
  9. /// %Light component.
  10. class Light : public Drawable
  11. {
  12. public:
  13. /// Set light type.
  14. void SetLightType(LightType type);
  15. /// Set vertex lighting mode.
  16. void SetPerVertex(bool enable);
  17. /// Set color.
  18. void SetColor(const Color& color);
  19. /// Set specular intensity.
  20. void SetSpecularIntensity(float intensity);
  21. /// Set range.
  22. void SetRange(float range);
  23. /// Set spotlight field of view.
  24. void SetFov(float fov);
  25. /// Set spotlight aspect ratio.
  26. void SetAspectRatio(float aspectRatio);
  27. /// Set fade out start distance.
  28. void SetFadeDistance(float distance);
  29. /// Set shadow fade out start distance. Only has effect if shadow distance is also non-zero.
  30. void SetShadowFadeDistance(float distance);
  31. /// Set shadow depth bias parameters.
  32. void SetShadowBias(const BiasParameters& parameters);
  33. /// Set directional light cascaded shadow parameters.
  34. void SetShadowCascade(const CascadeParameters& parameters);
  35. /// Set shadow map focusing parameters.
  36. void SetShadowFocus(const FocusParameters& parameters);
  37. /// Set shadow intensity between 0.0 - 1.0. 0.0 (the default) gives fully dark shadows.
  38. void SetShadowIntensity(float intensity);
  39. /// Set shadow resolution between 0.25 - 1.0. Determines the shadow map to use.
  40. void SetShadowResolution(float resolution);
  41. /// Set shadow camera near/far clip distance ratio.
  42. void SetShadowNearFarRatio(float nearFarRatio);
  43. /// Set range attenuation texture.
  44. void SetRampTexture(Texture* texture);
  45. /// Set spotlight attenuation texture.
  46. void SetShapeTexture(Texture* texture);
  47. /// Return light type.
  48. LightType GetLightType() const;
  49. /// Return vertex lighting mode.
  50. bool GetPerVertex() const;
  51. /// Return color.
  52. const Color& GetColor() const;
  53. /// Return specular intensity.
  54. float GetSpecularIntensity() const;
  55. /// Return range.
  56. float GetRange() const;
  57. /// Return spotlight field of view.
  58. float GetFov() const;
  59. /// Return spotlight aspect ratio.
  60. float GetAspectRatio() const;
  61. /// Return fade start distance.
  62. float GetFadeDistance() const;
  63. /// Return shadow fade start distance.
  64. float GetShadowFadeDistance() const;
  65. /// Return shadow depth bias parameters.
  66. const BiasParameters& GetShadowBias() const;
  67. /// Return directional light cascaded shadow parameters.
  68. const CascadeParameters& GetShadowCascade() const;
  69. /// Return shadow map focus parameters.
  70. const FocusParameters& GetShadowFocus() const;
  71. /// Return shadow intensity.
  72. float GetShadowIntensity() const;
  73. /// Return shadow resolution.
  74. float GetShadowResolution() const;
  75. /// Return shadow camera near/far clip distance ratio.
  76. float GetShadowNearFarRatio() const;
  77. /// Return range attenuation texture.
  78. Texture* GetRampTexture() const;
  79. /// Return spotlight attenuation texture.
  80. Texture* GetShapeTexture() const;
  81. /// Return spotlight frustum.
  82. Frustum GetFrustum() const;
  83. };