Light.pkg 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 SetBrightness(float brightness);
  33. void SetRange(float range);
  34. void SetFov(float fov);
  35. void SetAspectRatio(float aspectRatio);
  36. void SetFadeDistance(float distance);
  37. void SetShadowFadeDistance(float distance);
  38. void SetShadowBias(const BiasParameters& parameters);
  39. void SetShadowCascade(const CascadeParameters& parameters);
  40. void SetShadowFocus(const FocusParameters& parameters);
  41. void SetShadowIntensity(float intensity);
  42. void SetShadowResolution(float resolution);
  43. void SetShadowNearFarRatio(float nearFarRatio);
  44. void SetRampTexture(Texture* texture);
  45. void SetShapeTexture(Texture* texture);
  46. LightType GetLightType() const;
  47. bool GetPerVertex() const;
  48. const Color& GetColor() const;
  49. float GetSpecularIntensity() const;
  50. float GetBrightness() const;
  51. Color GetEffectiveColor() const;
  52. float GetEffectiveSpecularIntensity() const;
  53. float GetRange() const;
  54. float GetFov() const;
  55. float GetAspectRatio() const;
  56. float GetFadeDistance() const;
  57. float GetShadowFadeDistance() const;
  58. const BiasParameters& GetShadowBias() const;
  59. const CascadeParameters& GetShadowCascade() const;
  60. const FocusParameters& GetShadowFocus() const;
  61. float GetShadowIntensity() const;
  62. float GetShadowResolution() const;
  63. float GetShadowNearFarRatio() const;
  64. Texture* GetRampTexture() const;
  65. Texture* GetShapeTexture() const;
  66. Frustum GetFrustum() const;
  67. int GetNumShadowSplits() const;
  68. bool IsNegative() const;
  69. tolua_property__get_set LightType lightType;
  70. tolua_property__get_set bool perVertex;
  71. tolua_property__get_set Color& color;
  72. tolua_property__get_set float specularIntensity;
  73. tolua_property__get_set float brightness;
  74. tolua_property__get_set float range;
  75. tolua_property__get_set float fov;
  76. tolua_property__get_set float aspectRatio;
  77. tolua_property__get_set float fadeDistance;
  78. tolua_property__get_set float shadowFadeDistance;
  79. tolua_property__get_set BiasParameters& shadowBias;
  80. tolua_property__get_set CascadeParameters& shadowCascade;
  81. tolua_property__get_set FocusParameters& shadowFocus;
  82. tolua_property__get_set float shadowIntensity;
  83. tolua_property__get_set float shadowResolution;
  84. tolua_property__get_set float shadowNearFarRatio;
  85. tolua_property__get_set Texture* rampTexture;
  86. tolua_property__get_set Texture* shapeTexture;
  87. tolua_readonly tolua_property__get_set Frustum frustum;
  88. tolua_readonly tolua_property__get_set int numShadowSplits;
  89. tolua_readonly tolua_property__is_set bool negative;
  90. tolua_readonly tolua_property__get_set Color effectiveColor;
  91. tolua_readonly tolua_property__get_set float effectiveSpecularIntensity;
  92. };