Entity.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. function Entity() {
  2. }
  3. Entity.prototype.initEntity = function() {
  4. Polycode.Entity_initEntity(this.__ptr)
  5. }
  6. Entity.prototype.Render = function(buffer) {
  7. Polycode.Entity_Render(this.__ptr, buffer)
  8. }
  9. Entity.prototype.Update = function() {
  10. Polycode.Entity_Update(this.__ptr)
  11. }
  12. Entity.prototype.fixedUpdate = function() {
  13. Polycode.Entity_fixedUpdate(this.__ptr)
  14. }
  15. Entity.prototype.transformAndRender = function(drawBuffer,parentScissorBox) {
  16. Polycode.Entity_transformAndRender(this.__ptr, drawBuffer,parentScissorBox)
  17. }
  18. Entity.prototype.renderChildren = function(buffer,parentScissorBox) {
  19. Polycode.Entity_renderChildren(this.__ptr, buffer,parentScissorBox)
  20. }
  21. Entity.prototype.Clone = function(deepClone,ignoreEditorOnly) {
  22. Polycode.Entity_Clone(this.__ptr, deepClone,ignoreEditorOnly)
  23. }
  24. Entity.prototype.applyClone = function(clone,deepClone,ignoreEditorOnly) {
  25. Polycode.Entity_applyClone(this.__ptr, clone,deepClone,ignoreEditorOnly)
  26. }
  27. Entity.prototype.dirtyMatrix = function(val) {
  28. Polycode.Entity_dirtyMatrix(this.__ptr, val)
  29. }
  30. Entity.prototype.rebuildTransformMatrix = function() {
  31. Polycode.Entity_rebuildTransformMatrix(this.__ptr)
  32. }
  33. Entity.prototype.updateEntityMatrix = function() {
  34. Polycode.Entity_updateEntityMatrix(this.__ptr)
  35. }
  36. Entity.prototype.getTransformMatrix = function() {
  37. Polycode.Entity_getTransformMatrix(this.__ptr)
  38. }
  39. Entity.prototype.getConcatenatedMatrix = function() {
  40. Polycode.Entity_getConcatenatedMatrix(this.__ptr)
  41. }
  42. Entity.prototype.getConcatenatedMatrixRelativeTo = function(relativeEntity) {
  43. Polycode.Entity_getConcatenatedMatrixRelativeTo(this.__ptr, relativeEntity)
  44. }
  45. Entity.prototype.getAnchorAdjustedMatrix = function() {
  46. Polycode.Entity_getAnchorAdjustedMatrix(this.__ptr)
  47. }
  48. Entity.prototype.getConcatenatedRollMatrix = function() {
  49. Polycode.Entity_getConcatenatedRollMatrix(this.__ptr)
  50. }
  51. Entity.prototype.setTransformByMatrixPure = function(matrix) {
  52. Polycode.Entity_setTransformByMatrixPure(this.__ptr, matrix)
  53. }
  54. Entity.prototype.getLookAtMatrix = function(loc,upVector) {
  55. Polycode.Entity_getLookAtMatrix(this.__ptr, loc,upVector)
  56. }
  57. Entity.prototype.addChild = function(newChild) {
  58. Polycode.Entity_addChild(this.__ptr, newChild)
  59. }
  60. Entity.prototype.removeChild = function(entityToRemove) {
  61. Polycode.Entity_removeChild(this.__ptr, entityToRemove)
  62. }
  63. Entity.prototype.moveChildUp = function(child) {
  64. Polycode.Entity_moveChildUp(this.__ptr, child)
  65. }
  66. Entity.prototype.moveChildDown = function(child) {
  67. Polycode.Entity_moveChildDown(this.__ptr, child)
  68. }
  69. Entity.prototype.moveChildTop = function(child) {
  70. Polycode.Entity_moveChildTop(this.__ptr, child)
  71. }
  72. Entity.prototype.moveChildBottom = function(child) {
  73. Polycode.Entity_moveChildBottom(this.__ptr, child)
  74. }
  75. Entity.prototype.setParentEntity = function(entity) {
  76. Polycode.Entity_setParentEntity(this.__ptr, entity)
  77. }
  78. Entity.prototype.getParentEntity = function() {
  79. Polycode.Entity_getParentEntity(this.__ptr)
  80. }
  81. Entity.prototype.getNumChildren = function() {
  82. Polycode.Entity_getNumChildren(this.__ptr)
  83. }
  84. Entity.prototype.getChildAtIndex = function(index) {
  85. Polycode.Entity_getChildAtIndex(this.__ptr, index)
  86. }
  87. Entity.prototype.setOwnsChildrenRecursive = function(val) {
  88. Polycode.Entity_setOwnsChildrenRecursive(this.__ptr, val)
  89. }
  90. Entity.prototype.getPosition = function() {
  91. Polycode.Entity_getPosition(this.__ptr)
  92. }
  93. Entity.prototype.getPosition2D = function() {
  94. Polycode.Entity_getPosition2D(this.__ptr)
  95. }
  96. Entity.prototype.getCombinedPosition = function() {
  97. Polycode.Entity_getCombinedPosition(this.__ptr)
  98. }
  99. Entity.prototype.setPosition = function(x,y,z) {
  100. Polycode.Entity_setPosition(this.__ptr, x,y,z)
  101. }
  102. Entity.prototype.setPositionX = function(x) {
  103. Polycode.Entity_setPositionX(this.__ptr, x)
  104. }
  105. Entity.prototype.setPositionY = function(y) {
  106. Polycode.Entity_setPositionY(this.__ptr, y)
  107. }
  108. Entity.prototype.Translate = function(x,y,z) {
  109. Polycode.Entity_Translate(this.__ptr, x,y,z)
  110. }
  111. Entity.prototype.setPositionZ = function(z) {
  112. Polycode.Entity_setPositionZ(this.__ptr, z)
  113. }
  114. Entity.prototype.setScaleX = function(x) {
  115. Polycode.Entity_setScaleX(this.__ptr, x)
  116. }
  117. Entity.prototype.setScaleY = function(y) {
  118. Polycode.Entity_setScaleY(this.__ptr, y)
  119. }
  120. Entity.prototype.setScaleZ = function(z) {
  121. Polycode.Entity_setScaleZ(this.__ptr, z)
  122. }
  123. Entity.prototype.Scale = function(x,y,z) {
  124. Polycode.Entity_Scale(this.__ptr, x,y,z)
  125. }
  126. Entity.prototype.setScale = function(x,y,z) {
  127. Polycode.Entity_setScale(this.__ptr, x,y,z)
  128. }
  129. Entity.prototype.getCompoundScale = function() {
  130. Polycode.Entity_getCompoundScale(this.__ptr)
  131. }
  132. Entity.prototype.getScale = function() {
  133. Polycode.Entity_getScale(this.__ptr)
  134. }
  135. Entity.prototype.getRotationEuler = function() {
  136. Polycode.Entity_getRotationEuler(this.__ptr)
  137. }
  138. Entity.prototype.getCombinedPitch = function() {
  139. Polycode.Entity_getCombinedPitch(this.__ptr)
  140. }
  141. Entity.prototype.getCombinedYaw = function() {
  142. Polycode.Entity_getCombinedYaw(this.__ptr)
  143. }
  144. Entity.prototype.getCombinedRoll = function() {
  145. Polycode.Entity_getCombinedRoll(this.__ptr)
  146. }
  147. Entity.prototype.rebuildRotation = function() {
  148. Polycode.Entity_rebuildRotation(this.__ptr)
  149. }
  150. Entity.prototype.setRotationEuler = function(rotation) {
  151. Polycode.Entity_setRotationEuler(this.__ptr, rotation)
  152. }
  153. Entity.prototype.setPitch = function(pitch) {
  154. Polycode.Entity_setPitch(this.__ptr, pitch)
  155. }
  156. Entity.prototype.setYaw = function(yaw) {
  157. Polycode.Entity_setYaw(this.__ptr, yaw)
  158. }
  159. Entity.prototype.setRoll = function(roll) {
  160. Polycode.Entity_setRoll(this.__ptr, roll)
  161. }
  162. Entity.prototype.Roll = function(roll) {
  163. Polycode.Entity_Roll(this.__ptr, roll)
  164. }
  165. Entity.prototype.Yaw = function(yaw) {
  166. Polycode.Entity_Yaw(this.__ptr, yaw)
  167. }
  168. Entity.prototype.Pitch = function(pitch) {
  169. Polycode.Entity_Pitch(this.__ptr, pitch)
  170. }
  171. Entity.prototype.getPitch = function() {
  172. Polycode.Entity_getPitch(this.__ptr)
  173. }
  174. Entity.prototype.getYaw = function() {
  175. Polycode.Entity_getYaw(this.__ptr)
  176. }
  177. Entity.prototype.getRoll = function() {
  178. Polycode.Entity_getRoll(this.__ptr)
  179. }
  180. Entity.prototype.getWidth = function() {
  181. Polycode.Entity_getWidth(this.__ptr)
  182. }
  183. Entity.prototype.getHeight = function() {
  184. Polycode.Entity_getHeight(this.__ptr)
  185. }
  186. Entity.prototype.getDepth = function() {
  187. Polycode.Entity_getDepth(this.__ptr)
  188. }
  189. Entity.prototype.setWidth = function(width) {
  190. Polycode.Entity_setWidth(this.__ptr, width)
  191. }
  192. Entity.prototype.setHeight = function(height) {
  193. Polycode.Entity_setHeight(this.__ptr, height)
  194. }
  195. Entity.prototype.setDepth = function(depth) {
  196. Polycode.Entity_setDepth(this.__ptr, depth)
  197. }
  198. Entity.prototype.setRotationQuat = function(w,x,y,z) {
  199. Polycode.Entity_setRotationQuat(this.__ptr, w,x,y,z)
  200. }
  201. Entity.prototype.setRotationByQuaternion = function(quaternion) {
  202. Polycode.Entity_setRotationByQuaternion(this.__ptr, quaternion)
  203. }
  204. Entity.prototype.getRotationQuat = function() {
  205. Polycode.Entity_getRotationQuat(this.__ptr)
  206. }
  207. Entity.prototype.getConcatenatedQuat = function() {
  208. Polycode.Entity_getConcatenatedQuat(this.__ptr)
  209. }
  210. Entity.prototype.lookAt = function(loc,upVector) {
  211. Polycode.Entity_lookAt(this.__ptr, loc,upVector)
  212. }
  213. Entity.prototype.lookAtEntity = function(entity,upVector) {
  214. Polycode.Entity_lookAtEntity(this.__ptr, entity,upVector)
  215. }
  216. Entity.prototype.getCombinedColor = function() {
  217. Polycode.Entity_getCombinedColor(this.__ptr)
  218. }
  219. Entity.prototype.setColor = function(r,g,b,a) {
  220. Polycode.Entity_setColor(this.__ptr, r,g,b,a)
  221. }
  222. Entity.prototype.setColorInt = function(r,g,b,a) {
  223. Polycode.Entity_setColorInt(this.__ptr, r,g,b,a)
  224. }
  225. Entity.prototype.setAnchorPoint = function(anchorPoint) {
  226. Polycode.Entity_setAnchorPoint(this.__ptr, anchorPoint)
  227. }
  228. Entity.prototype.getAnchorPoint = function() {
  229. Polycode.Entity_getAnchorPoint(this.__ptr)
  230. }
  231. Entity.prototype.onMouseDown = function(ray,mouseButton,timestamp) {
  232. Polycode.Entity_onMouseDown(this.__ptr, ray,mouseButton,timestamp)
  233. }
  234. Entity.prototype.onMouseUp = function(ray,mouseButton,timestamp) {
  235. Polycode.Entity_onMouseUp(this.__ptr, ray,mouseButton,timestamp)
  236. }
  237. Entity.prototype.onMouseMove = function(ray,timestamp) {
  238. Polycode.Entity_onMouseMove(this.__ptr, ray,timestamp)
  239. }
  240. Entity.prototype.onMouseWheelUp = function(ray,timestamp) {
  241. Polycode.Entity_onMouseWheelUp(this.__ptr, ray,timestamp)
  242. }
  243. Entity.prototype.onMouseWheelDown = function(ray,timestamp) {
  244. Polycode.Entity_onMouseWheelDown(this.__ptr, ray,timestamp)
  245. }
  246. Entity.prototype.setDepthOnly = function(val) {
  247. Polycode.Entity_setDepthOnly(this.__ptr, val)
  248. }
  249. Entity.prototype.getDepthOnly = function() {
  250. Polycode.Entity_getDepthOnly(this.__ptr)
  251. }
  252. Entity.prototype.setUserData = function(userData) {
  253. Polycode.Entity_setUserData(this.__ptr, userData)
  254. }
  255. Entity.prototype.getUserData = function() {
  256. Polycode.Entity_getUserData(this.__ptr)
  257. }
  258. Entity.prototype.setBlendingMode = function(newBlendingMode) {
  259. Polycode.Entity_setBlendingMode(this.__ptr, newBlendingMode)
  260. }
  261. Entity.prototype.getBlendingMode = function() {
  262. Polycode.Entity_getBlendingMode(this.__ptr)
  263. }
  264. Entity.prototype.getEntityById = function(id,recursive) {
  265. Polycode.Entity_getEntityById(this.__ptr, id,recursive)
  266. }
  267. Entity.prototype.getEntitiesByTag = function(tag,recursive) {
  268. Polycode.Entity_getEntitiesByTag(this.__ptr, tag,recursive)
  269. }
  270. Entity.prototype.getEntitiesByLayerID = function(layerID,recursive) {
  271. Polycode.Entity_getEntitiesByLayerID(this.__ptr, layerID,recursive)
  272. }
  273. Entity.prototype.getEntityProp = function(propName) {
  274. Polycode.Entity_getEntityProp(this.__ptr, propName)
  275. }
  276. Entity.prototype.setEntityProp = function(propName,propValue) {
  277. Polycode.Entity_setEntityProp(this.__ptr, propName,propValue)
  278. }
  279. Entity.prototype.setInverseY = function(val) {
  280. Polycode.Entity_setInverseY(this.__ptr, val)
  281. }
  282. Entity.prototype.getInverseY = function() {
  283. Polycode.Entity_getInverseY(this.__ptr)
  284. }
  285. Entity.prototype.doUpdates = function() {
  286. Polycode.Entity_doUpdates(this.__ptr)
  287. }
  288. Entity.prototype.doFixedUpdates = function() {
  289. Polycode.Entity_doFixedUpdates(this.__ptr)
  290. }
  291. Entity.prototype.buildPositionMatrix = function() {
  292. Polycode.Entity_buildPositionMatrix(this.__ptr)
  293. }
  294. Entity.prototype.setRenderer = function(renderer) {
  295. Polycode.Entity_setRenderer(this.__ptr, renderer)
  296. }
  297. Entity.prototype.customHitDetection = function(ray) {
  298. Polycode.Entity_customHitDetection(this.__ptr, ray)
  299. }
  300. Entity.prototype.getNumTags = function() {
  301. Polycode.Entity_getNumTags(this.__ptr)
  302. }
  303. Entity.prototype.getTagAtIndex = function(index) {
  304. Polycode.Entity_getTagAtIndex(this.__ptr, index)
  305. }
  306. Entity.prototype.hasTag = function(tag) {
  307. Polycode.Entity_hasTag(this.__ptr, tag)
  308. }
  309. Entity.prototype.clearTags = function() {
  310. Polycode.Entity_clearTags(this.__ptr)
  311. }
  312. Entity.prototype.addTag = function(tag) {
  313. Polycode.Entity_addTag(this.__ptr, tag)
  314. }
  315. Entity.prototype.getScreenPosition = function(projectionMatrix,cameraMatrix,viewport) {
  316. Polycode.Entity_getScreenPosition(this.__ptr, projectionMatrix,cameraMatrix,viewport)
  317. }
  318. Entity.prototype.recalculateAABBAllChildren = function() {
  319. Polycode.Entity_recalculateAABBAllChildren(this.__ptr)
  320. }
  321. Entity.prototype.recalculateAABB = function() {
  322. Polycode.Entity_recalculateAABB(this.__ptr)
  323. }
  324. Entity.prototype.getWorldAABB = function() {
  325. Polycode.Entity_getWorldAABB(this.__ptr)
  326. }
  327. Entity.prototype.getLocalBoundingBox = function() {
  328. Polycode.Entity_getLocalBoundingBox(this.__ptr)
  329. }
  330. Entity.prototype.setLocalBoundingBox = function(box) {
  331. Polycode.Entity_setLocalBoundingBox(this.__ptr, box)
  332. }
  333. Entity.prototype.setLocalBoundingBoxX = function(x) {
  334. Polycode.Entity_setLocalBoundingBoxX(this.__ptr, x)
  335. }
  336. Entity.prototype.setLocalBoundingBoxY = function(y) {
  337. Polycode.Entity_setLocalBoundingBoxY(this.__ptr, y)
  338. }
  339. Entity.prototype.setLocalBoundingBoxZ = function(z) {
  340. Polycode.Entity_setLocalBoundingBoxZ(this.__ptr, z)
  341. }
  342. Entity.prototype.setContainerScene = function(scene) {
  343. Polycode.Entity_setContainerScene(this.__ptr, scene)
  344. }
  345. Entity.prototype.getContainerScene = function() {
  346. Polycode.Entity_getContainerScene(this.__ptr)
  347. }
  348. Entity.prototype.attachScript = function(script) {
  349. Polycode.Entity_attachScript(this.__ptr, script)
  350. }
  351. Entity.prototype.detachScript = function(script) {
  352. Polycode.Entity_detachScript(this.__ptr, script)
  353. }
  354. Entity.prototype.getNumScripts = function() {
  355. Polycode.Entity_getNumScripts(this.__ptr)
  356. }
  357. Entity.prototype.getScriptAtIndex = function(index) {
  358. Polycode.Entity_getScriptAtIndex(this.__ptr, index)
  359. }