Camera.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. require "Polycode/SceneEntity"
  2. class "Camera" (SceneEntity)
  3. function Camera:Camera(...)
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycore.Camera(unpack(arg))
  13. end
  14. end
  15. function Camera:buildFrustrumPlanes()
  16. local retVal = Polycore.Camera_buildFrustrumPlanes(self.__ptr)
  17. end
  18. function Camera:isSphereInFrustrum(pos, fRadius)
  19. local retVal = Polycore.Camera_isSphereInFrustrum(self.__ptr, pos.__ptr, fRadius)
  20. return retVal
  21. end
  22. function Camera:canSee(entity)
  23. local retVal = Polycore.Camera_canSee(self.__ptr, entity.__ptr)
  24. return retVal
  25. end
  26. function Camera:setOrthoMode(mode)
  27. local retVal = Polycore.Camera_setOrthoMode(self.__ptr, mode)
  28. end
  29. function Camera:getOrthoMode()
  30. local retVal = Polycore.Camera_getOrthoMode(self.__ptr)
  31. return retVal
  32. end
  33. function Camera:setFOV(fov)
  34. local retVal = Polycore.Camera_setFOV(self.__ptr, fov)
  35. end
  36. function Camera:getFOV()
  37. local retVal = Polycore.Camera_getFOV(self.__ptr)
  38. return retVal
  39. end
  40. function Camera:setParentScene(parentScene)
  41. local retVal = Polycore.Camera_setParentScene(self.__ptr, parentScene.__ptr)
  42. end
  43. function Camera:doCameraTransform()
  44. local retVal = Polycore.Camera_doCameraTransform(self.__ptr)
  45. end
  46. function Camera:setLightDepthTexture(texture)
  47. local retVal = Polycore.Camera_setLightDepthTexture(self.__ptr, texture.__ptr)
  48. end
  49. function Camera:hasFilterShader()
  50. local retVal = Polycore.Camera_hasFilterShader(self.__ptr)
  51. return retVal
  52. end
  53. function Camera:drawFilter()
  54. local retVal = Polycore.Camera_drawFilter(self.__ptr)
  55. end
  56. function Camera:setExposureLevel(level)
  57. local retVal = Polycore.Camera_setExposureLevel(self.__ptr, level)
  58. end
  59. function Camera:getExposureLevel()
  60. local retVal = Polycore.Camera_getExposureLevel(self.__ptr)
  61. return retVal
  62. end
  63. function Camera:createPostFilter(shaderMaterial)
  64. local retVal = Polycore.Camera_createPostFilter(self.__ptr, shaderMaterial.__ptr)
  65. end
  66. function Camera:setPostFilter(shaderName)
  67. local retVal = Polycore.Camera_setPostFilter(self.__ptr, shaderName)
  68. end