Entity.lua 18 KB

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