Camera.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. Polycore.__ptr_lookup[self.__ptr] = self
  14. end
  15. end
  16. function Camera:buildFrustrumPlanes()
  17. local retVal = Polycore.Camera_buildFrustrumPlanes(self.__ptr)
  18. end
  19. function Camera:isSphereInFrustrum(pos, fRadius)
  20. local retVal = Polycore.Camera_isSphereInFrustrum(self.__ptr, pos.__ptr, fRadius)
  21. return retVal
  22. end
  23. function Camera:canSee(entity)
  24. local retVal = Polycore.Camera_canSee(self.__ptr, entity.__ptr)
  25. return retVal
  26. end
  27. function Camera:setOrthoMode(mode)
  28. local retVal = Polycore.Camera_setOrthoMode(self.__ptr, mode)
  29. end
  30. function Camera:getOrthoMode()
  31. local retVal = Polycore.Camera_getOrthoMode(self.__ptr)
  32. return retVal
  33. end
  34. function Camera:setFOV(fov)
  35. local retVal = Polycore.Camera_setFOV(self.__ptr, fov)
  36. end
  37. function Camera:getFOV()
  38. local retVal = Polycore.Camera_getFOV(self.__ptr)
  39. return retVal
  40. end
  41. function Camera:setParentScene(parentScene)
  42. local retVal = Polycore.Camera_setParentScene(self.__ptr, parentScene.__ptr)
  43. end
  44. function Camera:doCameraTransform()
  45. local retVal = Polycore.Camera_doCameraTransform(self.__ptr)
  46. end
  47. function Camera:setLightDepthTexture(texture)
  48. local retVal = Polycore.Camera_setLightDepthTexture(self.__ptr, texture.__ptr)
  49. end
  50. function Camera:hasFilterShader()
  51. local retVal = Polycore.Camera_hasFilterShader(self.__ptr)
  52. return retVal
  53. end
  54. function Camera:drawFilter()
  55. local retVal = Polycore.Camera_drawFilter(self.__ptr)
  56. end
  57. function Camera:setExposureLevel(level)
  58. local retVal = Polycore.Camera_setExposureLevel(self.__ptr, level)
  59. end
  60. function Camera:getExposureLevel()
  61. local retVal = Polycore.Camera_getExposureLevel(self.__ptr)
  62. return retVal
  63. end
  64. function Camera:createPostFilter(shaderMaterial)
  65. local retVal = Polycore.Camera_createPostFilter(self.__ptr, shaderMaterial.__ptr)
  66. end
  67. function Camera:setPostFilter(shaderName)
  68. local retVal = Polycore.Camera_setPostFilter(self.__ptr, shaderName)
  69. end