LightInfo.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. class "LightInfo"
  2. function LightInfo:__getvar(name)
  3. if name == "importance" then
  4. return Polycode.LightInfo_get_importance(self.__ptr)
  5. elseif name == "position" then
  6. local retVal = Polycode.LightInfo_get_position(self.__ptr)
  7. if retVal == nil then return nil end
  8. local __c = _G["Vector3"]("__skip_ptr__")
  9. __c.__ptr = retVal
  10. return __c
  11. elseif name == "direction" then
  12. local retVal = Polycode.LightInfo_get_direction(self.__ptr)
  13. if retVal == nil then return nil end
  14. local __c = _G["Vector3"]("__skip_ptr__")
  15. __c.__ptr = retVal
  16. return __c
  17. elseif name == "type" then
  18. return Polycode.LightInfo_get_type(self.__ptr)
  19. elseif name == "diffuseColor" then
  20. local retVal = Polycode.LightInfo_get_diffuseColor(self.__ptr)
  21. if retVal == nil then return nil end
  22. local __c = _G["Color"]("__skip_ptr__")
  23. __c.__ptr = retVal
  24. return __c
  25. elseif name == "specularColor" then
  26. local retVal = Polycode.LightInfo_get_specularColor(self.__ptr)
  27. if retVal == nil then return nil end
  28. local __c = _G["Color"]("__skip_ptr__")
  29. __c.__ptr = retVal
  30. return __c
  31. elseif name == "constantAttenuation" then
  32. return Polycode.LightInfo_get_constantAttenuation(self.__ptr)
  33. elseif name == "linearAttenuation" then
  34. return Polycode.LightInfo_get_linearAttenuation(self.__ptr)
  35. elseif name == "quadraticAttenuation" then
  36. return Polycode.LightInfo_get_quadraticAttenuation(self.__ptr)
  37. elseif name == "intensity" then
  38. return Polycode.LightInfo_get_intensity(self.__ptr)
  39. elseif name == "spotlightCutoff" then
  40. return Polycode.LightInfo_get_spotlightCutoff(self.__ptr)
  41. elseif name == "spotlightExponent" then
  42. return Polycode.LightInfo_get_spotlightExponent(self.__ptr)
  43. elseif name == "shadowsEnabled" then
  44. return Polycode.LightInfo_get_shadowsEnabled(self.__ptr)
  45. elseif name == "lightViewMatrix" then
  46. local retVal = Polycode.LightInfo_get_lightViewMatrix(self.__ptr)
  47. if retVal == nil then return nil end
  48. local __c = _G["Matrix4"]("__skip_ptr__")
  49. __c.__ptr = retVal
  50. return __c
  51. end
  52. end
  53. function LightInfo:__setvar(name,value)
  54. if name == "importance" then
  55. Polycode.LightInfo_set_importance(self.__ptr, value)
  56. return true
  57. elseif name == "position" then
  58. Polycode.LightInfo_set_position(self.__ptr, value.__ptr)
  59. return true
  60. elseif name == "direction" then
  61. Polycode.LightInfo_set_direction(self.__ptr, value.__ptr)
  62. return true
  63. elseif name == "type" then
  64. Polycode.LightInfo_set_type(self.__ptr, value)
  65. return true
  66. elseif name == "diffuseColor" then
  67. Polycode.LightInfo_set_diffuseColor(self.__ptr, value.__ptr)
  68. return true
  69. elseif name == "specularColor" then
  70. Polycode.LightInfo_set_specularColor(self.__ptr, value.__ptr)
  71. return true
  72. elseif name == "constantAttenuation" then
  73. Polycode.LightInfo_set_constantAttenuation(self.__ptr, value)
  74. return true
  75. elseif name == "linearAttenuation" then
  76. Polycode.LightInfo_set_linearAttenuation(self.__ptr, value)
  77. return true
  78. elseif name == "quadraticAttenuation" then
  79. Polycode.LightInfo_set_quadraticAttenuation(self.__ptr, value)
  80. return true
  81. elseif name == "intensity" then
  82. Polycode.LightInfo_set_intensity(self.__ptr, value)
  83. return true
  84. elseif name == "spotlightCutoff" then
  85. Polycode.LightInfo_set_spotlightCutoff(self.__ptr, value)
  86. return true
  87. elseif name == "spotlightExponent" then
  88. Polycode.LightInfo_set_spotlightExponent(self.__ptr, value)
  89. return true
  90. elseif name == "shadowsEnabled" then
  91. Polycode.LightInfo_set_shadowsEnabled(self.__ptr, value)
  92. return true
  93. elseif name == "lightViewMatrix" then
  94. Polycode.LightInfo_set_lightViewMatrix(self.__ptr, value.__ptr)
  95. return true
  96. end
  97. return false
  98. end
  99. function LightInfo:__delete()
  100. if self then Polycode.delete_LightInfo(self.__ptr) end
  101. end