Light.pkg 3.0 KB

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