2
0

LightInfoBinding.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. class "LightInfoBinding"
  2. function LightInfoBinding:__getvar(name)
  3. if name == "position" then
  4. local retVal = Polycode.LightInfoBinding_get_position(self.__ptr)
  5. if retVal == nil then return nil end
  6. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  7. __c.__ptr = retVal
  8. return __c
  9. elseif name == "direction" then
  10. local retVal = Polycode.LightInfoBinding_get_direction(self.__ptr)
  11. if retVal == nil then return nil end
  12. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  13. __c.__ptr = retVal
  14. return __c
  15. elseif name == "specular" then
  16. local retVal = Polycode.LightInfoBinding_get_specular(self.__ptr)
  17. if retVal == nil then return nil end
  18. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  19. __c.__ptr = retVal
  20. return __c
  21. elseif name == "diffuse" then
  22. local retVal = Polycode.LightInfoBinding_get_diffuse(self.__ptr)
  23. if retVal == nil then return nil end
  24. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  25. __c.__ptr = retVal
  26. return __c
  27. elseif name == "spotExponent" then
  28. local retVal = Polycode.LightInfoBinding_get_spotExponent(self.__ptr)
  29. if retVal == nil then return nil end
  30. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  31. __c.__ptr = retVal
  32. return __c
  33. elseif name == "spotCosCutoff" then
  34. local retVal = Polycode.LightInfoBinding_get_spotCosCutoff(self.__ptr)
  35. if retVal == nil then return nil end
  36. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  37. __c.__ptr = retVal
  38. return __c
  39. elseif name == "constantAttenuation" then
  40. local retVal = Polycode.LightInfoBinding_get_constantAttenuation(self.__ptr)
  41. if retVal == nil then return nil end
  42. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  43. __c.__ptr = retVal
  44. return __c
  45. elseif name == "linearAttenuation" then
  46. local retVal = Polycode.LightInfoBinding_get_linearAttenuation(self.__ptr)
  47. if retVal == nil then return nil end
  48. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  49. __c.__ptr = retVal
  50. return __c
  51. elseif name == "quadraticAttenuation" then
  52. local retVal = Polycode.LightInfoBinding_get_quadraticAttenuation(self.__ptr)
  53. if retVal == nil then return nil end
  54. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  55. __c.__ptr = retVal
  56. return __c
  57. elseif name == "shadowEnabled" then
  58. local retVal = Polycode.LightInfoBinding_get_shadowEnabled(self.__ptr)
  59. if retVal == nil then return nil end
  60. local __c = _G["LocalShaderParam"]("__skip_ptr__")
  61. __c.__ptr = retVal
  62. return __c
  63. end
  64. end
  65. function LightInfoBinding:__setvar(name,value)
  66. if name == "position" then
  67. Polycode.LightInfoBinding_set_position(self.__ptr, value.__ptr)
  68. return true
  69. elseif name == "direction" then
  70. Polycode.LightInfoBinding_set_direction(self.__ptr, value.__ptr)
  71. return true
  72. elseif name == "specular" then
  73. Polycode.LightInfoBinding_set_specular(self.__ptr, value.__ptr)
  74. return true
  75. elseif name == "diffuse" then
  76. Polycode.LightInfoBinding_set_diffuse(self.__ptr, value.__ptr)
  77. return true
  78. elseif name == "spotExponent" then
  79. Polycode.LightInfoBinding_set_spotExponent(self.__ptr, value.__ptr)
  80. return true
  81. elseif name == "spotCosCutoff" then
  82. Polycode.LightInfoBinding_set_spotCosCutoff(self.__ptr, value.__ptr)
  83. return true
  84. elseif name == "constantAttenuation" then
  85. Polycode.LightInfoBinding_set_constantAttenuation(self.__ptr, value.__ptr)
  86. return true
  87. elseif name == "linearAttenuation" then
  88. Polycode.LightInfoBinding_set_linearAttenuation(self.__ptr, value.__ptr)
  89. return true
  90. elseif name == "quadraticAttenuation" then
  91. Polycode.LightInfoBinding_set_quadraticAttenuation(self.__ptr, value.__ptr)
  92. return true
  93. elseif name == "shadowEnabled" then
  94. Polycode.LightInfoBinding_set_shadowEnabled(self.__ptr, value.__ptr)
  95. return true
  96. end
  97. return false
  98. end
  99. function LightInfoBinding:__delete()
  100. if self then Polycode.delete_LightInfoBinding(self.__ptr) end
  101. end