Entity.lua 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. require "Polycode/EventDispatcher"
  2. class "Entity" (EventDispatcher)
  3. function Entity:__getvar(name)
  4. if name == "ownsChildren" then
  5. return Polycode.Entity_get_ownsChildren(self.__ptr)
  6. elseif name == "billboardMode" then
  7. return Polycode.Entity_get_billboardMode(self.__ptr)
  8. elseif name == "color" then
  9. local retVal = Polycode.Entity_get_color(self.__ptr)
  10. if retVal == nil then return nil end
  11. local __c = _G["Color"]("__skip_ptr__")
  12. __c.__ptr = retVal
  13. return __c
  14. elseif name == "enabled" then
  15. return Polycode.Entity_get_enabled(self.__ptr)
  16. elseif name == "visible" then
  17. return Polycode.Entity_get_visible(self.__ptr)
  18. elseif name == "depthWrite" then
  19. return Polycode.Entity_get_depthWrite(self.__ptr)
  20. elseif name == "depthTest" then
  21. return Polycode.Entity_get_depthTest(self.__ptr)
  22. elseif name == "colorAffectsChildren" then
  23. return Polycode.Entity_get_colorAffectsChildren(self.__ptr)
  24. elseif name == "visibilityAffectsChildren" then
  25. return Polycode.Entity_get_visibilityAffectsChildren(self.__ptr)
  26. elseif name == "ignoreParentMatrix" then
  27. return Polycode.Entity_get_ignoreParentMatrix(self.__ptr)
  28. elseif name == "enableScissor" then
  29. return Polycode.Entity_get_enableScissor(self.__ptr)
  30. elseif name == "scissorBox" then
  31. local retVal = Polycode.Entity_get_scissorBox(self.__ptr)
  32. if retVal == nil then return nil end
  33. local __c = _G["Rectangle"]("__skip_ptr__")
  34. __c.__ptr = retVal
  35. return __c
  36. elseif name == "editorOnly" then
  37. return Polycode.Entity_get_editorOnly(self.__ptr)
  38. elseif name == "id" then
  39. return Polycode.Entity_get_id(self.__ptr)
  40. elseif name == "collisionShapeType" then
  41. local retVal = Polycode.Entity_get_collisionShapeType(self.__ptr)
  42. if retVal == nil then return nil end
  43. local __c = _G["char"]("__skip_ptr__")
  44. __c.__ptr = retVal
  45. return __c
  46. elseif name == "processInputEvents" then
  47. return Polycode.Entity_get_processInputEvents(self.__ptr)
  48. elseif name == "blockMouseInput" then
  49. return Polycode.Entity_get_blockMouseInput(self.__ptr)
  50. elseif name == "snapToPixels" then
  51. return Polycode.Entity_get_snapToPixels(self.__ptr)
  52. elseif name == "mouseOver" then
  53. return Polycode.Entity_get_mouseOver(self.__ptr)
  54. elseif name == "rendererVis" then
  55. return Polycode.Entity_get_rendererVis(self.__ptr)
  56. elseif name == "layerID" then
  57. local retVal = Polycode.Entity_get_layerID(self.__ptr)
  58. if retVal == nil then return nil end
  59. local __c = _G["char"]("__skip_ptr__")
  60. __c.__ptr = retVal
  61. return __c
  62. elseif name == "castShadows" then
  63. return Polycode.Entity_get_castShadows(self.__ptr)
  64. end
  65. if EventDispatcher["__getvar"] ~= nil then
  66. return EventDispatcher.__getvar(self, name)
  67. end
  68. end
  69. function Entity:__setvar(name,value)
  70. if name == "ownsChildren" then
  71. Polycode.Entity_set_ownsChildren(self.__ptr, value)
  72. return true
  73. elseif name == "billboardMode" then
  74. Polycode.Entity_set_billboardMode(self.__ptr, value)
  75. return true
  76. elseif name == "color" then
  77. Polycode.Entity_set_color(self.__ptr, value.__ptr)
  78. return true
  79. elseif name == "enabled" then
  80. Polycode.Entity_set_enabled(self.__ptr, value)
  81. return true
  82. elseif name == "visible" then
  83. Polycode.Entity_set_visible(self.__ptr, value)
  84. return true
  85. elseif name == "depthWrite" then
  86. Polycode.Entity_set_depthWrite(self.__ptr, value)
  87. return true
  88. elseif name == "depthTest" then
  89. Polycode.Entity_set_depthTest(self.__ptr, value)
  90. return true
  91. elseif name == "colorAffectsChildren" then
  92. Polycode.Entity_set_colorAffectsChildren(self.__ptr, value)
  93. return true
  94. elseif name == "visibilityAffectsChildren" then
  95. Polycode.Entity_set_visibilityAffectsChildren(self.__ptr, value)
  96. return true
  97. elseif name == "ignoreParentMatrix" then
  98. Polycode.Entity_set_ignoreParentMatrix(self.__ptr, value)
  99. return true
  100. elseif name == "enableScissor" then
  101. Polycode.Entity_set_enableScissor(self.__ptr, value)
  102. return true
  103. elseif name == "scissorBox" then
  104. Polycode.Entity_set_scissorBox(self.__ptr, value.__ptr)
  105. return true
  106. elseif name == "editorOnly" then
  107. Polycode.Entity_set_editorOnly(self.__ptr, value)
  108. return true
  109. elseif name == "id" then
  110. Polycode.Entity_set_id(self.__ptr, value)
  111. return true
  112. elseif name == "collisionShapeType" then
  113. Polycode.Entity_set_collisionShapeType(self.__ptr, value.__ptr)
  114. return true
  115. elseif name == "processInputEvents" then
  116. Polycode.Entity_set_processInputEvents(self.__ptr, value)
  117. return true
  118. elseif name == "blockMouseInput" then
  119. Polycode.Entity_set_blockMouseInput(self.__ptr, value)
  120. return true
  121. elseif name == "snapToPixels" then
  122. Polycode.Entity_set_snapToPixels(self.__ptr, value)
  123. return true
  124. elseif name == "mouseOver" then
  125. Polycode.Entity_set_mouseOver(self.__ptr, value)
  126. return true
  127. elseif name == "rendererVis" then
  128. Polycode.Entity_set_rendererVis(self.__ptr, value)
  129. return true
  130. elseif name == "layerID" then
  131. Polycode.Entity_set_layerID(self.__ptr, value.__ptr)
  132. return true
  133. elseif name == "castShadows" then
  134. Polycode.Entity_set_castShadows(self.__ptr, value)
  135. return true
  136. end
  137. if EventDispatcher["__setvar"] ~= nil then
  138. return EventDispatcher.__setvar(self, name, value)
  139. else
  140. return false
  141. end
  142. end
  143. function Entity:Entity(...)
  144. local arg = {...}
  145. if type(arg[1]) == "table" and count(arg) == 1 then
  146. if ""..arg[1].__classname == "EventDispatcher" then
  147. self.__ptr = arg[1].__ptr
  148. return
  149. end
  150. end
  151. for k,v in pairs(arg) do
  152. if type(v) == "table" then
  153. if v.__ptr ~= nil then
  154. arg[k] = v.__ptr
  155. end
  156. end
  157. end
  158. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  159. self.__ptr = Polycode.Entity(unpack(arg))
  160. end
  161. end
  162. function Entity:initEntity()
  163. local retVal = Polycode.Entity_initEntity(self.__ptr)
  164. end
  165. function Entity:Update(elapsed)
  166. local retVal = Polycode.Entity_Update(self.__ptr, elapsed)
  167. end
  168. function Entity:fixedUpdate()
  169. local retVal = Polycode.Entity_fixedUpdate(self.__ptr)
  170. end
  171. function Entity:dirtyMatrix(val)
  172. local retVal = Polycode.Entity_dirtyMatrix(self.__ptr, val)
  173. end
  174. function Entity:rebuildTransformMatrix()
  175. local retVal = Polycode.Entity_rebuildTransformMatrix(self.__ptr)
  176. end
  177. function Entity:updateEntityMatrix()
  178. local retVal = Polycode.Entity_updateEntityMatrix(self.__ptr)
  179. end
  180. function Entity:getTransformMatrix()
  181. local retVal = Polycode.Entity_getTransformMatrix(self.__ptr)
  182. if retVal == nil then return nil end
  183. local __c = _G["Matrix4"]("__skip_ptr__")
  184. __c.__ptr = retVal
  185. return __c
  186. end
  187. function Entity:getConcatenatedMatrix()
  188. local retVal = Polycode.Entity_getConcatenatedMatrix(self.__ptr)
  189. if retVal == nil then return nil end
  190. local __c = _G["Matrix4"]("__skip_ptr__")
  191. __c.__ptr = retVal
  192. return __c
  193. end
  194. function Entity:getAnchorAdjustedMatrix()
  195. local retVal = Polycode.Entity_getAnchorAdjustedMatrix(self.__ptr)
  196. if retVal == nil then return nil end
  197. local __c = _G["Matrix4"]("__skip_ptr__")
  198. __c.__ptr = retVal
  199. return __c
  200. end
  201. function Entity:getConcatenatedRollMatrix()
  202. local retVal = Polycode.Entity_getConcatenatedRollMatrix(self.__ptr)
  203. if retVal == nil then return nil end
  204. local __c = _G["Matrix4"]("__skip_ptr__")
  205. __c.__ptr = retVal
  206. return __c
  207. end
  208. function Entity:setTransformByMatrixPure(matrix)
  209. local retVal = Polycode.Entity_setTransformByMatrixPure(self.__ptr, matrix.__ptr)
  210. end
  211. function Entity:getLookAtMatrix(loc, upVector)
  212. local retVal = Polycode.Entity_getLookAtMatrix(self.__ptr, loc.__ptr, upVector.__ptr)
  213. if retVal == nil then return nil end
  214. local __c = _G["Matrix4"]("__skip_ptr__")
  215. __c.__ptr = retVal
  216. return __c
  217. end
  218. function Entity:getNumChildren()
  219. local retVal = Polycode.Entity_getNumChildren(self.__ptr)
  220. return retVal
  221. end
  222. function Entity:setOwnsChildrenRecursive(val)
  223. local retVal = Polycode.Entity_setOwnsChildrenRecursive(self.__ptr, val)
  224. end
  225. function Entity:getPosition()
  226. local retVal = Polycode.Entity_getPosition(self.__ptr)
  227. if retVal == nil then return nil end
  228. local __c = _G["Vector3"]("__skip_ptr__")
  229. __c.__ptr = retVal
  230. return __c
  231. end
  232. function Entity:getPosition2D()
  233. local retVal = Polycode.Entity_getPosition2D(self.__ptr)
  234. if retVal == nil then return nil end
  235. local __c = _G["Vector2"]("__skip_ptr__")
  236. __c.__ptr = retVal
  237. return __c
  238. end
  239. function Entity:getCombinedPosition()
  240. local retVal = Polycode.Entity_getCombinedPosition(self.__ptr)
  241. if retVal == nil then return nil end
  242. local __c = _G["Vector3"]("__skip_ptr__")
  243. __c.__ptr = retVal
  244. return __c
  245. end
  246. function Entity:setPosition(x, y, z)
  247. local retVal = Polycode.Entity_setPosition(self.__ptr, x, y, z)
  248. end
  249. function Entity:setPositionX(x)
  250. local retVal = Polycode.Entity_setPositionX(self.__ptr, x)
  251. end
  252. function Entity:setPositionY(y)
  253. local retVal = Polycode.Entity_setPositionY(self.__ptr, y)
  254. end
  255. function Entity:Translate(x, y, z)
  256. local retVal = Polycode.Entity_Translate(self.__ptr, x, y, z)
  257. end
  258. function Entity:setPositionZ(z)
  259. local retVal = Polycode.Entity_setPositionZ(self.__ptr, z)
  260. end
  261. function Entity:setScaleX(x)
  262. local retVal = Polycode.Entity_setScaleX(self.__ptr, x)
  263. end
  264. function Entity:setScaleY(y)
  265. local retVal = Polycode.Entity_setScaleY(self.__ptr, y)
  266. end
  267. function Entity:setScaleZ(z)
  268. local retVal = Polycode.Entity_setScaleZ(self.__ptr, z)
  269. end
  270. function Entity:Scale(x, y, z)
  271. local retVal = Polycode.Entity_Scale(self.__ptr, x, y, z)
  272. end
  273. function Entity:setScale(x, y, z)
  274. local retVal = Polycode.Entity_setScale(self.__ptr, x, y, z)
  275. end
  276. function Entity:getCompoundScale()
  277. local retVal = Polycode.Entity_getCompoundScale(self.__ptr)
  278. if retVal == nil then return nil end
  279. local __c = _G["Vector3"]("__skip_ptr__")
  280. __c.__ptr = retVal
  281. return __c
  282. end
  283. function Entity:getScale()
  284. local retVal = Polycode.Entity_getScale(self.__ptr)
  285. if retVal == nil then return nil end
  286. local __c = _G["Vector3"]("__skip_ptr__")
  287. __c.__ptr = retVal
  288. return __c
  289. end
  290. function Entity:getRotationEuler()
  291. local retVal = Polycode.Entity_getRotationEuler(self.__ptr)
  292. if retVal == nil then return nil end
  293. local __c = _G["Vector3"]("__skip_ptr__")
  294. __c.__ptr = retVal
  295. return __c
  296. end
  297. function Entity:getCombinedPitch()
  298. local retVal = Polycode.Entity_getCombinedPitch(self.__ptr)
  299. return retVal
  300. end
  301. function Entity:getCombinedYaw()
  302. local retVal = Polycode.Entity_getCombinedYaw(self.__ptr)
  303. return retVal
  304. end
  305. function Entity:getCombinedRoll()
  306. local retVal = Polycode.Entity_getCombinedRoll(self.__ptr)
  307. return retVal
  308. end
  309. function Entity:rebuildRotation()
  310. local retVal = Polycode.Entity_rebuildRotation(self.__ptr)
  311. end
  312. function Entity:setRotationEuler(rotation)
  313. local retVal = Polycode.Entity_setRotationEuler(self.__ptr, rotation.__ptr)
  314. end
  315. function Entity:setPitch(pitch)
  316. local retVal = Polycode.Entity_setPitch(self.__ptr, pitch)
  317. end
  318. function Entity:setYaw(yaw)
  319. local retVal = Polycode.Entity_setYaw(self.__ptr, yaw)
  320. end
  321. function Entity:setRoll(roll)
  322. local retVal = Polycode.Entity_setRoll(self.__ptr, roll)
  323. end
  324. function Entity:Roll(roll)
  325. local retVal = Polycode.Entity_Roll(self.__ptr, roll)
  326. end
  327. function Entity:Yaw(yaw)
  328. local retVal = Polycode.Entity_Yaw(self.__ptr, yaw)
  329. end
  330. function Entity:Pitch(pitch)
  331. local retVal = Polycode.Entity_Pitch(self.__ptr, pitch)
  332. end
  333. function Entity:getPitch()
  334. local retVal = Polycode.Entity_getPitch(self.__ptr)
  335. return retVal
  336. end
  337. function Entity:getYaw()
  338. local retVal = Polycode.Entity_getYaw(self.__ptr)
  339. return retVal
  340. end
  341. function Entity:getRoll()
  342. local retVal = Polycode.Entity_getRoll(self.__ptr)
  343. return retVal
  344. end
  345. function Entity:getWidth()
  346. local retVal = Polycode.Entity_getWidth(self.__ptr)
  347. return retVal
  348. end
  349. function Entity:getHeight()
  350. local retVal = Polycode.Entity_getHeight(self.__ptr)
  351. return retVal
  352. end
  353. function Entity:getDepth()
  354. local retVal = Polycode.Entity_getDepth(self.__ptr)
  355. return retVal
  356. end
  357. function Entity:setWidth(width)
  358. local retVal = Polycode.Entity_setWidth(self.__ptr, width)
  359. end
  360. function Entity:setHeight(height)
  361. local retVal = Polycode.Entity_setHeight(self.__ptr, height)
  362. end
  363. function Entity:setDepth(depth)
  364. local retVal = Polycode.Entity_setDepth(self.__ptr, depth)
  365. end
  366. function Entity:setRotationQuat(w, x, y, z)
  367. local retVal = Polycode.Entity_setRotationQuat(self.__ptr, w, x, y, z)
  368. end
  369. function Entity:setRotationByQuaternion(quaternion)
  370. local retVal = Polycode.Entity_setRotationByQuaternion(self.__ptr, quaternion.__ptr)
  371. end
  372. function Entity:getRotationQuat()
  373. local retVal = Polycode.Entity_getRotationQuat(self.__ptr)
  374. if retVal == nil then return nil end
  375. local __c = _G["Quaternion"]("__skip_ptr__")
  376. __c.__ptr = retVal
  377. return __c
  378. end
  379. function Entity:getConcatenatedQuat()
  380. local retVal = Polycode.Entity_getConcatenatedQuat(self.__ptr)
  381. if retVal == nil then return nil end
  382. local __c = _G["Quaternion"]("__skip_ptr__")
  383. __c.__ptr = retVal
  384. return __c
  385. end
  386. function Entity:lookAt(loc, upVector)
  387. local retVal = Polycode.Entity_lookAt(self.__ptr, loc.__ptr, upVector.__ptr)
  388. end
  389. function Entity:getCombinedColor()
  390. local retVal = Polycode.Entity_getCombinedColor(self.__ptr)
  391. if retVal == nil then return nil end
  392. local __c = _G["Color"]("__skip_ptr__")
  393. __c.__ptr = retVal
  394. return __c
  395. end
  396. function Entity:setColor(r, g, b, a)
  397. local retVal = Polycode.Entity_setColor(self.__ptr, r, g, b, a)
  398. end
  399. function Entity:setColorInt(r, g, b, a)
  400. local retVal = Polycode.Entity_setColorInt(self.__ptr, r, g, b, a)
  401. end
  402. function Entity:setAnchorPoint(anchorPoint)
  403. local retVal = Polycode.Entity_setAnchorPoint(self.__ptr, anchorPoint.__ptr)
  404. end
  405. function Entity:getAnchorPoint()
  406. local retVal = Polycode.Entity_getAnchorPoint(self.__ptr)
  407. if retVal == nil then return nil end
  408. local __c = _G["Vector3"]("__skip_ptr__")
  409. __c.__ptr = retVal
  410. return __c
  411. end
  412. function Entity:onMouseDown(ray, mouseButton, timestamp)
  413. local retVal = Polycode.Entity_onMouseDown(self.__ptr, ray.__ptr, mouseButton, timestamp)
  414. if retVal == nil then return nil end
  415. local __c = _G["MouseEventResult"]("__skip_ptr__")
  416. __c.__ptr = retVal
  417. return __c
  418. end
  419. function Entity:onMouseUp(ray, mouseButton, timestamp)
  420. local retVal = Polycode.Entity_onMouseUp(self.__ptr, ray.__ptr, mouseButton, timestamp)
  421. if retVal == nil then return nil end
  422. local __c = _G["MouseEventResult"]("__skip_ptr__")
  423. __c.__ptr = retVal
  424. return __c
  425. end
  426. function Entity:onMouseMove(ray, timestamp)
  427. local retVal = Polycode.Entity_onMouseMove(self.__ptr, ray.__ptr, timestamp)
  428. if retVal == nil then return nil end
  429. local __c = _G["MouseEventResult"]("__skip_ptr__")
  430. __c.__ptr = retVal
  431. return __c
  432. end
  433. function Entity:onMouseWheelUp(ray, timestamp)
  434. local retVal = Polycode.Entity_onMouseWheelUp(self.__ptr, ray.__ptr, timestamp)
  435. if retVal == nil then return nil end
  436. local __c = _G["MouseEventResult"]("__skip_ptr__")
  437. __c.__ptr = retVal
  438. return __c
  439. end
  440. function Entity:onMouseWheelDown(ray, timestamp)
  441. local retVal = Polycode.Entity_onMouseWheelDown(self.__ptr, ray.__ptr, timestamp)
  442. if retVal == nil then return nil end
  443. local __c = _G["MouseEventResult"]("__skip_ptr__")
  444. __c.__ptr = retVal
  445. return __c
  446. end
  447. function Entity:setDepthOnly(val)
  448. local retVal = Polycode.Entity_setDepthOnly(self.__ptr, val)
  449. end
  450. function Entity:getDepthOnly()
  451. local retVal = Polycode.Entity_getDepthOnly(self.__ptr)
  452. return retVal
  453. end
  454. function Entity:setBlendingMode(newBlendingMode)
  455. local retVal = Polycode.Entity_setBlendingMode(self.__ptr, newBlendingMode)
  456. end
  457. function Entity:getBlendingMode()
  458. local retVal = Polycode.Entity_getBlendingMode(self.__ptr)
  459. return retVal
  460. end
  461. function Entity:getEntityProp(propName)
  462. local retVal = Polycode.Entity_getEntityProp(self.__ptr, propName)
  463. return retVal
  464. end
  465. function Entity:setEntityProp(propName, propValue)
  466. local retVal = Polycode.Entity_setEntityProp(self.__ptr, propName, propValue)
  467. end
  468. function Entity:setInverseY(val)
  469. local retVal = Polycode.Entity_setInverseY(self.__ptr, val)
  470. end
  471. function Entity:getInverseY()
  472. local retVal = Polycode.Entity_getInverseY(self.__ptr)
  473. return retVal
  474. end
  475. function Entity:doUpdates(elapsed)
  476. local retVal = Polycode.Entity_doUpdates(self.__ptr, elapsed)
  477. end
  478. function Entity:doFixedUpdates()
  479. local retVal = Polycode.Entity_doFixedUpdates(self.__ptr)
  480. end
  481. function Entity:buildPositionMatrix()
  482. local retVal = Polycode.Entity_buildPositionMatrix(self.__ptr)
  483. if retVal == nil then return nil end
  484. local __c = _G["Matrix4"]("__skip_ptr__")
  485. __c.__ptr = retVal
  486. return __c
  487. end
  488. function Entity:customHitDetection(ray)
  489. local retVal = Polycode.Entity_customHitDetection(self.__ptr, ray.__ptr)
  490. return retVal
  491. end
  492. function Entity:getNumTags()
  493. local retVal = Polycode.Entity_getNumTags(self.__ptr)
  494. return retVal
  495. end
  496. function Entity:getTagAtIndex(index)
  497. local retVal = Polycode.Entity_getTagAtIndex(self.__ptr, index)
  498. return retVal
  499. end
  500. function Entity:hasTag(tag)
  501. local retVal = Polycode.Entity_hasTag(self.__ptr, tag)
  502. return retVal
  503. end
  504. function Entity:clearTags()
  505. local retVal = Polycode.Entity_clearTags(self.__ptr)
  506. end
  507. function Entity:addTag(tag)
  508. local retVal = Polycode.Entity_addTag(self.__ptr, tag)
  509. end
  510. function Entity:getScreenPosition(projectionMatrix, cameraMatrix, viewport)
  511. local retVal = Polycode.Entity_getScreenPosition(self.__ptr, projectionMatrix.__ptr, cameraMatrix.__ptr, viewport.__ptr)
  512. if retVal == nil then return nil end
  513. local __c = _G["Vector2"]("__skip_ptr__")
  514. __c.__ptr = retVal
  515. return __c
  516. end
  517. function Entity:recalculateAABBAllChildren()
  518. local retVal = Polycode.Entity_recalculateAABBAllChildren(self.__ptr)
  519. end
  520. function Entity:recalculateAABB()
  521. local retVal = Polycode.Entity_recalculateAABB(self.__ptr)
  522. end
  523. function Entity:getWorldAABB()
  524. local retVal = Polycode.Entity_getWorldAABB(self.__ptr)
  525. if retVal == nil then return nil end
  526. local __c = _G["AABB"]("__skip_ptr__")
  527. __c.__ptr = retVal
  528. return __c
  529. end
  530. function Entity:getLocalBoundingBox()
  531. local retVal = Polycode.Entity_getLocalBoundingBox(self.__ptr)
  532. if retVal == nil then return nil end
  533. local __c = _G["Vector3"]("__skip_ptr__")
  534. __c.__ptr = retVal
  535. return __c
  536. end
  537. function Entity:setLocalBoundingBox(box)
  538. local retVal = Polycode.Entity_setLocalBoundingBox(self.__ptr, box.__ptr)
  539. end
  540. function Entity:setLocalBoundingBoxX(x)
  541. local retVal = Polycode.Entity_setLocalBoundingBoxX(self.__ptr, x)
  542. end
  543. function Entity:setLocalBoundingBoxY(y)
  544. local retVal = Polycode.Entity_setLocalBoundingBoxY(self.__ptr, y)
  545. end
  546. function Entity:setLocalBoundingBoxZ(z)
  547. local retVal = Polycode.Entity_setLocalBoundingBoxZ(self.__ptr, z)
  548. end
  549. function Entity:attachScript(script)
  550. local retVal = Polycode.Entity_attachScript(self.__ptr, script.__ptr)
  551. end
  552. function Entity:getNumScripts()
  553. local retVal = Polycode.Entity_getNumScripts(self.__ptr)
  554. return retVal
  555. end
  556. function Entity:__delete()
  557. if self then Polycode.delete_Entity(self.__ptr) end
  558. end