SceneLine.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. require "Polycode/SceneMesh"
  2. class "SceneLine" (SceneMesh)
  3. function SceneLine:SceneLine(...)
  4. local arg = {...}
  5. if type(arg[1]) == "table" and count(arg) == 1 then
  6. if ""..arg[1].__classname == "SceneMesh" then
  7. self.__ptr = arg[1].__ptr
  8. return
  9. end
  10. end
  11. for k,v in pairs(arg) do
  12. if type(v) == "table" then
  13. if v.__ptr ~= nil then
  14. arg[k] = v.__ptr
  15. end
  16. end
  17. end
  18. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  19. self.__ptr = Polycode.SceneLine(unpack(arg))
  20. end
  21. end
  22. function SceneLine:SceneLineWithPositions(startp, endp)
  23. local retVal = Polycode.SceneLine_SceneLineWithPositions(self.__ptr, startp.__ptr, endp.__ptr)
  24. if retVal == nil then return nil end
  25. local __c = _G["SceneLine"]("__skip_ptr__")
  26. __c.__ptr = retVal
  27. return __c
  28. end
  29. function SceneLine:setStart(startp)
  30. local retVal = Polycode.SceneLine_setStart(self.__ptr, startp.__ptr)
  31. end
  32. function SceneLine:setEnd(endp)
  33. local retVal = Polycode.SceneLine_setEnd(self.__ptr, endp.__ptr)
  34. end
  35. function SceneLine:Update()
  36. local retVal = Polycode.SceneLine_Update(self.__ptr)
  37. end
  38. function SceneLine:__delete()
  39. if self then Polycode.delete_SceneLine(self.__ptr) end
  40. end