Entity.lua 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801
  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:Render(buffer)
  161. local retVal = Polycode.Entity_Render(self.__ptr, buffer.__ptr)
  162. end
  163. function Entity:Update()
  164. local retVal = Polycode.Entity_Update(self.__ptr)
  165. end
  166. function Entity:fixedUpdate()
  167. local retVal = Polycode.Entity_fixedUpdate(self.__ptr)
  168. end
  169. function Entity:transformAndRender(drawBuffer, parentScissorBox)
  170. local retVal = Polycode.Entity_transformAndRender(self.__ptr, drawBuffer.__ptr, parentScissorBox.__ptr)
  171. end
  172. function Entity:renderChildren(buffer, parentScissorBox)
  173. local retVal = Polycode.Entity_renderChildren(self.__ptr, buffer.__ptr, parentScissorBox.__ptr)
  174. end
  175. function Entity:Clone(deepClone, ignoreEditorOnly)
  176. local retVal = Polycode.Entity_Clone(self.__ptr, deepClone, ignoreEditorOnly)
  177. if retVal == nil then return nil end
  178. local __c = _G["Entity"]("__skip_ptr__")
  179. __c.__ptr = retVal
  180. return __c
  181. end
  182. function Entity:applyClone(clone, deepClone, ignoreEditorOnly)
  183. local retVal = Polycode.Entity_applyClone(self.__ptr, clone.__ptr, deepClone, ignoreEditorOnly)
  184. end
  185. function Entity:dirtyMatrix(val)
  186. local retVal = Polycode.Entity_dirtyMatrix(self.__ptr, val)
  187. end
  188. function Entity:rebuildTransformMatrix()
  189. local retVal = Polycode.Entity_rebuildTransformMatrix(self.__ptr)
  190. end
  191. function Entity:updateEntityMatrix()
  192. local retVal = Polycode.Entity_updateEntityMatrix(self.__ptr)
  193. end
  194. function Entity:getTransformMatrix()
  195. local retVal = Polycode.Entity_getTransformMatrix(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:getConcatenatedMatrix()
  202. local retVal = Polycode.Entity_getConcatenatedMatrix(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:getConcatenatedMatrixRelativeTo(relativeEntity)
  209. local retVal = Polycode.Entity_getConcatenatedMatrixRelativeTo(self.__ptr, relativeEntity.__ptr)
  210. if retVal == nil then return nil end
  211. local __c = _G["Matrix4"]("__skip_ptr__")
  212. __c.__ptr = retVal
  213. return __c
  214. end
  215. function Entity:getAnchorAdjustedMatrix()
  216. local retVal = Polycode.Entity_getAnchorAdjustedMatrix(self.__ptr)
  217. if retVal == nil then return nil end
  218. local __c = _G["Matrix4"]("__skip_ptr__")
  219. __c.__ptr = retVal
  220. return __c
  221. end
  222. function Entity:getConcatenatedRollMatrix()
  223. local retVal = Polycode.Entity_getConcatenatedRollMatrix(self.__ptr)
  224. if retVal == nil then return nil end
  225. local __c = _G["Matrix4"]("__skip_ptr__")
  226. __c.__ptr = retVal
  227. return __c
  228. end
  229. function Entity:setTransformByMatrixPure(matrix)
  230. local retVal = Polycode.Entity_setTransformByMatrixPure(self.__ptr, matrix.__ptr)
  231. end
  232. function Entity:getLookAtMatrix(loc, upVector)
  233. local retVal = Polycode.Entity_getLookAtMatrix(self.__ptr, loc.__ptr, upVector.__ptr)
  234. if retVal == nil then return nil end
  235. local __c = _G["Matrix4"]("__skip_ptr__")
  236. __c.__ptr = retVal
  237. return __c
  238. end
  239. function Entity:addChild(newChild)
  240. local retVal = Polycode.Entity_addChild(self.__ptr, newChild.__ptr)
  241. end
  242. function Entity:removeChild(entityToRemove)
  243. local retVal = Polycode.Entity_removeChild(self.__ptr, entityToRemove.__ptr)
  244. end
  245. function Entity:moveChildUp(child)
  246. local retVal = Polycode.Entity_moveChildUp(self.__ptr, child.__ptr)
  247. end
  248. function Entity:moveChildDown(child)
  249. local retVal = Polycode.Entity_moveChildDown(self.__ptr, child.__ptr)
  250. end
  251. function Entity:moveChildTop(child)
  252. local retVal = Polycode.Entity_moveChildTop(self.__ptr, child.__ptr)
  253. end
  254. function Entity:moveChildBottom(child)
  255. local retVal = Polycode.Entity_moveChildBottom(self.__ptr, child.__ptr)
  256. end
  257. function Entity:setParentEntity(entity)
  258. local retVal = Polycode.Entity_setParentEntity(self.__ptr, entity.__ptr)
  259. end
  260. function Entity:getParentEntity()
  261. local retVal = Polycode.Entity_getParentEntity(self.__ptr)
  262. if retVal == nil then return nil end
  263. local __c = _G["Entity"]("__skip_ptr__")
  264. __c.__ptr = retVal
  265. return __c
  266. end
  267. function Entity:getNumChildren()
  268. local retVal = Polycode.Entity_getNumChildren(self.__ptr)
  269. return retVal
  270. end
  271. function Entity:getChildAtIndex(index)
  272. local retVal = Polycode.Entity_getChildAtIndex(self.__ptr, index)
  273. if retVal == nil then return nil end
  274. local __c = _G["Entity"]("__skip_ptr__")
  275. __c.__ptr = retVal
  276. return __c
  277. end
  278. function Entity:setOwnsChildrenRecursive(val)
  279. local retVal = Polycode.Entity_setOwnsChildrenRecursive(self.__ptr, val)
  280. end
  281. function Entity:getPosition()
  282. local retVal = Polycode.Entity_getPosition(self.__ptr)
  283. if retVal == nil then return nil end
  284. local __c = _G["Vector3"]("__skip_ptr__")
  285. __c.__ptr = retVal
  286. return __c
  287. end
  288. function Entity:getPosition2D()
  289. local retVal = Polycode.Entity_getPosition2D(self.__ptr)
  290. if retVal == nil then return nil end
  291. local __c = _G["Vector2"]("__skip_ptr__")
  292. __c.__ptr = retVal
  293. return __c
  294. end
  295. function Entity:getCombinedPosition()
  296. local retVal = Polycode.Entity_getCombinedPosition(self.__ptr)
  297. if retVal == nil then return nil end
  298. local __c = _G["Vector3"]("__skip_ptr__")
  299. __c.__ptr = retVal
  300. return __c
  301. end
  302. function Entity:setPosition(x, y, z)
  303. local retVal = Polycode.Entity_setPosition(self.__ptr, x, y, z)
  304. end
  305. function Entity:setPositionX(x)
  306. local retVal = Polycode.Entity_setPositionX(self.__ptr, x)
  307. end
  308. function Entity:setPositionY(y)
  309. local retVal = Polycode.Entity_setPositionY(self.__ptr, y)
  310. end
  311. function Entity:Translate(x, y, z)
  312. local retVal = Polycode.Entity_Translate(self.__ptr, x, y, z)
  313. end
  314. function Entity:setPositionZ(z)
  315. local retVal = Polycode.Entity_setPositionZ(self.__ptr, z)
  316. end
  317. function Entity:setScaleX(x)
  318. local retVal = Polycode.Entity_setScaleX(self.__ptr, x)
  319. end
  320. function Entity:setScaleY(y)
  321. local retVal = Polycode.Entity_setScaleY(self.__ptr, y)
  322. end
  323. function Entity:setScaleZ(z)
  324. local retVal = Polycode.Entity_setScaleZ(self.__ptr, z)
  325. end
  326. function Entity:Scale(x, y, z)
  327. local retVal = Polycode.Entity_Scale(self.__ptr, x, y, z)
  328. end
  329. function Entity:setScale(x, y, z)
  330. local retVal = Polycode.Entity_setScale(self.__ptr, x, y, z)
  331. end
  332. function Entity:getCompoundScale()
  333. local retVal = Polycode.Entity_getCompoundScale(self.__ptr)
  334. if retVal == nil then return nil end
  335. local __c = _G["Vector3"]("__skip_ptr__")
  336. __c.__ptr = retVal
  337. return __c
  338. end
  339. function Entity:getScale()
  340. local retVal = Polycode.Entity_getScale(self.__ptr)
  341. if retVal == nil then return nil end
  342. local __c = _G["Vector3"]("__skip_ptr__")
  343. __c.__ptr = retVal
  344. return __c
  345. end
  346. function Entity:getRotationEuler()
  347. local retVal = Polycode.Entity_getRotationEuler(self.__ptr)
  348. if retVal == nil then return nil end
  349. local __c = _G["Vector3"]("__skip_ptr__")
  350. __c.__ptr = retVal
  351. return __c
  352. end
  353. function Entity:getCombinedPitch()
  354. local retVal = Polycode.Entity_getCombinedPitch(self.__ptr)
  355. return retVal
  356. end
  357. function Entity:getCombinedYaw()
  358. local retVal = Polycode.Entity_getCombinedYaw(self.__ptr)
  359. return retVal
  360. end
  361. function Entity:getCombinedRoll()
  362. local retVal = Polycode.Entity_getCombinedRoll(self.__ptr)
  363. return retVal
  364. end
  365. function Entity:rebuildRotation()
  366. local retVal = Polycode.Entity_rebuildRotation(self.__ptr)
  367. end
  368. function Entity:setRotationEuler(rotation)
  369. local retVal = Polycode.Entity_setRotationEuler(self.__ptr, rotation.__ptr)
  370. end
  371. function Entity:setPitch(pitch)
  372. local retVal = Polycode.Entity_setPitch(self.__ptr, pitch)
  373. end
  374. function Entity:setYaw(yaw)
  375. local retVal = Polycode.Entity_setYaw(self.__ptr, yaw)
  376. end
  377. function Entity:setRoll(roll)
  378. local retVal = Polycode.Entity_setRoll(self.__ptr, roll)
  379. end
  380. function Entity:Roll(roll)
  381. local retVal = Polycode.Entity_Roll(self.__ptr, roll)
  382. end
  383. function Entity:Yaw(yaw)
  384. local retVal = Polycode.Entity_Yaw(self.__ptr, yaw)
  385. end
  386. function Entity:Pitch(pitch)
  387. local retVal = Polycode.Entity_Pitch(self.__ptr, pitch)
  388. end
  389. function Entity:getPitch()
  390. local retVal = Polycode.Entity_getPitch(self.__ptr)
  391. return retVal
  392. end
  393. function Entity:getYaw()
  394. local retVal = Polycode.Entity_getYaw(self.__ptr)
  395. return retVal
  396. end
  397. function Entity:getRoll()
  398. local retVal = Polycode.Entity_getRoll(self.__ptr)
  399. return retVal
  400. end
  401. function Entity:getWidth()
  402. local retVal = Polycode.Entity_getWidth(self.__ptr)
  403. return retVal
  404. end
  405. function Entity:getHeight()
  406. local retVal = Polycode.Entity_getHeight(self.__ptr)
  407. return retVal
  408. end
  409. function Entity:getDepth()
  410. local retVal = Polycode.Entity_getDepth(self.__ptr)
  411. return retVal
  412. end
  413. function Entity:setWidth(width)
  414. local retVal = Polycode.Entity_setWidth(self.__ptr, width)
  415. end
  416. function Entity:setHeight(height)
  417. local retVal = Polycode.Entity_setHeight(self.__ptr, height)
  418. end
  419. function Entity:setDepth(depth)
  420. local retVal = Polycode.Entity_setDepth(self.__ptr, depth)
  421. end
  422. function Entity:setRotationQuat(w, x, y, z)
  423. local retVal = Polycode.Entity_setRotationQuat(self.__ptr, w, x, y, z)
  424. end
  425. function Entity:setRotationByQuaternion(quaternion)
  426. local retVal = Polycode.Entity_setRotationByQuaternion(self.__ptr, quaternion.__ptr)
  427. end
  428. function Entity:getRotationQuat()
  429. local retVal = Polycode.Entity_getRotationQuat(self.__ptr)
  430. if retVal == nil then return nil end
  431. local __c = _G["Quaternion"]("__skip_ptr__")
  432. __c.__ptr = retVal
  433. return __c
  434. end
  435. function Entity:getConcatenatedQuat()
  436. local retVal = Polycode.Entity_getConcatenatedQuat(self.__ptr)
  437. if retVal == nil then return nil end
  438. local __c = _G["Quaternion"]("__skip_ptr__")
  439. __c.__ptr = retVal
  440. return __c
  441. end
  442. function Entity:lookAt(loc, upVector)
  443. local retVal = Polycode.Entity_lookAt(self.__ptr, loc.__ptr, upVector.__ptr)
  444. end
  445. function Entity:lookAtEntity(entity, upVector)
  446. local retVal = Polycode.Entity_lookAtEntity(self.__ptr, entity.__ptr, upVector.__ptr)
  447. end
  448. function Entity:getCombinedColor()
  449. local retVal = Polycode.Entity_getCombinedColor(self.__ptr)
  450. if retVal == nil then return nil end
  451. local __c = _G["Color"]("__skip_ptr__")
  452. __c.__ptr = retVal
  453. return __c
  454. end
  455. function Entity:setColor(r, g, b, a)
  456. local retVal = Polycode.Entity_setColor(self.__ptr, r, g, b, a)
  457. end
  458. function Entity:setColorInt(r, g, b, a)
  459. local retVal = Polycode.Entity_setColorInt(self.__ptr, r, g, b, a)
  460. end
  461. function Entity:setAnchorPoint(anchorPoint)
  462. local retVal = Polycode.Entity_setAnchorPoint(self.__ptr, anchorPoint.__ptr)
  463. end
  464. function Entity:getAnchorPoint()
  465. local retVal = Polycode.Entity_getAnchorPoint(self.__ptr)
  466. if retVal == nil then return nil end
  467. local __c = _G["Vector3"]("__skip_ptr__")
  468. __c.__ptr = retVal
  469. return __c
  470. end
  471. function Entity:onMouseDown(ray, mouseButton, timestamp)
  472. local retVal = Polycode.Entity_onMouseDown(self.__ptr, ray.__ptr, mouseButton, timestamp)
  473. if retVal == nil then return nil end
  474. local __c = _G["MouseEventResult"]("__skip_ptr__")
  475. __c.__ptr = retVal
  476. return __c
  477. end
  478. function Entity:onMouseUp(ray, mouseButton, timestamp)
  479. local retVal = Polycode.Entity_onMouseUp(self.__ptr, ray.__ptr, mouseButton, timestamp)
  480. if retVal == nil then return nil end
  481. local __c = _G["MouseEventResult"]("__skip_ptr__")
  482. __c.__ptr = retVal
  483. return __c
  484. end
  485. function Entity:onMouseMove(ray, timestamp)
  486. local retVal = Polycode.Entity_onMouseMove(self.__ptr, ray.__ptr, timestamp)
  487. if retVal == nil then return nil end
  488. local __c = _G["MouseEventResult"]("__skip_ptr__")
  489. __c.__ptr = retVal
  490. return __c
  491. end
  492. function Entity:onMouseWheelUp(ray, timestamp)
  493. local retVal = Polycode.Entity_onMouseWheelUp(self.__ptr, ray.__ptr, timestamp)
  494. if retVal == nil then return nil end
  495. local __c = _G["MouseEventResult"]("__skip_ptr__")
  496. __c.__ptr = retVal
  497. return __c
  498. end
  499. function Entity:onMouseWheelDown(ray, timestamp)
  500. local retVal = Polycode.Entity_onMouseWheelDown(self.__ptr, ray.__ptr, timestamp)
  501. if retVal == nil then return nil end
  502. local __c = _G["MouseEventResult"]("__skip_ptr__")
  503. __c.__ptr = retVal
  504. return __c
  505. end
  506. function Entity:setDepthOnly(val)
  507. local retVal = Polycode.Entity_setDepthOnly(self.__ptr, val)
  508. end
  509. function Entity:getDepthOnly()
  510. local retVal = Polycode.Entity_getDepthOnly(self.__ptr)
  511. return retVal
  512. end
  513. function Entity:setUserData(userData)
  514. local retVal = Polycode.Entity_setUserData(self.__ptr, userData.__ptr)
  515. end
  516. function Entity:getUserData()
  517. local retVal = Polycode.Entity_getUserData(self.__ptr)
  518. if retVal == nil then return nil end
  519. local __c = _G["void"]("__skip_ptr__")
  520. __c.__ptr = retVal
  521. return __c
  522. end
  523. function Entity:setBlendingMode(newBlendingMode)
  524. local retVal = Polycode.Entity_setBlendingMode(self.__ptr, newBlendingMode)
  525. end
  526. function Entity:getBlendingMode()
  527. local retVal = Polycode.Entity_getBlendingMode(self.__ptr)
  528. return retVal
  529. end
  530. function Entity:getEntityById(id, recursive)
  531. local retVal = Polycode.Entity_getEntityById(self.__ptr, id, recursive)
  532. if retVal == nil then return nil end
  533. local __c = _G["Entity"]("__skip_ptr__")
  534. __c.__ptr = retVal
  535. return __c
  536. end
  537. function Entity:getEntitiesByTag(tag, recursive)
  538. local retVal = Polycode.Entity_getEntitiesByTag(self.__ptr, tag, recursive)
  539. if retVal == nil then return nil end
  540. for i=1,count(retVal) do
  541. local __c = _G["Entity"]("__skip_ptr__")
  542. __c.__ptr = retVal[i]
  543. retVal[i] = __c
  544. end
  545. return retVal
  546. end
  547. function Entity:getEntitiesByLayerID(layerID, recursive)
  548. local retVal = Polycode.Entity_getEntitiesByLayerID(self.__ptr, layerID.__ptr, recursive)
  549. if retVal == nil then return nil end
  550. for i=1,count(retVal) do
  551. local __c = _G["Entity"]("__skip_ptr__")
  552. __c.__ptr = retVal[i]
  553. retVal[i] = __c
  554. end
  555. return retVal
  556. end
  557. function Entity:getEntityProp(propName)
  558. local retVal = Polycode.Entity_getEntityProp(self.__ptr, propName)
  559. return retVal
  560. end
  561. function Entity:setEntityProp(propName, propValue)
  562. local retVal = Polycode.Entity_setEntityProp(self.__ptr, propName, propValue)
  563. end
  564. function Entity:setInverseY(val)
  565. local retVal = Polycode.Entity_setInverseY(self.__ptr, val)
  566. end
  567. function Entity:getInverseY()
  568. local retVal = Polycode.Entity_getInverseY(self.__ptr)
  569. return retVal
  570. end
  571. function Entity:doUpdates()
  572. local retVal = Polycode.Entity_doUpdates(self.__ptr)
  573. end
  574. function Entity:doFixedUpdates()
  575. local retVal = Polycode.Entity_doFixedUpdates(self.__ptr)
  576. end
  577. function Entity:buildPositionMatrix()
  578. local retVal = Polycode.Entity_buildPositionMatrix(self.__ptr)
  579. if retVal == nil then return nil end
  580. local __c = _G["Matrix4"]("__skip_ptr__")
  581. __c.__ptr = retVal
  582. return __c
  583. end
  584. function Entity:setRenderer(renderer)
  585. local retVal = Polycode.Entity_setRenderer(self.__ptr, renderer.__ptr)
  586. end
  587. function Entity:customHitDetection(ray)
  588. local retVal = Polycode.Entity_customHitDetection(self.__ptr, ray.__ptr)
  589. return retVal
  590. end
  591. function Entity:getNumTags()
  592. local retVal = Polycode.Entity_getNumTags(self.__ptr)
  593. return retVal
  594. end
  595. function Entity:getTagAtIndex(index)
  596. local retVal = Polycode.Entity_getTagAtIndex(self.__ptr, index)
  597. return retVal
  598. end
  599. function Entity:hasTag(tag)
  600. local retVal = Polycode.Entity_hasTag(self.__ptr, tag)
  601. return retVal
  602. end
  603. function Entity:clearTags()
  604. local retVal = Polycode.Entity_clearTags(self.__ptr)
  605. end
  606. function Entity:addTag(tag)
  607. local retVal = Polycode.Entity_addTag(self.__ptr, tag)
  608. end
  609. function Entity:getScreenPosition(projectionMatrix, cameraMatrix, viewport)
  610. local retVal = Polycode.Entity_getScreenPosition(self.__ptr, projectionMatrix.__ptr, cameraMatrix.__ptr, viewport.__ptr)
  611. if retVal == nil then return nil end
  612. local __c = _G["Vector2"]("__skip_ptr__")
  613. __c.__ptr = retVal
  614. return __c
  615. end
  616. function Entity:recalculateAABBAllChildren()
  617. local retVal = Polycode.Entity_recalculateAABBAllChildren(self.__ptr)
  618. end
  619. function Entity:recalculateAABB()
  620. local retVal = Polycode.Entity_recalculateAABB(self.__ptr)
  621. end
  622. function Entity:getWorldAABB()
  623. local retVal = Polycode.Entity_getWorldAABB(self.__ptr)
  624. if retVal == nil then return nil end
  625. local __c = _G["AABB"]("__skip_ptr__")
  626. __c.__ptr = retVal
  627. return __c
  628. end
  629. function Entity:getLocalBoundingBox()
  630. local retVal = Polycode.Entity_getLocalBoundingBox(self.__ptr)
  631. if retVal == nil then return nil end
  632. local __c = _G["Vector3"]("__skip_ptr__")
  633. __c.__ptr = retVal
  634. return __c
  635. end
  636. function Entity:setLocalBoundingBox(box)
  637. local retVal = Polycode.Entity_setLocalBoundingBox(self.__ptr, box.__ptr)
  638. end
  639. function Entity:setLocalBoundingBoxX(x)
  640. local retVal = Polycode.Entity_setLocalBoundingBoxX(self.__ptr, x)
  641. end
  642. function Entity:setLocalBoundingBoxY(y)
  643. local retVal = Polycode.Entity_setLocalBoundingBoxY(self.__ptr, y)
  644. end
  645. function Entity:setLocalBoundingBoxZ(z)
  646. local retVal = Polycode.Entity_setLocalBoundingBoxZ(self.__ptr, z)
  647. end
  648. function Entity:setContainerScene(scene)
  649. local retVal = Polycode.Entity_setContainerScene(self.__ptr, scene.__ptr)
  650. end
  651. function Entity:getContainerScene()
  652. local retVal = Polycode.Entity_getContainerScene(self.__ptr)
  653. if retVal == nil then return nil end
  654. local __c = _G["Scene"]("__skip_ptr__")
  655. __c.__ptr = retVal
  656. return __c
  657. end
  658. function Entity:attachScript(script)
  659. local retVal = Polycode.Entity_attachScript(self.__ptr, script.__ptr)
  660. end
  661. function Entity:detachScript(script)
  662. local retVal = Polycode.Entity_detachScript(self.__ptr, script.__ptr)
  663. end
  664. function Entity:getNumScripts()
  665. local retVal = Polycode.Entity_getNumScripts(self.__ptr)
  666. return retVal
  667. end
  668. function Entity:getScriptAtIndex(index)
  669. local retVal = Polycode.Entity_getScriptAtIndex(self.__ptr, index)
  670. if retVal == nil then return nil end
  671. local __c = _G["ScriptInstance"]("__skip_ptr__")
  672. __c.__ptr = retVal
  673. return __c
  674. end
  675. function Entity:__delete()
  676. if self then Polycode.delete_Entity(self.__ptr) end
  677. end