Light.pkg 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. $#include "Light.h"
  2. enum LightType
  3. {
  4. LIGHT_DIRECTIONAL = 0,
  5. LIGHT_SPOT,
  6. LIGHT_POINT
  7. };
  8. struct BiasParameters
  9. {
  10. BiasParameters();
  11. BiasParameters(float constantBias, float slopeScaledBias);
  12. ~BiasParameters();
  13. };
  14. struct CascadeParameters
  15. {
  16. CascadeParameters();
  17. CascadeParameters(float split1, float split2, float split3, float split4, float fadeStart, float biasAutoAdjust = 1.0f);
  18. ~CascadeParameters();
  19. };
  20. struct FocusParameters
  21. {
  22. FocusParameters();
  23. FocusParameters(bool focus, bool nonUniform, bool autoSize, float quantize, float minView);
  24. ~FocusParameters();
  25. };
  26. class Light : public Drawable
  27. {
  28. void SetLightType(LightType type);
  29. void SetPerVertex(bool enable);
  30. void SetColor(const Color& color);
  31. void SetSpecularIntensity(float intensity);
  32. void SetRange(float range);
  33. void SetFov(float fov);
  34. void SetAspectRatio(float aspectRatio);
  35. void SetFadeDistance(float distance);
  36. void SetShadowFadeDistance(float distance);
  37. void SetShadowBias(const BiasParameters& parameters);
  38. void SetShadowCascade(const CascadeParameters& parameters);
  39. void SetShadowFocus(const FocusParameters& parameters);
  40. void SetShadowIntensity(float intensity);
  41. void SetShadowResolution(float resolution);
  42. void SetShadowNearFarRatio(float nearFarRatio);
  43. void SetRampTexture(Texture* texture);
  44. void SetShapeTexture(Texture* texture);
  45. LightType GetLightType() const;
  46. bool GetPerVertex() const;
  47. const Color& GetColor() const;
  48. float GetSpecularIntensity() const;
  49. float GetRange() const;
  50. float GetFov() const;
  51. float GetAspectRatio() const;
  52. float GetFadeDistance() const;
  53. float GetShadowFadeDistance() const;
  54. const BiasParameters& GetShadowBias() const;
  55. const CascadeParameters& GetShadowCascade() const;
  56. const FocusParameters& GetShadowFocus() const;
  57. float GetShadowIntensity() const;
  58. float GetShadowResolution() const;
  59. float GetShadowNearFarRatio() const;
  60. Texture* GetRampTexture() const;
  61. Texture* GetShapeTexture() const;
  62. Frustum GetFrustum() const;
  63. tolua_property__get_set LightType lightType;
  64. tolua_property__get_set bool perVertex;
  65. tolua_property__get_set Color& color;
  66. tolua_property__get_set float specularIntensity;
  67. tolua_property__get_set float range;
  68. tolua_property__get_set float fov;
  69. tolua_property__get_set float aspectRatio;
  70. tolua_property__get_set float fadeDistance;
  71. tolua_property__get_set float shadowFadeDistance;
  72. tolua_property__get_set BiasParameters& shadowBias;
  73. tolua_property__get_set CascadeParameters& shadowCascade;
  74. tolua_property__get_set FocusParameters& shadowFocus;
  75. tolua_property__get_set float shadowIntensity;
  76. tolua_property__get_set float shadowResolution;
  77. tolua_property__get_set float shadowNearFarRatio;
  78. tolua_property__get_set Texture* rampTexture;
  79. tolua_property__get_set Texture* shapeTexture;
  80. tolua_readonly tolua_property__get_set Frustum frustum;
  81. };