Entity.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. class "Entity"
  2. function Entity:Entity()
  3. if self.__ptr == nil then
  4. self.__ptr = Polycore.Entity()
  5. end
  6. end
  7. function Entity:Render()
  8. return Polycore.Entity_Render(self.__ptr)
  9. end
  10. function Entity:Update()
  11. return Polycore.Entity_Update(self.__ptr)
  12. end
  13. function Entity:transformAndRender()
  14. return Polycore.Entity_transformAndRender(self.__ptr)
  15. end
  16. function Entity:setMatrix(matrix)
  17. return Polycore.Entity_setMatrix(self.__ptr, matrix.__ptr)
  18. end
  19. function Entity:rebuildTransformMatrix()
  20. return Polycore.Entity_rebuildTransformMatrix(self.__ptr)
  21. end
  22. function Entity:addEntity(newChild)
  23. return Polycore.Entity_addEntity(self.__ptr, newChild.__ptr)
  24. end
  25. function Entity:addChild(newChild)
  26. return Polycore.Entity_addChild(self.__ptr, newChild.__ptr)
  27. end
  28. function Entity:removeChild(entityToRemove)
  29. return Polycore.Entity_removeChild(self.__ptr, entityToRemove.__ptr)
  30. end
  31. function Entity:updateEntityMatrix()
  32. return Polycore.Entity_updateEntityMatrix(self.__ptr)
  33. end
  34. function Entity:renderChildren()
  35. return Polycore.Entity_renderChildren(self.__ptr)
  36. end
  37. function Entity:getPosition()
  38. return Polycore.Entity_getPosition(self.__ptr)
  39. end
  40. function Entity:setPosition(x, y, z)
  41. return Polycore.Entity_setPosition(self.__ptr, x, y, z)
  42. end
  43. function Entity:setPositionX(x)
  44. return Polycore.Entity_setPositionX(self.__ptr, x)
  45. end
  46. function Entity:setPositionY(y)
  47. return Polycore.Entity_setPositionY(self.__ptr, y)
  48. end
  49. function Entity:setPositionZ(z)
  50. return Polycore.Entity_setPositionZ(self.__ptr, z)
  51. end
  52. function Entity:setScaleX(x)
  53. return Polycore.Entity_setScaleX(self.__ptr, x)
  54. end
  55. function Entity:setScaleY(y)
  56. return Polycore.Entity_setScaleY(self.__ptr, y)
  57. end
  58. function Entity:setScaleZ(z)
  59. return Polycore.Entity_setScaleZ(self.__ptr, z)
  60. end
  61. function Entity:Translate(x, y, z)
  62. return Polycore.Entity_Translate(self.__ptr, x, y, z)
  63. end
  64. function Entity:Scale(x, y, z)
  65. return Polycore.Entity_Scale(self.__ptr, x, y, z)
  66. end
  67. function Entity:setScale(x, y, z)
  68. return Polycore.Entity_setScale(self.__ptr, x, y, z)
  69. end
  70. function Entity:getScale()
  71. return Polycore.Entity_getScale(self.__ptr)
  72. end
  73. function Entity:getCombinedPosition()
  74. return Polycore.Entity_getCombinedPosition(self.__ptr)
  75. end
  76. function Entity:getCombinedPitch()
  77. return Polycore.Entity_getCombinedPitch(self.__ptr)
  78. end
  79. function Entity:getCombinedYaw()
  80. return Polycore.Entity_getCombinedYaw(self.__ptr)
  81. end
  82. function Entity:getCombinedRoll()
  83. return Polycore.Entity_getCombinedRoll(self.__ptr)
  84. end
  85. function Entity:setParentEntity(entity)
  86. return Polycore.Entity_setParentEntity(self.__ptr, entity.__ptr)
  87. end
  88. function Entity:getParentEntity()
  89. return Polycore.Entity_getParentEntity(self.__ptr)
  90. end
  91. function Entity:rebuildRotation()
  92. return Polycore.Entity_rebuildRotation(self.__ptr)
  93. end
  94. function Entity:dirtyMatrix(val)
  95. return Polycore.Entity_dirtyMatrix(self.__ptr, val)
  96. end
  97. function Entity:setPitch(pitch)
  98. return Polycore.Entity_setPitch(self.__ptr, pitch)
  99. end
  100. function Entity:setYaw(yaw)
  101. return Polycore.Entity_setYaw(self.__ptr, yaw)
  102. end
  103. function Entity:setRoll(roll)
  104. return Polycore.Entity_setRoll(self.__ptr, roll)
  105. end
  106. function Entity:Roll(roll)
  107. return Polycore.Entity_Roll(self.__ptr, roll)
  108. end
  109. function Entity:Yaw(roll)
  110. return Polycore.Entity_Yaw(self.__ptr, roll)
  111. end
  112. function Entity:Pitch(roll)
  113. return Polycore.Entity_Pitch(self.__ptr, roll)
  114. end
  115. function Entity:getPitch()
  116. return Polycore.Entity_getPitch(self.__ptr)
  117. end
  118. function Entity:getYaw()
  119. return Polycore.Entity_getYaw(self.__ptr)
  120. end
  121. function Entity:getRoll()
  122. return Polycore.Entity_getRoll(self.__ptr)
  123. end
  124. function Entity:setRotationQuat(w, x, y, z)
  125. return Polycore.Entity_setRotationQuat(self.__ptr, w, x, y, z)
  126. end
  127. function Entity:getRotationQuat()
  128. return Polycore.Entity_getRotationQuat(self.__ptr)
  129. end
  130. function Entity:getTransformMatrix()
  131. return Polycore.Entity_getTransformMatrix(self.__ptr)
  132. end
  133. function Entity:getConcatenatedMatrix()
  134. return Polycore.Entity_getConcatenatedMatrix(self.__ptr)
  135. end
  136. function Entity:getConcatenatedRollMatrix()
  137. return Polycore.Entity_getConcatenatedRollMatrix(self.__ptr)
  138. end
  139. function Entity:setTransformByMatrix(matrix)
  140. return Polycore.Entity_setTransformByMatrix(self.__ptr, matrix.__ptr)
  141. end
  142. function Entity:setTransformByMatrixPure(matrix)
  143. return Polycore.Entity_setTransformByMatrixPure(self.__ptr, matrix.__ptr)
  144. end
  145. function Entity:setRenderer(r_enderer)
  146. return Polycore.Entity_setRenderer(self.__ptr, r_enderer.__ptr)
  147. end
  148. function Entity:getCombinedColor()
  149. return Polycore.Entity_getCombinedColor(self.__ptr)
  150. end
  151. function Entity:setColor(r, g, b, a)
  152. return Polycore.Entity_setColor(self.__ptr, r, g, b, a)
  153. end
  154. function Entity:setColorInt(r, g, b, a)
  155. return Polycore.Entity_setColorInt(self.__ptr, r, g, b, a)
  156. end
  157. function Entity:recalculateBBox()
  158. return Polycore.Entity_recalculateBBox(self.__ptr)
  159. end
  160. function Entity:getBBoxRadius()
  161. return Polycore.Entity_getBBoxRadius(self.__ptr)
  162. end
  163. function Entity:getCompoundBBoxRadius()
  164. return Polycore.Entity_getCompoundBBoxRadius(self.__ptr)
  165. end
  166. function Entity:setBBoxRadius(rad)
  167. return Polycore.Entity_setBBoxRadius(self.__ptr, rad)
  168. end
  169. function Entity:setBlendingMode(newBl_endingMode)
  170. return Polycore.Entity_setBlendingMode(self.__ptr, newBl_endingMode)
  171. end
  172. function Entity:getChildCenter()
  173. return Polycore.Entity_getChildCenter(self.__ptr)
  174. end
  175. function Entity:setDepthWrite(val)
  176. return Polycore.Entity_setDepthWrite(self.__ptr, val)
  177. end
  178. function Entity:doUpdates()
  179. return Polycore.Entity_doUpdates(self.__ptr)
  180. end
  181. function Entity:lookAt(loc, upVector)
  182. return Polycore.Entity_lookAt(self.__ptr, loc.__ptr, upVector.__ptr)
  183. end
  184. function Entity:lookAtEntity(entity, upVector)
  185. return Polycore.Entity_lookAtEntity(self.__ptr, entity.__ptr, upVector.__ptr)
  186. end
  187. function Entity:getLookAtMatrix(loc, upVector)
  188. return Polycore.Entity_getLookAtMatrix(self.__ptr, loc.__ptr, upVector.__ptr)
  189. end
  190. function Entity:buildPositionMatrix()
  191. return Polycore.Entity_buildPositionMatrix(self.__ptr)
  192. end
  193. function Entity:adjustMatrixForChildren()
  194. return Polycore.Entity_adjustMatrixForChildren(self.__ptr)
  195. end
  196. function Entity:setMask(mask)
  197. return Polycore.Entity_setMask(self.__ptr, mask.__ptr)
  198. end
  199. function Entity:clearMask()
  200. return Polycore.Entity_clearMask(self.__ptr)
  201. end
  202. function Entity:getCompoundScale()
  203. return Polycore.Entity_getCompoundScale(self.__ptr)
  204. end
  205. function Entity:getEntityProp(propName)
  206. return Polycore.Entity_getEntityProp(self.__ptr, propName)
  207. end