BoneTrack.lua 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. class "BoneTrack"
  2. function BoneTrack:__getvar(name)
  3. if name == "scaleX" then
  4. local retVal = Polycode.BoneTrack_get_scaleX(self.__ptr)
  5. if retVal == nil then return nil end
  6. local __c = _G["BezierCurve"]("__skip_ptr__")
  7. __c.__ptr = retVal
  8. return __c
  9. elseif name == "scaleY" then
  10. local retVal = Polycode.BoneTrack_get_scaleY(self.__ptr)
  11. if retVal == nil then return nil end
  12. local __c = _G["BezierCurve"]("__skip_ptr__")
  13. __c.__ptr = retVal
  14. return __c
  15. elseif name == "scaleZ" then
  16. local retVal = Polycode.BoneTrack_get_scaleZ(self.__ptr)
  17. if retVal == nil then return nil end
  18. local __c = _G["BezierCurve"]("__skip_ptr__")
  19. __c.__ptr = retVal
  20. return __c
  21. elseif name == "QuatW" then
  22. local retVal = Polycode.BoneTrack_get_QuatW(self.__ptr)
  23. if retVal == nil then return nil end
  24. local __c = _G["BezierCurve"]("__skip_ptr__")
  25. __c.__ptr = retVal
  26. return __c
  27. elseif name == "QuatX" then
  28. local retVal = Polycode.BoneTrack_get_QuatX(self.__ptr)
  29. if retVal == nil then return nil end
  30. local __c = _G["BezierCurve"]("__skip_ptr__")
  31. __c.__ptr = retVal
  32. return __c
  33. elseif name == "QuatY" then
  34. local retVal = Polycode.BoneTrack_get_QuatY(self.__ptr)
  35. if retVal == nil then return nil end
  36. local __c = _G["BezierCurve"]("__skip_ptr__")
  37. __c.__ptr = retVal
  38. return __c
  39. elseif name == "QuatZ" then
  40. local retVal = Polycode.BoneTrack_get_QuatZ(self.__ptr)
  41. if retVal == nil then return nil end
  42. local __c = _G["BezierCurve"]("__skip_ptr__")
  43. __c.__ptr = retVal
  44. return __c
  45. elseif name == "LocX" then
  46. local retVal = Polycode.BoneTrack_get_LocX(self.__ptr)
  47. if retVal == nil then return nil end
  48. local __c = _G["BezierCurve"]("__skip_ptr__")
  49. __c.__ptr = retVal
  50. return __c
  51. elseif name == "LocY" then
  52. local retVal = Polycode.BoneTrack_get_LocY(self.__ptr)
  53. if retVal == nil then return nil end
  54. local __c = _G["BezierCurve"]("__skip_ptr__")
  55. __c.__ptr = retVal
  56. return __c
  57. elseif name == "LocZ" then
  58. local retVal = Polycode.BoneTrack_get_LocZ(self.__ptr)
  59. if retVal == nil then return nil end
  60. local __c = _G["BezierCurve"]("__skip_ptr__")
  61. __c.__ptr = retVal
  62. return __c
  63. elseif name == "position" then
  64. local retVal = Polycode.BoneTrack_get_position(self.__ptr)
  65. if retVal == nil then return nil end
  66. local __c = _G["Vector3"]("__skip_ptr__")
  67. __c.__ptr = retVal
  68. return __c
  69. elseif name == "scale" then
  70. local retVal = Polycode.BoneTrack_get_scale(self.__ptr)
  71. if retVal == nil then return nil end
  72. local __c = _G["Vector3"]("__skip_ptr__")
  73. __c.__ptr = retVal
  74. return __c
  75. elseif name == "boneQuat" then
  76. local retVal = Polycode.BoneTrack_get_boneQuat(self.__ptr)
  77. if retVal == nil then return nil end
  78. local __c = _G["Quaternion"]("__skip_ptr__")
  79. __c.__ptr = retVal
  80. return __c
  81. elseif name == "quatCurve" then
  82. local retVal = Polycode.BoneTrack_get_quatCurve(self.__ptr)
  83. if retVal == nil then return nil end
  84. local __c = _G["QuaternionCurve"]("__skip_ptr__")
  85. __c.__ptr = retVal
  86. return __c
  87. elseif name == "weight" then
  88. return Polycode.BoneTrack_get_weight(self.__ptr)
  89. end
  90. end
  91. function BoneTrack:__setvar(name,value)
  92. if name == "scaleX" then
  93. Polycode.BoneTrack_set_scaleX(self.__ptr, value.__ptr)
  94. return true
  95. elseif name == "scaleY" then
  96. Polycode.BoneTrack_set_scaleY(self.__ptr, value.__ptr)
  97. return true
  98. elseif name == "scaleZ" then
  99. Polycode.BoneTrack_set_scaleZ(self.__ptr, value.__ptr)
  100. return true
  101. elseif name == "QuatW" then
  102. Polycode.BoneTrack_set_QuatW(self.__ptr, value.__ptr)
  103. return true
  104. elseif name == "QuatX" then
  105. Polycode.BoneTrack_set_QuatX(self.__ptr, value.__ptr)
  106. return true
  107. elseif name == "QuatY" then
  108. Polycode.BoneTrack_set_QuatY(self.__ptr, value.__ptr)
  109. return true
  110. elseif name == "QuatZ" then
  111. Polycode.BoneTrack_set_QuatZ(self.__ptr, value.__ptr)
  112. return true
  113. elseif name == "LocX" then
  114. Polycode.BoneTrack_set_LocX(self.__ptr, value.__ptr)
  115. return true
  116. elseif name == "LocY" then
  117. Polycode.BoneTrack_set_LocY(self.__ptr, value.__ptr)
  118. return true
  119. elseif name == "LocZ" then
  120. Polycode.BoneTrack_set_LocZ(self.__ptr, value.__ptr)
  121. return true
  122. elseif name == "position" then
  123. Polycode.BoneTrack_set_position(self.__ptr, value.__ptr)
  124. return true
  125. elseif name == "scale" then
  126. Polycode.BoneTrack_set_scale(self.__ptr, value.__ptr)
  127. return true
  128. elseif name == "boneQuat" then
  129. Polycode.BoneTrack_set_boneQuat(self.__ptr, value.__ptr)
  130. return true
  131. elseif name == "quatCurve" then
  132. Polycode.BoneTrack_set_quatCurve(self.__ptr, value.__ptr)
  133. return true
  134. elseif name == "weight" then
  135. Polycode.BoneTrack_set_weight(self.__ptr, value)
  136. return true
  137. end
  138. return false
  139. end
  140. function BoneTrack:BoneTrack(...)
  141. local arg = {...}
  142. for k,v in pairs(arg) do
  143. if type(v) == "table" then
  144. if v.__ptr ~= nil then
  145. arg[k] = v.__ptr
  146. end
  147. end
  148. end
  149. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  150. self.__ptr = Polycode.BoneTrack(unpack(arg))
  151. end
  152. end
  153. function BoneTrack:Play(once)
  154. local retVal = Polycode.BoneTrack_Play(self.__ptr, once)
  155. end
  156. function BoneTrack:Stop()
  157. local retVal = Polycode.BoneTrack_Stop(self.__ptr)
  158. end
  159. function BoneTrack:Update(elapsed)
  160. local retVal = Polycode.BoneTrack_Update(self.__ptr, elapsed)
  161. end
  162. function BoneTrack:Reset()
  163. local retVal = Polycode.BoneTrack_Reset(self.__ptr)
  164. end
  165. function BoneTrack:setSpeed(speed)
  166. local retVal = Polycode.BoneTrack_setSpeed(self.__ptr, speed)
  167. end
  168. function BoneTrack:__delete()
  169. if self then Polycode.delete_BoneTrack(self.__ptr) end
  170. end