SceneMesh.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. require "Polycode/SceneEntity"
  2. class "SceneMesh" (SceneEntity)
  3. function SceneMesh:SceneMesh(fileName)
  4. if self.__ptr == nil then
  5. self.__ptr = Polycore.SceneMesh(fileName)
  6. end
  7. end
  8. function SceneMesh:Render()
  9. return Polycore.SceneMesh_Render(self.__ptr)
  10. end
  11. function SceneMesh:getLocalShaderOptions()
  12. return Polycore.SceneMesh_getLocalShaderOptions(self.__ptr)
  13. end
  14. function SceneMesh:getMesh()
  15. return Polycore.SceneMesh_getMesh(self.__ptr)
  16. end
  17. function SceneMesh:getTexture()
  18. return Polycore.SceneMesh_getTexture(self.__ptr)
  19. end
  20. function SceneMesh:getMaterial()
  21. return Polycore.SceneMesh_getMaterial(self.__ptr)
  22. end
  23. function SceneMesh:loadTexture(fileName, clamp)
  24. return Polycore.SceneMesh_loadTexture(self.__ptr, fileName, clamp)
  25. end
  26. function SceneMesh:loadSkeleton(fileName)
  27. return Polycore.SceneMesh_loadSkeleton(self.__ptr, fileName)
  28. end
  29. function SceneMesh:setTexture(texture)
  30. return Polycore.SceneMesh_setTexture(self.__ptr, texture.__ptr)
  31. end
  32. function SceneMesh:setMaterial(material)
  33. return Polycore.SceneMesh_setMaterial(self.__ptr, material.__ptr)
  34. end
  35. function SceneMesh:setMesh(mesh)
  36. return Polycore.SceneMesh_setMesh(self.__ptr, mesh.__ptr)
  37. end
  38. function SceneMesh:setSkeleton(skeleton)
  39. return Polycore.SceneMesh_setSkeleton(self.__ptr, skeleton.__ptr)
  40. end
  41. function SceneMesh:getSkeleton()
  42. return Polycore.SceneMesh_getSkeleton(self.__ptr)
  43. end
  44. function SceneMesh:renderMeshLocally()
  45. return Polycore.SceneMesh_renderMeshLocally(self.__ptr)
  46. end
  47. function SceneMesh:cacheToVertexBuffer(cache)
  48. return Polycore.SceneMesh_cacheToVertexBuffer(self.__ptr, cache)
  49. end