@defold-typescript/types 0.52.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (521) hide show
  1. package/api-signatures.json +2074 -1964
  2. package/dist/cli-runtime.js +8966 -0
  3. package/dist/identity-vocabulary.json +660 -0
  4. package/dist/src/index.d.ts +18 -0
  5. package/examples/translations.json +15 -15
  6. package/fixtures/defold-1.12.4/b2d_body_doc.json +1327 -0
  7. package/fixtures/defold-1.12.4/b2d_doc.json +107 -0
  8. package/fixtures/defold-1.12.4/base_doc.json +758 -0
  9. package/fixtures/defold-1.12.4/bit_doc.json +404 -0
  10. package/fixtures/defold-1.12.4/buffer_doc.json +422 -0
  11. package/fixtures/defold-1.12.4/camera_doc.json +664 -0
  12. package/fixtures/defold-1.12.4/collectionfactory_doc.json +219 -0
  13. package/fixtures/defold-1.12.4/collectionproxy_doc.json +289 -0
  14. package/fixtures/defold-1.12.4/coroutine_doc.json +151 -0
  15. package/fixtures/defold-1.12.4/crash_doc.json +497 -0
  16. package/fixtures/defold-1.12.4/debug_doc.json +410 -0
  17. package/fixtures/defold-1.12.4/factory_doc.json +219 -0
  18. package/fixtures/defold-1.12.4/font_doc.json +141 -0
  19. package/fixtures/defold-1.12.4/globals_doc.json +42 -0
  20. package/fixtures/defold-1.12.4/go-instance-functions.json +111 -0
  21. package/fixtures/defold-1.12.4/go_doc.json +1901 -0
  22. package/fixtures/defold-1.12.4/graphics_doc.json +1634 -0
  23. package/fixtures/defold-1.12.4/gui_doc.json +5249 -0
  24. package/fixtures/defold-1.12.4/html5_doc.json +64 -0
  25. package/fixtures/defold-1.12.4/http_doc.json +66 -0
  26. package/fixtures/defold-1.12.4/image_doc.json +170 -0
  27. package/fixtures/defold-1.12.4/io_doc.json +399 -0
  28. package/fixtures/defold-1.12.4/json_doc.json +97 -0
  29. package/fixtures/defold-1.12.4/label_doc.json +220 -0
  30. package/fixtures/defold-1.12.4/liveupdate_doc.json +308 -0
  31. package/fixtures/defold-1.12.4/math_doc.json +702 -0
  32. package/fixtures/defold-1.12.4/messages_doc.json +579 -0
  33. package/fixtures/defold-1.12.4/model_doc.json +315 -0
  34. package/fixtures/defold-1.12.4/msg_doc.json +137 -0
  35. package/fixtures/defold-1.12.4/os_doc.json +266 -0
  36. package/fixtures/defold-1.12.4/package_doc.json +139 -0
  37. package/fixtures/defold-1.12.4/particlefx_doc.json +249 -0
  38. package/fixtures/defold-1.12.4/physics_doc.json +1120 -0
  39. package/fixtures/defold-1.12.4/profiler_doc.json +375 -0
  40. package/fixtures/defold-1.12.4/render_doc.json +1167 -0
  41. package/fixtures/defold-1.12.4/resource_doc.json +762 -0
  42. package/fixtures/defold-1.12.4/socket_doc.json +2194 -0
  43. package/fixtures/defold-1.12.4/sound_doc.json +582 -0
  44. package/fixtures/defold-1.12.4/sprite_doc.json +245 -0
  45. package/fixtures/defold-1.12.4/string_doc.json +412 -0
  46. package/fixtures/defold-1.12.4/sys_doc.json +853 -0
  47. package/fixtures/defold-1.12.4/table_doc.json +166 -0
  48. package/fixtures/defold-1.12.4/tilemap_doc.json +374 -0
  49. package/fixtures/defold-1.12.4/timer_doc.json +153 -0
  50. package/fixtures/defold-1.12.4/types_doc.json +212 -0
  51. package/fixtures/defold-1.12.4/vmath_doc.json +1814 -0
  52. package/fixtures/defold-1.12.4/window_doc.json +388 -0
  53. package/fixtures/defold-1.12.4/zlib_doc.json +70 -0
  54. package/fixtures/defold-1.13.0/b2d_body_doc.json +2428 -0
  55. package/fixtures/defold-1.13.0/b2d_chain_doc.json +394 -0
  56. package/fixtures/defold-1.13.0/b2d_doc.json +128 -0
  57. package/fixtures/defold-1.13.0/b2d_fixture_doc.json +594 -0
  58. package/fixtures/defold-1.13.0/b2d_joint_doc.json +3315 -0
  59. package/fixtures/defold-1.13.0/b2d_shape_doc.json +802 -0
  60. package/fixtures/defold-1.13.0/b2d_world_doc.json +1314 -0
  61. package/fixtures/defold-1.13.0/base_doc.json +758 -0
  62. package/fixtures/defold-1.13.0/bit_doc.json +404 -0
  63. package/fixtures/defold-1.13.0/buffer_doc.json +422 -0
  64. package/fixtures/defold-1.13.0/camera_doc.json +900 -0
  65. package/fixtures/defold-1.13.0/collectionfactory_doc.json +219 -0
  66. package/fixtures/defold-1.13.0/collectionproxy_doc.json +289 -0
  67. package/fixtures/defold-1.13.0/compute_doc.json +182 -0
  68. package/fixtures/defold-1.13.0/coroutine_doc.json +151 -0
  69. package/fixtures/defold-1.13.0/crash_doc.json +497 -0
  70. package/fixtures/defold-1.13.0/debug_doc.json +410 -0
  71. package/fixtures/defold-1.13.0/editor_doc.json +3665 -0
  72. package/fixtures/defold-1.13.0/editor_http_doc.json +273 -0
  73. package/fixtures/defold-1.13.0/editor_json_doc.json +59 -0
  74. package/fixtures/defold-1.13.0/editor_localization_doc.json +138 -0
  75. package/fixtures/defold-1.13.0/editor_pprint_doc.json +36 -0
  76. package/fixtures/defold-1.13.0/editor_tilemap_tiles_doc.json +235 -0
  77. package/fixtures/defold-1.13.0/editor_zip_doc.json +163 -0
  78. package/fixtures/defold-1.13.0/editor_zlib_doc.json +48 -0
  79. package/fixtures/defold-1.13.0/factory_doc.json +219 -0
  80. package/fixtures/defold-1.13.0/font_doc.json +141 -0
  81. package/fixtures/defold-1.13.0/globals_doc.json +42 -0
  82. package/fixtures/defold-1.13.0/go-instance-functions.json +101 -0
  83. package/fixtures/defold-1.13.0/go_doc.json +1989 -0
  84. package/fixtures/defold-1.13.0/graphics_doc.json +1886 -0
  85. package/fixtures/defold-1.13.0/gui_doc.json +5277 -0
  86. package/fixtures/defold-1.13.0/html5_doc.json +64 -0
  87. package/fixtures/defold-1.13.0/http_doc.json +66 -0
  88. package/fixtures/defold-1.13.0/image_doc.json +170 -0
  89. package/fixtures/defold-1.13.0/import-manifest.json +10558 -0
  90. package/fixtures/defold-1.13.0/io_doc.json +399 -0
  91. package/fixtures/defold-1.13.0/json_doc.json +97 -0
  92. package/fixtures/defold-1.13.0/label_doc.json +220 -0
  93. package/fixtures/defold-1.13.0/liveupdate_doc.json +330 -0
  94. package/fixtures/defold-1.13.0/material_doc.json +238 -0
  95. package/fixtures/defold-1.13.0/math_doc.json +702 -0
  96. package/fixtures/defold-1.13.0/model_doc.json +412 -0
  97. package/fixtures/defold-1.13.0/msg_doc.json +137 -0
  98. package/fixtures/defold-1.13.0/os_doc.json +266 -0
  99. package/fixtures/defold-1.13.0/package_doc.json +139 -0
  100. package/fixtures/defold-1.13.0/particlefx_doc.json +249 -0
  101. package/fixtures/defold-1.13.0/physics_doc.json +1492 -0
  102. package/fixtures/defold-1.13.0/profiler_doc.json +375 -0
  103. package/fixtures/defold-1.13.0/render_doc.json +1381 -0
  104. package/fixtures/defold-1.13.0/resource_doc.json +762 -0
  105. package/fixtures/defold-1.13.0/socket_doc.json +2194 -0
  106. package/fixtures/defold-1.13.0/sound_doc.json +582 -0
  107. package/fixtures/defold-1.13.0/sprite_doc.json +335 -0
  108. package/fixtures/defold-1.13.0/string_doc.json +412 -0
  109. package/fixtures/defold-1.13.0/sys_doc.json +1142 -0
  110. package/fixtures/defold-1.13.0/table_doc.json +166 -0
  111. package/fixtures/defold-1.13.0/tilemap_doc.json +402 -0
  112. package/fixtures/defold-1.13.0/timer_doc.json +153 -0
  113. package/fixtures/defold-1.13.0/types_doc.json +212 -0
  114. package/fixtures/defold-1.13.0/vmath_doc.json +1814 -0
  115. package/fixtures/defold-1.13.0/window_doc.json +388 -0
  116. package/fixtures/defold-1.13.0/zlib_doc.json +70 -0
  117. package/fixtures/defold-1.13.1/b2d_body_doc.json +2428 -0
  118. package/fixtures/defold-1.13.1/b2d_chain_doc.json +394 -0
  119. package/fixtures/defold-1.13.1/b2d_doc.json +128 -0
  120. package/fixtures/defold-1.13.1/b2d_fixture_doc.json +594 -0
  121. package/fixtures/defold-1.13.1/b2d_joint_doc.json +3315 -0
  122. package/fixtures/defold-1.13.1/b2d_shape_doc.json +802 -0
  123. package/fixtures/defold-1.13.1/b2d_world_doc.json +1314 -0
  124. package/fixtures/defold-1.13.1/base_doc.json +758 -0
  125. package/fixtures/defold-1.13.1/bit_doc.json +404 -0
  126. package/fixtures/defold-1.13.1/buffer_doc.json +422 -0
  127. package/fixtures/defold-1.13.1/camera_doc.json +900 -0
  128. package/fixtures/defold-1.13.1/collectionfactory_doc.json +219 -0
  129. package/fixtures/defold-1.13.1/collectionproxy_doc.json +323 -0
  130. package/fixtures/defold-1.13.1/compute_doc.json +182 -0
  131. package/fixtures/defold-1.13.1/coroutine_doc.json +151 -0
  132. package/fixtures/defold-1.13.1/crash_doc.json +497 -0
  133. package/fixtures/defold-1.13.1/debug_doc.json +410 -0
  134. package/fixtures/defold-1.13.1/editor_doc.json +3880 -0
  135. package/fixtures/defold-1.13.1/editor_http_doc.json +273 -0
  136. package/fixtures/defold-1.13.1/editor_image_doc.json +128 -0
  137. package/fixtures/defold-1.13.1/editor_json_doc.json +59 -0
  138. package/fixtures/defold-1.13.1/editor_localization_doc.json +138 -0
  139. package/fixtures/defold-1.13.1/editor_pprint_doc.json +36 -0
  140. package/fixtures/defold-1.13.1/editor_tilemap_tiles_doc.json +235 -0
  141. package/fixtures/defold-1.13.1/editor_zip_doc.json +163 -0
  142. package/fixtures/defold-1.13.1/editor_zlib_doc.json +48 -0
  143. package/fixtures/defold-1.13.1/factory_doc.json +219 -0
  144. package/fixtures/defold-1.13.1/font_doc.json +141 -0
  145. package/fixtures/defold-1.13.1/globals_doc.json +42 -0
  146. package/fixtures/defold-1.13.1/go-instance-functions.json +102 -0
  147. package/fixtures/defold-1.13.1/go_doc.json +1989 -0
  148. package/fixtures/defold-1.13.1/graphics_doc.json +1886 -0
  149. package/fixtures/defold-1.13.1/gui_doc.json +5277 -0
  150. package/fixtures/defold-1.13.1/html5_doc.json +64 -0
  151. package/fixtures/defold-1.13.1/http_doc.json +66 -0
  152. package/fixtures/defold-1.13.1/image_doc.json +170 -0
  153. package/fixtures/defold-1.13.1/import-manifest.json +10091 -0
  154. package/fixtures/defold-1.13.1/io_doc.json +399 -0
  155. package/fixtures/defold-1.13.1/json_doc.json +97 -0
  156. package/fixtures/defold-1.13.1/label_doc.json +220 -0
  157. package/fixtures/defold-1.13.1/liveupdate_doc.json +330 -0
  158. package/fixtures/defold-1.13.1/material_doc.json +238 -0
  159. package/fixtures/defold-1.13.1/math_doc.json +702 -0
  160. package/fixtures/defold-1.13.1/model_doc.json +412 -0
  161. package/fixtures/defold-1.13.1/msg_doc.json +137 -0
  162. package/fixtures/defold-1.13.1/os_doc.json +266 -0
  163. package/fixtures/defold-1.13.1/package_doc.json +139 -0
  164. package/fixtures/defold-1.13.1/particlefx_doc.json +249 -0
  165. package/fixtures/defold-1.13.1/physics_doc.json +1492 -0
  166. package/fixtures/defold-1.13.1/profiler_doc.json +375 -0
  167. package/fixtures/defold-1.13.1/render_doc.json +1381 -0
  168. package/fixtures/defold-1.13.1/resource_doc.json +762 -0
  169. package/fixtures/defold-1.13.1/socket_doc.json +2194 -0
  170. package/fixtures/defold-1.13.1/sound_doc.json +582 -0
  171. package/fixtures/defold-1.13.1/sprite_doc.json +335 -0
  172. package/fixtures/defold-1.13.1/string_doc.json +412 -0
  173. package/fixtures/defold-1.13.1/sys_doc.json +1142 -0
  174. package/fixtures/defold-1.13.1/table_doc.json +166 -0
  175. package/fixtures/defold-1.13.1/tilemap_doc.json +402 -0
  176. package/fixtures/defold-1.13.1/timer_doc.json +153 -0
  177. package/fixtures/defold-1.13.1/types_doc.json +212 -0
  178. package/fixtures/defold-1.13.1/vmath_doc.json +1814 -0
  179. package/fixtures/defold-1.13.1/window_doc.json +388 -0
  180. package/fixtures/defold-1.13.1/zlib_doc.json +70 -0
  181. package/fixtures/defold-1.13.2/b2d_body_doc.json +2359 -0
  182. package/fixtures/defold-1.13.2/b2d_chain_doc.json +395 -0
  183. package/fixtures/defold-1.13.2/b2d_doc.json +1945 -0
  184. package/fixtures/defold-1.13.2/b2d_fixture_doc.json +595 -0
  185. package/fixtures/defold-1.13.2/b2d_joint_doc.json +3178 -0
  186. package/fixtures/defold-1.13.2/b2d_shape_doc.json +767 -0
  187. package/fixtures/defold-1.13.2/b2d_world_doc.json +1315 -0
  188. package/fixtures/defold-1.13.2/base_doc.json +759 -0
  189. package/fixtures/defold-1.13.2/bit_doc.json +405 -0
  190. package/fixtures/defold-1.13.2/buffer_doc.json +393 -0
  191. package/fixtures/defold-1.13.2/bullet3d_collision_object_doc.json +1206 -0
  192. package/fixtures/defold-1.13.2/bullet3d_constraint_doc.json +2455 -0
  193. package/fixtures/defold-1.13.2/bullet3d_doc.json +215 -0
  194. package/fixtures/defold-1.13.2/bullet3d_rigid_body_doc.json +1376 -0
  195. package/fixtures/defold-1.13.2/bullet3d_shape_doc.json +430 -0
  196. package/fixtures/defold-1.13.2/bullet3d_world_doc.json +855 -0
  197. package/fixtures/defold-1.13.2/camera_doc.json +887 -0
  198. package/fixtures/defold-1.13.2/collectionfactory_doc.json +206 -0
  199. package/fixtures/defold-1.13.2/collectionproxy_doc.json +397 -0
  200. package/fixtures/defold-1.13.2/compute_doc.json +183 -0
  201. package/fixtures/defold-1.13.2/coroutine_doc.json +152 -0
  202. package/fixtures/defold-1.13.2/crash_doc.json +483 -0
  203. package/fixtures/defold-1.13.2/debug_doc.json +411 -0
  204. package/fixtures/defold-1.13.2/editor_doc.json +6320 -0
  205. package/fixtures/defold-1.13.2/editor_http_doc.json +476 -0
  206. package/fixtures/defold-1.13.2/editor_image_doc.json +129 -0
  207. package/fixtures/defold-1.13.2/editor_json_doc.json +81 -0
  208. package/fixtures/defold-1.13.2/editor_localization_doc.json +139 -0
  209. package/fixtures/defold-1.13.2/editor_pprint_doc.json +37 -0
  210. package/fixtures/defold-1.13.2/editor_tilemap_tiles_doc.json +292 -0
  211. package/fixtures/defold-1.13.2/editor_zip_doc.json +237 -0
  212. package/fixtures/defold-1.13.2/editor_zlib_doc.json +49 -0
  213. package/fixtures/defold-1.13.2/factory_doc.json +206 -0
  214. package/fixtures/defold-1.13.2/font_doc.json +230 -0
  215. package/fixtures/defold-1.13.2/globals_doc.json +64 -0
  216. package/fixtures/defold-1.13.2/go-instance-functions.json +106 -0
  217. package/fixtures/defold-1.13.2/go_doc.json +1789 -0
  218. package/fixtures/defold-1.13.2/graphics_doc.json +1211 -0
  219. package/fixtures/defold-1.13.2/gui_doc.json +4735 -0
  220. package/fixtures/defold-1.13.2/html5_doc.json +65 -0
  221. package/fixtures/defold-1.13.2/http_doc.json +174 -0
  222. package/fixtures/defold-1.13.2/image_doc.json +298 -0
  223. package/fixtures/defold-1.13.2/import-manifest.json +10902 -0
  224. package/fixtures/defold-1.13.2/io_doc.json +400 -0
  225. package/fixtures/defold-1.13.2/json_doc.json +140 -0
  226. package/fixtures/defold-1.13.2/label_doc.json +427 -0
  227. package/fixtures/defold-1.13.2/liveupdate_doc.json +221 -0
  228. package/fixtures/defold-1.13.2/material_doc.json +773 -0
  229. package/fixtures/defold-1.13.2/math_doc.json +703 -0
  230. package/fixtures/defold-1.13.2/model_doc.json +472 -0
  231. package/fixtures/defold-1.13.2/msg_doc.json +169 -0
  232. package/fixtures/defold-1.13.2/os_doc.json +269 -0
  233. package/fixtures/defold-1.13.2/package_doc.json +140 -0
  234. package/fixtures/defold-1.13.2/particlefx_doc.json +249 -0
  235. package/fixtures/defold-1.13.2/physics_doc.json +1624 -0
  236. package/fixtures/defold-1.13.2/profiler_doc.json +348 -0
  237. package/fixtures/defold-1.13.2/render_doc.json +1623 -0
  238. package/fixtures/defold-1.13.2/resource_doc.json +1539 -0
  239. package/fixtures/defold-1.13.2/socket_doc.json +2335 -0
  240. package/fixtures/defold-1.13.2/sound_doc.json +673 -0
  241. package/fixtures/defold-1.13.2/sprite_doc.json +364 -0
  242. package/fixtures/defold-1.13.2/string_doc.json +413 -0
  243. package/fixtures/defold-1.13.2/sys_doc.json +1347 -0
  244. package/fixtures/defold-1.13.2/table_doc.json +167 -0
  245. package/fixtures/defold-1.13.2/tilemap_doc.json +369 -0
  246. package/fixtures/defold-1.13.2/timer_doc.json +214 -0
  247. package/fixtures/defold-1.13.2/types_doc.json +213 -0
  248. package/fixtures/defold-1.13.2/vmath_doc.json +2056 -0
  249. package/fixtures/defold-1.13.2/window_doc.json +426 -0
  250. package/fixtures/defold-1.13.2/zlib_doc.json +71 -0
  251. package/fixtures/defold-1.14.0/b2d_body_doc.json +2359 -0
  252. package/fixtures/defold-1.14.0/b2d_chain_doc.json +395 -0
  253. package/fixtures/defold-1.14.0/b2d_doc.json +1973 -0
  254. package/fixtures/defold-1.14.0/b2d_fixture_doc.json +595 -0
  255. package/fixtures/defold-1.14.0/b2d_joint_doc.json +3178 -0
  256. package/fixtures/defold-1.14.0/b2d_shape_doc.json +767 -0
  257. package/fixtures/defold-1.14.0/b2d_world_doc.json +1315 -0
  258. package/fixtures/defold-1.14.0/base_doc.json +759 -0
  259. package/fixtures/defold-1.14.0/bit_doc.json +405 -0
  260. package/fixtures/defold-1.14.0/buffer_doc.json +393 -0
  261. package/fixtures/defold-1.14.0/bullet3d_collision_object_doc.json +1206 -0
  262. package/fixtures/defold-1.14.0/bullet3d_constraint_doc.json +2455 -0
  263. package/fixtures/defold-1.14.0/bullet3d_doc.json +243 -0
  264. package/fixtures/defold-1.14.0/bullet3d_rigid_body_doc.json +1376 -0
  265. package/fixtures/defold-1.14.0/bullet3d_shape_doc.json +430 -0
  266. package/fixtures/defold-1.14.0/bullet3d_world_doc.json +855 -0
  267. package/fixtures/defold-1.14.0/camera_doc.json +887 -0
  268. package/fixtures/defold-1.14.0/collectionfactory_doc.json +206 -0
  269. package/fixtures/defold-1.14.0/collectionproxy_doc.json +397 -0
  270. package/fixtures/defold-1.14.0/compute_doc.json +183 -0
  271. package/fixtures/defold-1.14.0/coroutine_doc.json +152 -0
  272. package/fixtures/defold-1.14.0/crash_doc.json +483 -0
  273. package/fixtures/defold-1.14.0/debug_doc.json +411 -0
  274. package/fixtures/defold-1.14.0/editor_doc.json +6320 -0
  275. package/fixtures/defold-1.14.0/editor_http_doc.json +476 -0
  276. package/fixtures/defold-1.14.0/editor_image_doc.json +129 -0
  277. package/fixtures/defold-1.14.0/editor_json_doc.json +81 -0
  278. package/fixtures/defold-1.14.0/editor_localization_doc.json +139 -0
  279. package/fixtures/defold-1.14.0/editor_pprint_doc.json +37 -0
  280. package/fixtures/defold-1.14.0/editor_tilemap_tiles_doc.json +292 -0
  281. package/fixtures/defold-1.14.0/editor_zip_doc.json +237 -0
  282. package/fixtures/defold-1.14.0/editor_zlib_doc.json +49 -0
  283. package/fixtures/defold-1.14.0/factory_doc.json +206 -0
  284. package/fixtures/defold-1.14.0/font_doc.json +230 -0
  285. package/fixtures/defold-1.14.0/globals_doc.json +64 -0
  286. package/fixtures/defold-1.14.0/go-instance-functions.json +106 -0
  287. package/fixtures/defold-1.14.0/go_doc.json +1789 -0
  288. package/fixtures/defold-1.14.0/graphics_doc.json +1257 -0
  289. package/fixtures/defold-1.14.0/gui_doc.json +4735 -0
  290. package/fixtures/defold-1.14.0/html5_doc.json +65 -0
  291. package/fixtures/defold-1.14.0/http_doc.json +174 -0
  292. package/fixtures/defold-1.14.0/image_doc.json +298 -0
  293. package/fixtures/defold-1.14.0/import-manifest.json +10260 -0
  294. package/fixtures/defold-1.14.0/io_doc.json +400 -0
  295. package/fixtures/defold-1.14.0/json_doc.json +140 -0
  296. package/fixtures/defold-1.14.0/label_doc.json +427 -0
  297. package/fixtures/defold-1.14.0/liveupdate_doc.json +221 -0
  298. package/fixtures/defold-1.14.0/material_doc.json +773 -0
  299. package/fixtures/defold-1.14.0/math_doc.json +703 -0
  300. package/fixtures/defold-1.14.0/model_doc.json +472 -0
  301. package/fixtures/defold-1.14.0/msg_doc.json +169 -0
  302. package/fixtures/defold-1.14.0/os_doc.json +269 -0
  303. package/fixtures/defold-1.14.0/package_doc.json +140 -0
  304. package/fixtures/defold-1.14.0/particlefx_doc.json +249 -0
  305. package/fixtures/defold-1.14.0/physics_doc.json +1624 -0
  306. package/fixtures/defold-1.14.0/profiler_doc.json +348 -0
  307. package/fixtures/defold-1.14.0/render_doc.json +1628 -0
  308. package/fixtures/defold-1.14.0/resource_doc.json +1539 -0
  309. package/fixtures/defold-1.14.0/socket_doc.json +2335 -0
  310. package/fixtures/defold-1.14.0/sound_doc.json +673 -0
  311. package/fixtures/defold-1.14.0/sprite_doc.json +364 -0
  312. package/fixtures/defold-1.14.0/string_doc.json +413 -0
  313. package/fixtures/defold-1.14.0/sys_doc.json +1347 -0
  314. package/fixtures/defold-1.14.0/table_doc.json +167 -0
  315. package/fixtures/defold-1.14.0/tilemap_doc.json +369 -0
  316. package/fixtures/defold-1.14.0/timer_doc.json +214 -0
  317. package/fixtures/defold-1.14.0/types_doc.json +213 -0
  318. package/fixtures/defold-1.14.0/vmath_doc.json +2056 -0
  319. package/fixtures/defold-1.14.0/window_doc.json +426 -0
  320. package/fixtures/defold-1.14.0/zlib_doc.json +71 -0
  321. package/generated/b2d.d.ts +39 -39
  322. package/generated/b2d_body.d.ts +11 -11
  323. package/generated/b2d_chain.d.ts +3 -3
  324. package/generated/b2d_fixture.d.ts +5 -5
  325. package/generated/b2d_joint.d.ts +29 -29
  326. package/generated/b2d_shape.d.ts +13 -13
  327. package/generated/b2d_world.d.ts +15 -15
  328. package/generated/buffer.d.ts +5 -6
  329. package/generated/bullet3d.d.ts +6 -6
  330. package/generated/bullet3d_collision_object.d.ts +9 -9
  331. package/generated/bullet3d_constraint.d.ts +78 -78
  332. package/generated/bullet3d_rigid_body.d.ts +3 -3
  333. package/generated/bullet3d_shape.d.ts +11 -11
  334. package/generated/bullet3d_world.d.ts +20 -20
  335. package/generated/camera.d.ts +4 -4
  336. package/generated/collectionfactory.d.ts +2 -3
  337. package/generated/collectionproxy.d.ts +5 -5
  338. package/generated/compute.d.ts +5 -5
  339. package/generated/crash.d.ts +7 -7
  340. package/generated/editor-vm/http.d.ts +13 -13
  341. package/generated/editor-vm/image.d.ts +4 -4
  342. package/generated/editor-vm/json.d.ts +1 -1
  343. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  344. package/generated/editor-vm/zip.d.ts +4 -4
  345. package/generated/editor.d.ts +183 -183
  346. package/generated/factory.d.ts +2 -3
  347. package/generated/font.d.ts +4 -4
  348. package/generated/go.d.ts +10 -12
  349. package/generated/graphics.d.ts +23 -26
  350. package/generated/gui.d.ts +44 -58
  351. package/generated/http.d.ts +2 -2
  352. package/generated/image.d.ts +12 -12
  353. package/generated/json.d.ts +4 -4
  354. package/generated/label.d.ts +5 -5
  355. package/generated/liveupdate.d.ts +3 -3
  356. package/generated/material.d.ts +48 -48
  357. package/generated/model.d.ts +46 -14
  358. package/generated/particlefx.d.ts +5 -5
  359. package/generated/physics.d.ts +19 -19
  360. package/generated/profiler.d.ts +3 -5
  361. package/generated/render-script-modules/b2d.d.ts +39 -39
  362. package/generated/render-script-modules/bullet3d.d.ts +5 -5
  363. package/generated/render-script-modules/collectionfactory.d.ts +1 -2
  364. package/generated/render-script-modules/collectionproxy.d.ts +3 -3
  365. package/generated/render-script-modules/factory.d.ts +1 -2
  366. package/generated/render-script-modules/go.d.ts +8 -10
  367. package/generated/render-script-modules/label.d.ts +2 -2
  368. package/generated/render-script-modules/model.d.ts +43 -11
  369. package/generated/render-script-modules/particlefx.d.ts +3 -3
  370. package/generated/render-script-modules/physics.d.ts +12 -12
  371. package/generated/render-script-modules/resource.d.ts +52 -53
  372. package/generated/render-script-modules/sound.d.ts +4 -4
  373. package/generated/render-script-modules/sprite.d.ts +2 -2
  374. package/generated/render-script-modules/tilemap.d.ts +2 -2
  375. package/generated/render.d.ts +44 -45
  376. package/generated/resource.d.ts +58 -59
  377. package/generated/socket.d.ts +18 -23
  378. package/generated/sound.d.ts +6 -6
  379. package/generated/sprite.d.ts +3 -3
  380. package/generated/sys.d.ts +20 -21
  381. package/generated/tilemap.d.ts +3 -3
  382. package/generated/timer.d.ts +3 -3
  383. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  384. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  385. package/generated/versions/defold-1.12.4/go.d.ts +2 -2
  386. package/generated/versions/defold-1.12.4/graphics.d.ts +1 -1
  387. package/generated/versions/defold-1.12.4/gui.d.ts +18 -19
  388. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  389. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  390. package/generated/versions/defold-1.12.4/particlefx.d.ts +1 -1
  391. package/generated/versions/defold-1.12.4/physics.d.ts +1 -1
  392. package/generated/versions/defold-1.12.4/render.d.ts +5 -5
  393. package/generated/versions/defold-1.12.4/resource.d.ts +8 -8
  394. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  395. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  396. package/generated/versions/defold-1.12.4/sprite.d.ts +1 -1
  397. package/generated/versions/defold-1.12.4/sys.d.ts +2 -2
  398. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  399. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  400. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  401. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  402. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  403. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  404. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  405. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  406. package/generated/versions/defold-1.13.0/go.d.ts +2 -2
  407. package/generated/versions/defold-1.13.0/graphics.d.ts +1 -1
  408. package/generated/versions/defold-1.13.0/gui.d.ts +18 -19
  409. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  410. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  411. package/generated/versions/defold-1.13.0/particlefx.d.ts +1 -1
  412. package/generated/versions/defold-1.13.0/physics.d.ts +1 -1
  413. package/generated/versions/defold-1.13.0/render.d.ts +5 -5
  414. package/generated/versions/defold-1.13.0/resource.d.ts +8 -8
  415. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  416. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  417. package/generated/versions/defold-1.13.0/sprite.d.ts +1 -1
  418. package/generated/versions/defold-1.13.0/sys.d.ts +2 -2
  419. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  420. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  421. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  422. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  423. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  424. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  425. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  426. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  427. package/generated/versions/defold-1.13.1/go.d.ts +2 -2
  428. package/generated/versions/defold-1.13.1/graphics.d.ts +1 -1
  429. package/generated/versions/defold-1.13.1/gui.d.ts +18 -19
  430. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  431. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  432. package/generated/versions/defold-1.13.1/particlefx.d.ts +1 -1
  433. package/generated/versions/defold-1.13.1/physics.d.ts +1 -1
  434. package/generated/versions/defold-1.13.1/render.d.ts +5 -5
  435. package/generated/versions/defold-1.13.1/resource.d.ts +8 -8
  436. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  437. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  438. package/generated/versions/defold-1.13.1/sprite.d.ts +1 -1
  439. package/generated/versions/defold-1.13.1/sys.d.ts +2 -2
  440. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  441. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  442. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  443. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  444. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  445. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  446. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  447. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  448. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  449. package/generated/versions/defold-1.13.2/buffer.d.ts +5 -6
  450. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  451. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +9 -9
  452. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +78 -78
  453. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  454. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  455. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  456. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  457. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  458. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  459. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  460. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  461. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  462. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  463. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  464. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  465. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  466. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  467. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  468. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  469. package/generated/versions/defold-1.13.2/go.d.ts +10 -12
  470. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -25
  471. package/generated/versions/defold-1.13.2/gui.d.ts +44 -58
  472. package/generated/versions/defold-1.13.2/http.d.ts +2 -2
  473. package/generated/versions/defold-1.13.2/image.d.ts +12 -12
  474. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  475. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  476. package/generated/versions/defold-1.13.2/liveupdate.d.ts +3 -3
  477. package/generated/versions/defold-1.13.2/material.d.ts +48 -48
  478. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  479. package/generated/versions/defold-1.13.2/particlefx.d.ts +5 -5
  480. package/generated/versions/defold-1.13.2/physics.d.ts +19 -19
  481. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  482. package/generated/versions/defold-1.13.2/render.d.ts +43 -44
  483. package/generated/versions/defold-1.13.2/resource.d.ts +58 -59
  484. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  485. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  486. package/generated/versions/defold-1.13.2/sprite.d.ts +3 -3
  487. package/generated/versions/defold-1.13.2/sys.d.ts +20 -21
  488. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  489. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  490. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -1
  491. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  492. package/generated/vmath.d.ts +0 -1
  493. package/generated/window.d.ts +8 -10
  494. package/identity-vocabulary.json +41 -34
  495. package/package.json +13 -5
  496. package/scripts/cli-runtime.ts +18 -0
  497. package/scripts/example-store-io.ts +2 -2
  498. package/scripts/extension-goldens.ts +9 -5
  499. package/scripts/generate-api-availability.ts +10 -4
  500. package/scripts/generate-api-signatures.ts +1 -1
  501. package/scripts/import-defold-release.ts +1 -1
  502. package/scripts/regen.ts +35 -9
  503. package/scripts/shared-handle-methods.ts +3 -2
  504. package/scripts/signature-store-fs.ts +37 -17
  505. package/scripts/sync-api-docs.ts +127 -20
  506. package/src/api-doc.ts +19 -4
  507. package/src/api-identity.ts +32 -1
  508. package/src/component-properties.d.ts +8 -8
  509. package/src/core-types.ts +29 -13
  510. package/src/doc-corrections.ts +9 -0
  511. package/src/emit-dts.ts +770 -214
  512. package/src/engine-type-name.ts +33 -0
  513. package/src/go-overloads.d.ts +10 -10
  514. package/src/gui-overloads.d.ts +11 -11
  515. package/src/index-slot-classifications.ts +75 -9
  516. package/src/index.ts +4 -1
  517. package/src/lifecycle.ts +2 -2
  518. package/src/publish-dts.ts +16 -0
  519. package/src/script-api.ts +36 -38
  520. package/src/socket-types.d.ts +3 -3
  521. package/src/library-index-slot-classifications.ts +0 -332
@@ -0,0 +1,1624 @@
1
+ {
2
+ "elements": [
3
+ {
4
+ "type": "MESSAGE",
5
+ "name": "apply_force",
6
+ "brief": "applies a force on a collision object",
7
+ "description": "Post this message to a collision-object-component to apply the specified force on the collision object.\nThe collision object must be dynamic.",
8
+ "returnvalues": [],
9
+ "parameters": [
10
+ {
11
+ "name": "force",
12
+ "doc": "the force to be applied on the collision object, measured in Newton",
13
+ "types": ["vector3"],
14
+ "is_optional": "False"
15
+ },
16
+ {
17
+ "name": "position",
18
+ "doc": "the position where the force should be applied",
19
+ "types": ["vector3"],
20
+ "is_optional": "False"
21
+ }
22
+ ],
23
+ "examples": "Assuming the instance of the script has a collision-object-component with id \"co\":\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- apply a force of 1 Newton towards world-x at the center of the game object instance</span>\n<span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"s2\">&quot;#co&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;apply_force&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">force</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"n\">position</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_world_position</span><span class=\"p\">()})</span>\n</code></pre></div>",
24
+ "replaces": "",
25
+ "error": "",
26
+ "tparams": [],
27
+ "members": [],
28
+ "notes": [],
29
+ "language": ""
30
+ },
31
+ {
32
+ "type": "MESSAGE",
33
+ "name": "collision_response",
34
+ "brief": "reports a collision between two collision objects",
35
+ "description": "This message is broadcasted to every component of an instance that has a collision object,\nwhen the collision object collides with another collision object. For a script to take action\nwhen such a collision happens, it should check for this message in its <code>on_message</code> callback\nfunction.\nThis message only reports that a collision actually happened and will only be sent once per\ncolliding pair and frame.\nTo retrieve more detailed information, check for the <code>contact_point_response</code> instead.",
36
+ "returnvalues": [],
37
+ "parameters": [
38
+ {
39
+ "name": "other_id",
40
+ "doc": "the id of the instance the collision object collided with",
41
+ "types": ["hash"],
42
+ "is_optional": "False"
43
+ },
44
+ {
45
+ "name": "other_position",
46
+ "doc": "the world position of the instance the collision object collided with",
47
+ "types": ["vector3"],
48
+ "is_optional": "False"
49
+ },
50
+ {
51
+ "name": "other_group",
52
+ "doc": "the collision group of the other collision object",
53
+ "types": ["hash"],
54
+ "is_optional": "False"
55
+ },
56
+ {
57
+ "name": "own_group",
58
+ "doc": "the collision group of the own collision object",
59
+ "types": ["hash"],
60
+ "is_optional": "False"
61
+ }
62
+ ],
63
+ "examples": "How to take action when a collision occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for the message</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;collision_response&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- take action</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
64
+ "replaces": "",
65
+ "error": "",
66
+ "tparams": [],
67
+ "members": [],
68
+ "notes": [],
69
+ "language": ""
70
+ },
71
+ {
72
+ "type": "MESSAGE",
73
+ "name": "contact_point_response",
74
+ "brief": "reports a contact point between two collision objects",
75
+ "description": "This message is broadcasted to every component of an instance that has a collision object,\nwhen the collision object has contact points with respect to another collision object.\nFor a script to take action when such contact points occur, it should check for this message\nin its <code>on_message</code> callback function.\nSince multiple contact points can occur for two colliding objects, this message can be sent\nmultiple times in the same frame for the same two colliding objects. To only be notified once\nwhen the collision occurs, check for the <code>collision_response</code> message instead.",
76
+ "returnvalues": [],
77
+ "parameters": [
78
+ {
79
+ "name": "position",
80
+ "doc": "world position of the contact point",
81
+ "types": ["vector3"],
82
+ "is_optional": "False"
83
+ },
84
+ {
85
+ "name": "normal",
86
+ "doc": "normal in world space of the contact point, which points from the other object towards the current object",
87
+ "types": ["vector3"],
88
+ "is_optional": "False"
89
+ },
90
+ {
91
+ "name": "relative_velocity",
92
+ "doc": "the relative velocity of the collision object as observed from the other object",
93
+ "types": ["vector3"],
94
+ "is_optional": "False"
95
+ },
96
+ {
97
+ "name": "distance",
98
+ "doc": "the penetration distance between the objects, which is always positive",
99
+ "types": ["number"],
100
+ "is_optional": "False"
101
+ },
102
+ {
103
+ "name": "applied_impulse",
104
+ "doc": "the impulse the contact resulted in",
105
+ "types": ["number"],
106
+ "is_optional": "False"
107
+ },
108
+ {
109
+ "name": "life_time",
110
+ "doc": "life time of the contact, <strong>not currently used</strong>",
111
+ "types": ["number"],
112
+ "is_optional": "False"
113
+ },
114
+ {
115
+ "name": "mass",
116
+ "doc": "the mass of the current collision object in kg",
117
+ "types": ["number"],
118
+ "is_optional": "False"
119
+ },
120
+ {
121
+ "name": "other_mass",
122
+ "doc": "the mass of the other collision object in kg",
123
+ "types": ["number"],
124
+ "is_optional": "False"
125
+ },
126
+ {
127
+ "name": "other_id",
128
+ "doc": "the id of the instance the collision object is in contact with",
129
+ "types": ["hash"],
130
+ "is_optional": "False"
131
+ },
132
+ {
133
+ "name": "other_position",
134
+ "doc": "the world position of the other collision object",
135
+ "types": ["vector3"],
136
+ "is_optional": "False"
137
+ },
138
+ {
139
+ "name": "other_group",
140
+ "doc": "the collision group of the other collision object",
141
+ "types": ["hash"],
142
+ "is_optional": "False"
143
+ },
144
+ {
145
+ "name": "own_group",
146
+ "doc": "the collision group of the own collision object",
147
+ "types": ["hash"],
148
+ "is_optional": "False"
149
+ }
150
+ ],
151
+ "examples": "How to take action when a contact point occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for the message</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;contact_point_response&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- take action</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
152
+ "replaces": "",
153
+ "error": "",
154
+ "tparams": [],
155
+ "members": [],
156
+ "notes": [],
157
+ "language": ""
158
+ },
159
+ {
160
+ "type": "MESSAGE",
161
+ "name": "trigger_response",
162
+ "brief": "reports interaction (enter/exit) between a trigger collision object and another collision object",
163
+ "description": "This message is broadcasted to every component of an instance that has a collision object,\nwhen the collision object interacts with another collision object and one of them is a trigger.\nFor a script to take action when such an interaction happens, it should check for this message\nin its <code>on_message</code> callback function.\nThis message only reports that an interaction actually happened and will only be sent once per\ncolliding pair and frame. To retrieve more detailed information, check for the\n<code>contact_point_response</code> instead.",
164
+ "returnvalues": [],
165
+ "parameters": [
166
+ {
167
+ "name": "other_id",
168
+ "doc": "the id of the instance the collision object collided with",
169
+ "types": ["hash"],
170
+ "is_optional": "False"
171
+ },
172
+ {
173
+ "name": "enter",
174
+ "doc": "if the interaction was an entry or not",
175
+ "types": ["boolean"],
176
+ "is_optional": "False"
177
+ },
178
+ {
179
+ "name": "other_group",
180
+ "doc": "the collision group of the triggering collision object",
181
+ "types": ["hash"],
182
+ "is_optional": "False"
183
+ },
184
+ {
185
+ "name": "own_group",
186
+ "doc": "the collision group of the own collision object",
187
+ "types": ["hash"],
188
+ "is_optional": "False"
189
+ }
190
+ ],
191
+ "examples": "How to take action when a trigger interaction occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for the message</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;trigger_response&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"kr\">if</span> <span class=\"n\">message</span><span class=\"p\">.</span><span class=\"n\">enter</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- take action for entry</span>\n <span class=\"kr\">else</span>\n <span class=\"c1\">-- take action for exit</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
192
+ "replaces": "",
193
+ "error": "",
194
+ "tparams": [],
195
+ "members": [],
196
+ "notes": [],
197
+ "language": ""
198
+ },
199
+ {
200
+ "type": "MESSAGE",
201
+ "name": "ray_cast_response",
202
+ "brief": "reports a ray cast hit",
203
+ "description": "This message is sent back to the sender of a <a href=\"#ray_cast_request\">ray_cast_request</a>, or to the physics world listener\nif it is set (see <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>), if the ray hits a collision object.\nSee <a href=\"/ref/physics#physics.raycast_async\">physics.raycast_async</a> for examples of how to use it.",
204
+ "returnvalues": [],
205
+ "parameters": [
206
+ {
207
+ "name": "fraction",
208
+ "doc": "the fraction of the hit measured along the ray, where 0 is the start of the ray and 1 is the end",
209
+ "types": ["number"],
210
+ "is_optional": "False"
211
+ },
212
+ {
213
+ "name": "position",
214
+ "doc": "the world position of the hit",
215
+ "types": ["vector3"],
216
+ "is_optional": "False"
217
+ },
218
+ {
219
+ "name": "normal",
220
+ "doc": "the normal of the surface of the collision object where it was hit",
221
+ "types": ["vector3"],
222
+ "is_optional": "False"
223
+ },
224
+ {
225
+ "name": "id",
226
+ "doc": "the instance id of the hit collision object",
227
+ "types": ["hash"],
228
+ "is_optional": "False"
229
+ },
230
+ {
231
+ "name": "group",
232
+ "doc": "the collision group of the hit collision object as a hashed name",
233
+ "types": ["hash"],
234
+ "is_optional": "False"
235
+ },
236
+ {
237
+ "name": "request_id",
238
+ "doc": "id supplied when the ray cast was requested",
239
+ "types": ["integer"],
240
+ "is_optional": "False"
241
+ }
242
+ ],
243
+ "examples": "",
244
+ "replaces": "",
245
+ "error": "",
246
+ "tparams": [],
247
+ "members": [],
248
+ "notes": [],
249
+ "language": ""
250
+ },
251
+ {
252
+ "type": "MESSAGE",
253
+ "name": "ray_cast_missed",
254
+ "brief": "reports a ray cast miss",
255
+ "description": "This message is sent back to the sender of a <a href=\"#ray_cast_request\">ray_cast_request</a>, or to the physics world listener\nif it is set (see <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>), if the ray didn't hit any collision object.\nSee <a href=\"/ref/physics#physics.raycast_async\">physics.raycast_async</a> for examples of how to use it.",
256
+ "returnvalues": [],
257
+ "parameters": [
258
+ {
259
+ "name": "request_id",
260
+ "doc": "id supplied when the ray cast was requested",
261
+ "types": ["integer"],
262
+ "is_optional": "False"
263
+ }
264
+ ],
265
+ "examples": "",
266
+ "replaces": "",
267
+ "error": "",
268
+ "tparams": [],
269
+ "members": [],
270
+ "notes": [],
271
+ "language": ""
272
+ },
273
+ {
274
+ "type": "STRUCT",
275
+ "name": "message.physics.contact_point_info",
276
+ "brief": "contact-point object information",
277
+ "description": "contact-point object information",
278
+ "returnvalues": [],
279
+ "parameters": [],
280
+ "examples": "",
281
+ "replaces": "",
282
+ "error": "",
283
+ "tparams": [],
284
+ "members": [
285
+ {
286
+ "name": "position",
287
+ "doc": "contact point position in world space",
288
+ "type": "vector3"
289
+ },
290
+ {
291
+ "name": "instance_position",
292
+ "doc": "object position in world space",
293
+ "type": "vector3"
294
+ },
295
+ {
296
+ "name": "normal",
297
+ "doc": "contact normal pointing from the other object toward this object",
298
+ "type": "vector3"
299
+ },
300
+ {
301
+ "name": "relative_velocity",
302
+ "doc": "object velocity relative to the other object",
303
+ "type": "vector3"
304
+ },
305
+ {
306
+ "name": "mass",
307
+ "doc": "object mass in kilograms",
308
+ "type": "number"
309
+ },
310
+ {
311
+ "name": "id",
312
+ "doc": "object identifier",
313
+ "type": "hash"
314
+ },
315
+ {
316
+ "name": "group",
317
+ "doc": "object collision group",
318
+ "type": "hash"
319
+ }
320
+ ],
321
+ "notes": [],
322
+ "language": ""
323
+ },
324
+ {
325
+ "type": "MESSAGE",
326
+ "name": "contact_point_event",
327
+ "brief": "reports a contact point between two collision objects in cases where a listener is specified.",
328
+ "description": "See <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>.\nThis message is sent to a function specified in <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a> when\na collision object has contact points with another collision object.\nSince multiple contact points can occur for two colliding objects, this event can be sent\nmultiple times in the same frame for the same two colliding objects. To only be notified once\nwhen the collision occurs, check for the <a href=\"#collision_event\">collision_event</a> event instead.",
329
+ "returnvalues": [],
330
+ "parameters": [
331
+ {
332
+ "name": "applied_impulse",
333
+ "doc": "the impulse the contact resulted in",
334
+ "types": ["number"],
335
+ "is_optional": "False"
336
+ },
337
+ {
338
+ "name": "distance",
339
+ "doc": "the penetration distance between the objects, which is always positive",
340
+ "types": ["number"],
341
+ "is_optional": "False"
342
+ },
343
+ {
344
+ "name": "a",
345
+ "doc": "contact point information for object A",
346
+ "types": ["message.physics.contact_point_info"],
347
+ "is_optional": "False"
348
+ },
349
+ {
350
+ "name": "b",
351
+ "doc": "contact point information for object B",
352
+ "types": ["message.physics.contact_point_info"],
353
+ "is_optional": "False"
354
+ }
355
+ ],
356
+ "examples": "How to take action when a contact point occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_event_listener</span><span class=\"p\">(</span><span class=\"kr\">function</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">events</span><span class=\"p\">)</span>\n <span class=\"kr\">for</span> <span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">event</span> <span class=\"kr\">in</span> <span class=\"nb\">ipairs</span><span class=\"p\">(</span><span class=\"n\">events</span><span class=\"p\">)</span> <span class=\"kr\">do</span>\n <span class=\"kr\">if</span> <span class=\"n\">event</span><span class=\"p\">[</span><span class=\"s1\">&#39;type&#39;</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;contact_point_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- applied_impulse = 310.00769042969,</span>\n <span class=\"c1\">-- distance = 0.0714111328125,</span>\n <span class=\"c1\">-- a = {</span>\n <span class=\"c1\">-- position = vmath.vector3(446, 371, 0),</span>\n <span class=\"c1\">-- relative_velocity = vmath.vector3(1.1722083854693e-06, -20.667181015015, -0),</span>\n <span class=\"c1\">-- mass = 0,</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/flat],</span>\n <span class=\"c1\">-- normal = vmath.vector3(-0, -1, -0)</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- b = {</span>\n <span class=\"c1\">-- position = vmath.vector3(185, 657.92858886719, 0),</span>\n <span class=\"c1\">-- relative_velocity = vmath.vector3(-1.1722083854693e-06, 20.667181015015, 0),</span>\n <span class=\"c1\">-- mass = 10,</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/go2],</span>\n <span class=\"c1\">-- normal = vmath.vector3(0, 1, 0)</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- type = hash: [contact_point_event]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span><span class=\"p\">)</span>\n</code></pre></div>",
357
+ "replaces": "",
358
+ "error": "",
359
+ "tparams": [],
360
+ "members": [],
361
+ "notes": [],
362
+ "language": ""
363
+ },
364
+ {
365
+ "type": "STRUCT",
366
+ "name": "message.physics.collision_info",
367
+ "brief": "collision object information",
368
+ "description": "collision object information",
369
+ "returnvalues": [],
370
+ "parameters": [],
371
+ "examples": "",
372
+ "replaces": "",
373
+ "error": "",
374
+ "tparams": [],
375
+ "members": [
376
+ {
377
+ "name": "position",
378
+ "doc": "object position in world space",
379
+ "type": "vector3"
380
+ },
381
+ {
382
+ "name": "id",
383
+ "doc": "object identifier",
384
+ "type": "hash"
385
+ },
386
+ {
387
+ "name": "group",
388
+ "doc": "object collision group",
389
+ "type": "hash"
390
+ }
391
+ ],
392
+ "notes": [],
393
+ "language": ""
394
+ },
395
+ {
396
+ "type": "MESSAGE",
397
+ "name": "collision_event",
398
+ "brief": "reports a collision between two collision objects in cases where a listener is specified.",
399
+ "description": "See <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>.\nThis message is sent to a function specified in <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>\nwhen two collision objects collide.\nThis message only reports that a collision has occurred and will be sent once per frame and per colliding pair.\nFor more detailed information, check for the <a href=\"#contact_point_event\">contact_point_event</a>.",
400
+ "returnvalues": [],
401
+ "parameters": [
402
+ {
403
+ "name": "a",
404
+ "doc": "collision information for object A",
405
+ "types": ["message.physics.collision_info"],
406
+ "is_optional": "False"
407
+ },
408
+ {
409
+ "name": "b",
410
+ "doc": "collision information for object B",
411
+ "types": ["message.physics.collision_info"],
412
+ "is_optional": "False"
413
+ }
414
+ ],
415
+ "examples": "How to take action when a collision occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_event_listener</span><span class=\"p\">(</span><span class=\"kr\">function</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">event</span><span class=\"p\">,</span> <span class=\"n\">data</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">event</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;collision_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">data</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- a = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- position = vmath.vector3(183, 666, 0),</span>\n <span class=\"c1\">-- id = hash: [/go1]</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- b = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- position = vmath.vector3(185, 704.05865478516, 0),</span>\n <span class=\"c1\">-- id = hash: [/go2]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"c1\">-- }</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span><span class=\"p\">)</span>\n</code></pre></div>",
416
+ "replaces": "",
417
+ "error": "",
418
+ "tparams": [],
419
+ "members": [],
420
+ "notes": [],
421
+ "language": ""
422
+ },
423
+ {
424
+ "type": "STRUCT",
425
+ "name": "message.physics.trigger_info",
426
+ "brief": "trigger interaction object information",
427
+ "description": "trigger interaction object information",
428
+ "returnvalues": [],
429
+ "parameters": [],
430
+ "examples": "",
431
+ "replaces": "",
432
+ "error": "",
433
+ "tparams": [],
434
+ "members": [
435
+ {
436
+ "name": "id",
437
+ "doc": "object identifier",
438
+ "type": "hash"
439
+ },
440
+ {
441
+ "name": "group",
442
+ "doc": "object collision group",
443
+ "type": "hash"
444
+ }
445
+ ],
446
+ "notes": [],
447
+ "language": ""
448
+ },
449
+ {
450
+ "type": "MESSAGE",
451
+ "name": "trigger_event",
452
+ "brief": "reports interaction (enter/exit) between a trigger collision object and another collision object",
453
+ "description": "See <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>.\nThis message is sent to a function specified in <a href=\"/ref/physics#physics.set_event_listener\">physics.set_event_listener</a>\nwhen a collision object interacts with another collision object and one of them is a trigger.\nThis message only reports that an interaction actually happened and will be sent once per colliding pair and frame.\nFor more detailed information, check for the <a href=\"#contact_point_event\">contact_point_event</a>.",
454
+ "returnvalues": [],
455
+ "parameters": [
456
+ {
457
+ "name": "enter",
458
+ "doc": "if the interaction was an entry or not",
459
+ "types": ["boolean"],
460
+ "is_optional": "False"
461
+ },
462
+ {
463
+ "name": "a",
464
+ "doc": "interaction information for object A",
465
+ "types": ["message.physics.trigger_info"],
466
+ "is_optional": "False"
467
+ },
468
+ {
469
+ "name": "b",
470
+ "doc": "interaction information for object B",
471
+ "types": ["message.physics.trigger_info"],
472
+ "is_optional": "False"
473
+ }
474
+ ],
475
+ "examples": "How to take action when a trigger interaction occurs:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_event_listener</span><span class=\"p\">(</span><span class=\"kr\">function</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">event</span><span class=\"p\">,</span> <span class=\"n\">data</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">event</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;trigger_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"kr\">if</span> <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">enter</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- take action for entry</span>\n <span class=\"kr\">else</span>\n <span class=\"c1\">-- take action for exit</span>\n <span class=\"kr\">end</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">data</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- enter = true,</span>\n <span class=\"c1\">-- b = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/go2]</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- a = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/go1]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"c1\">-- },</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span><span class=\"p\">)</span>\n</code></pre></div>",
476
+ "replaces": "",
477
+ "error": "",
478
+ "tparams": [],
479
+ "members": [],
480
+ "notes": [],
481
+ "language": ""
482
+ },
483
+ {
484
+ "type": "ENUM",
485
+ "name": "physics.JOINT_TYPE",
486
+ "brief": "Joint types",
487
+ "description": "Joint types",
488
+ "returnvalues": [],
489
+ "parameters": [],
490
+ "examples": "",
491
+ "replaces": "",
492
+ "error": "",
493
+ "tparams": [],
494
+ "members": [
495
+ {
496
+ "name": "physics.JOINT_TYPE_FIXED",
497
+ "doc": "Fixed joint; uses <code>max_length</code> from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
498
+ "type": ""
499
+ },
500
+ {
501
+ "name": "physics.JOINT_TYPE_HINGE",
502
+ "doc": "Hinge joint; uses the angular-limit and motor fields from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
503
+ "type": ""
504
+ },
505
+ {
506
+ "name": "physics.JOINT_TYPE_SLIDER",
507
+ "doc": "Slider joint; uses the translation-limit and motor fields from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
508
+ "type": ""
509
+ },
510
+ {
511
+ "name": "physics.JOINT_TYPE_SPRING",
512
+ "doc": "Spring joint; uses <code>length</code>, <code>frequency</code>, and <code>damping</code> from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
513
+ "type": ""
514
+ },
515
+ {
516
+ "name": "physics.JOINT_TYPE_WELD",
517
+ "doc": "Weld joint; uses <code>reference_angle</code>, <code>frequency</code>, and <code>damping</code> from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
518
+ "type": ""
519
+ },
520
+ {
521
+ "name": "physics.JOINT_TYPE_WHEEL",
522
+ "doc": "Wheel joint; uses the axis, motor, frequency, and damping fields from <a href=\"/ref/physics#physics.joint_properties\">physics.joint_properties</a>.",
523
+ "type": ""
524
+ }
525
+ ],
526
+ "notes": [],
527
+ "language": ""
528
+ },
529
+ {
530
+ "type": "ENUM",
531
+ "name": "physics.SHAPE_TYPE",
532
+ "brief": "Shape types",
533
+ "description": "Shape types",
534
+ "returnvalues": [],
535
+ "parameters": [],
536
+ "examples": "",
537
+ "replaces": "",
538
+ "error": "",
539
+ "tparams": [],
540
+ "members": [
541
+ {
542
+ "name": "physics.SHAPE_TYPE_BOX",
543
+ "doc": "Box shape.",
544
+ "type": ""
545
+ },
546
+ {
547
+ "name": "physics.SHAPE_TYPE_CAPSULE",
548
+ "doc": "Capsule shape; supported only by 3D physics.",
549
+ "type": ""
550
+ },
551
+ {
552
+ "name": "physics.SHAPE_TYPE_HULL",
553
+ "doc": "Convex hull shape.",
554
+ "type": ""
555
+ },
556
+ {
557
+ "name": "physics.SHAPE_TYPE_MESH",
558
+ "doc": "Triangle mesh shape; supported only by the Bullet 3D backend.",
559
+ "type": ""
560
+ },
561
+ {
562
+ "name": "physics.SHAPE_TYPE_SPHERE",
563
+ "doc": "Sphere shape.",
564
+ "type": ""
565
+ }
566
+ ],
567
+ "notes": [],
568
+ "language": ""
569
+ },
570
+ {
571
+ "type": "STRUCT",
572
+ "name": "physics.raycast_options",
573
+ "brief": "Ray-cast options",
574
+ "description": "Ray-cast options",
575
+ "returnvalues": [],
576
+ "parameters": [],
577
+ "examples": "",
578
+ "replaces": "",
579
+ "error": "",
580
+ "tparams": [],
581
+ "members": [
582
+ {
583
+ "name": "all?",
584
+ "doc": "Return every hit instead of only the closest hit.",
585
+ "type": "boolean"
586
+ }
587
+ ],
588
+ "notes": [],
589
+ "language": ""
590
+ },
591
+ {
592
+ "type": "STRUCT",
593
+ "name": "physics.shape_data",
594
+ "brief": "Collision shape data",
595
+ "description": "The available geometry fields depend on <code>type</code>.",
596
+ "returnvalues": [],
597
+ "parameters": [],
598
+ "examples": "",
599
+ "replaces": "",
600
+ "error": "",
601
+ "tparams": [],
602
+ "members": [
603
+ {
604
+ "name": "type",
605
+ "doc": "shape type",
606
+ "type": "physics.SHAPE_TYPE"
607
+ },
608
+ {
609
+ "name": "diameter?",
610
+ "doc": "sphere diameter or capsule pole diameter",
611
+ "type": "number"
612
+ },
613
+ {
614
+ "name": "dimensions?",
615
+ "doc": "box dimensions",
616
+ "type": "vector3"
617
+ },
618
+ {
619
+ "name": "height?",
620
+ "doc": "capsule height",
621
+ "type": "number"
622
+ }
623
+ ],
624
+ "notes": [],
625
+ "language": ""
626
+ },
627
+ {
628
+ "type": "TYPEDEF",
629
+ "name": "physics.event",
630
+ "brief": "Physics world event",
631
+ "description": "An event delivered to a physics world listener. Inspect its <code>type</code> field to\ndetermine which event-specific fields are available.",
632
+ "returnvalues": [],
633
+ "parameters": [
634
+ {
635
+ "name": "value",
636
+ "doc": "physics event data",
637
+ "types": [
638
+ "message.physics.contact_point_event",
639
+ "message.physics.collision_event",
640
+ "message.physics.trigger_event",
641
+ "message.physics.ray_cast_response",
642
+ "message.physics.ray_cast_missed"
643
+ ],
644
+ "is_optional": "False"
645
+ }
646
+ ],
647
+ "examples": "",
648
+ "replaces": "",
649
+ "error": "",
650
+ "tparams": [],
651
+ "members": [],
652
+ "notes": [],
653
+ "language": ""
654
+ },
655
+ {
656
+ "type": "PROPERTY",
657
+ "name": "mass",
658
+ "brief": "<span class=\"type\">number</span> collision object mass",
659
+ "description": "<span class=\"mark\">READ ONLY</span> Returns the defined physical mass of the collision object component as a number.",
660
+ "returnvalues": [],
661
+ "parameters": [],
662
+ "examples": "How to query a collision object component's mass:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get mass from collision object component &quot;boulder&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">mass</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;#boulder&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;mass&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- do something useful</span>\n<span class=\"nb\">assert</span><span class=\"p\">(</span><span class=\"n\">mass</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n</code></pre></div>",
663
+ "replaces": "",
664
+ "error": "",
665
+ "tparams": [],
666
+ "members": [],
667
+ "notes": [],
668
+ "language": ""
669
+ },
670
+ {
671
+ "type": "PROPERTY",
672
+ "name": "linear_velocity",
673
+ "brief": "<span class=\"type\">vector3</span> collision object linear velocity",
674
+ "description": "The current linear velocity of the collision object component as a vector3.\nThe velocity is measured in units/s (pixels/s).",
675
+ "returnvalues": [],
676
+ "parameters": [],
677
+ "examples": "How to query and modify a collision object component's linear velocity:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get linear velocity from collision object &quot;collisionobject&quot; in gameobject &quot;ship&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">source</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;ship#collisionobject&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">,</span> <span class=\"s2\">&quot;linear_velocity&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- decrease it by 10%</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">,</span> <span class=\"s2\">&quot;linear_velocity&quot;</span><span class=\"p\">,</span> <span class=\"n\">velocity</span> <span class=\"o\">*</span> <span class=\"mf\">0.9</span><span class=\"p\">)</span>\n<span class=\"c1\">-- apply the velocity on target game object &quot;boulder&quot;&#39;s collision object as a force</span>\n<span class=\"kd\">local</span> <span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;boulder#collisionobject&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">pos</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get_position</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">)</span>\n<span class=\"n\">msg</span><span class=\"p\">.</span><span class=\"n\">post</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">,</span> <span class=\"s2\">&quot;apply_force&quot;</span><span class=\"p\">,</span> <span class=\"p\">{</span> <span class=\"n\">force</span> <span class=\"o\">=</span> <span class=\"n\">velocity</span><span class=\"p\">,</span> <span class=\"n\">position</span> <span class=\"o\">=</span> <span class=\"n\">pos</span> <span class=\"p\">})</span>\n</code></pre></div>",
678
+ "replaces": "request_velocity and velocity_response",
679
+ "error": "",
680
+ "tparams": [],
681
+ "members": [],
682
+ "notes": [],
683
+ "language": ""
684
+ },
685
+ {
686
+ "type": "PROPERTY",
687
+ "name": "angular_velocity",
688
+ "brief": "<span class=\"type\">vector3</span> collision object angular velocity",
689
+ "description": "The current angular velocity of the collision object component as a <span class=\"type\">vector3</span>.\nThe velocity is measured as a rotation around the vector with a speed equivalent to the vector length\nin radians/s.",
690
+ "returnvalues": [],
691
+ "parameters": [],
692
+ "examples": "How to query and modify a collision object component's angular velocity:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get angular velocity from collision object &quot;collisionobject&quot; in gameobject &quot;boulder&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">velocity</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"s2\">&quot;boulder#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;angular_velocity&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- do something interesting</span>\n<span class=\"kr\">if</span> <span class=\"n\">velocity</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">&lt;</span> <span class=\"mi\">0</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- clockwise rotation</span>\n <span class=\"p\">...</span>\n<span class=\"kr\">else</span>\n <span class=\"c1\">-- counter clockwise rotation</span>\n <span class=\"p\">...</span>\n<span class=\"kr\">end</span>\n<span class=\"c1\">-- decrease it by 10%</span>\n<span class=\"n\">velocity</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"n\">velocity</span><span class=\"p\">.</span><span class=\"n\">z</span> <span class=\"o\">*</span> <span class=\"mf\">0.9</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"s2\">&quot;boulder#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;angular_velocity&quot;</span><span class=\"p\">,</span> <span class=\"n\">velocity</span> <span class=\"o\">*</span> <span class=\"mf\">0.9</span><span class=\"p\">)</span>\n</code></pre></div>",
693
+ "replaces": "request_velocity and velocity_response",
694
+ "error": "",
695
+ "tparams": [],
696
+ "members": [],
697
+ "notes": [],
698
+ "language": ""
699
+ },
700
+ {
701
+ "type": "PROPERTY",
702
+ "name": "linear_damping",
703
+ "brief": "<span class=\"type\">number</span> collision object linear damping",
704
+ "description": "The linear damping value for the collision object. Setting this value alters the damping of\nlinear motion of the object. Valid values are between 0 (no damping) and 1 (full damping).",
705
+ "returnvalues": [],
706
+ "parameters": [],
707
+ "examples": "How to increase a collision object component's linear damping:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get linear damping from collision object &quot;collisionobject&quot; in gameobject &quot;floater&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;floater#collisionobject&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">damping</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">,</span> <span class=\"s2\">&quot;linear_damping&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- increase it by 10% if it&#39;s below 0.9</span>\n<span class=\"kr\">if</span> <span class=\"n\">damping</span> <span class=\"o\">&lt;=</span> <span class=\"mf\">0.9</span> <span class=\"kr\">then</span>\n <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">,</span> <span class=\"s2\">&quot;linear_damping&quot;</span><span class=\"p\">,</span> <span class=\"n\">damping</span> <span class=\"o\">*</span> <span class=\"mf\">1.1</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
708
+ "replaces": "",
709
+ "error": "",
710
+ "tparams": [],
711
+ "members": [],
712
+ "notes": [],
713
+ "language": ""
714
+ },
715
+ {
716
+ "type": "PROPERTY",
717
+ "name": "angular_damping",
718
+ "brief": "<span class=\"type\">number</span> collision object angular damping",
719
+ "description": "The angular damping value for the collision object. Setting this value alters the damping of\nangular motion of the object (rotation). Valid values are between 0 (no damping) and 1 (full damping).",
720
+ "returnvalues": [],
721
+ "parameters": [],
722
+ "examples": "How to decrease a collision object component's angular damping:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"c1\">-- get angular damping from collision object &quot;collisionobject&quot; in gameobject &quot;floater&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">target</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;floater#collisionobject&quot;</span>\n<span class=\"kd\">local</span> <span class=\"n\">damping</span> <span class=\"o\">=</span> <span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">get</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">,</span> <span class=\"s2\">&quot;angular_damping&quot;</span><span class=\"p\">)</span>\n<span class=\"c1\">-- decrease it by 10%</span>\n<span class=\"n\">go</span><span class=\"p\">.</span><span class=\"n\">set</span><span class=\"p\">(</span><span class=\"n\">target</span><span class=\"p\">,</span> <span class=\"s2\">&quot;angular_damping&quot;</span><span class=\"p\">,</span> <span class=\"n\">damping</span> <span class=\"o\">*</span> <span class=\"mf\">0.9</span><span class=\"p\">)</span>\n</code></pre></div>",
723
+ "replaces": "",
724
+ "error": "",
725
+ "tparams": [],
726
+ "members": [],
727
+ "notes": [],
728
+ "language": ""
729
+ },
730
+ {
731
+ "type": "FUNCTION",
732
+ "name": "physics.raycast_async",
733
+ "brief": "requests a ray cast to be performed",
734
+ "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough <code>groups</code>.\nThe actual ray cast will be performed during the physics-update.\n<ul>\n<li>If an object is hit, the result will be reported via a <a href=\"#ray_cast_response\">ray_cast_response</a> message.</li>\n<li>If there is no object hit, the result will be reported via a <a href=\"#ray_cast_missed\">ray_cast_missed</a> message.</li>\n</ul>\nNOTE: Ray casts will ignore collision objects that contain the starting point of the ray. This is a limitation in Box2D.",
735
+ "returnvalues": [],
736
+ "parameters": [
737
+ {
738
+ "name": "from",
739
+ "doc": "the world position of the start of the ray",
740
+ "types": ["vector3"],
741
+ "is_optional": "False"
742
+ },
743
+ {
744
+ "name": "to",
745
+ "doc": "the world position of the end of the ray",
746
+ "types": ["vector3"],
747
+ "is_optional": "False"
748
+ },
749
+ {
750
+ "name": "groups",
751
+ "doc": "a lua table containing the hashed groups for which to test collisions against",
752
+ "types": ["hash[]"],
753
+ "is_optional": "False"
754
+ },
755
+ {
756
+ "name": "request_id",
757
+ "doc": "a number in range [0,255]. It will be sent back in the response for identification, 0 by default",
758
+ "types": ["integer"],
759
+ "is_optional": "True"
760
+ }
761
+ ],
762
+ "examples": "How to perform a ray cast asynchronously:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_groups</span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_group1&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;my_group2&quot;</span><span class=\"p\">)}</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- request ray cast</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">raycast_async</span><span class=\"p\">(</span><span class=\"n\">my_start</span><span class=\"p\">,</span> <span class=\"n\">my_end</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">my_groups</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">on_message</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">message_id</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"p\">)</span>\n <span class=\"c1\">-- check for the response</span>\n <span class=\"kr\">if</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;ray_cast_response&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- act on the hit</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">message_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;ray_cast_missed&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- act on the miss</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
763
+ "replaces": "",
764
+ "error": "",
765
+ "tparams": [],
766
+ "members": [],
767
+ "notes": [],
768
+ "language": ""
769
+ },
770
+ {
771
+ "type": "FUNCTION",
772
+ "name": "physics.raycast",
773
+ "brief": "requests a ray cast to be performed",
774
+ "description": "Ray casts are used to test for intersections against collision objects in the physics world.\nCollision objects of types kinematic, dynamic and static are tested against. Trigger objects\ndo not intersect with ray casts.\nWhich collision objects to hit is filtered by their collision groups and can be configured\nthrough <code>groups</code>.\nNOTE: Ray casts will ignore collision objects that contain the starting point of the ray. This is a limitation in Box2D.",
775
+ "returnvalues": [
776
+ {
777
+ "name": "result",
778
+ "doc": "It returns a list. If missed it returns <code>nil</code>. See <a href=\"#ray_cast_response\">ray_cast_response</a> for details on the returned values.",
779
+ "types": [
780
+ "message.physics.ray_cast_response[]",
781
+ "message.physics.ray_cast_response",
782
+ "nil"
783
+ ]
784
+ }
785
+ ],
786
+ "parameters": [
787
+ {
788
+ "name": "from",
789
+ "doc": "the world position of the start of the ray",
790
+ "types": ["vector3"],
791
+ "is_optional": "False"
792
+ },
793
+ {
794
+ "name": "to",
795
+ "doc": "the world position of the end of the ray",
796
+ "types": ["vector3"],
797
+ "is_optional": "False"
798
+ },
799
+ {
800
+ "name": "groups",
801
+ "doc": "a lua table containing the hashed groups for which to test collisions against",
802
+ "types": ["hash[]"],
803
+ "is_optional": "False"
804
+ },
805
+ {
806
+ "name": "options",
807
+ "doc": "optional ray-cast options",
808
+ "types": ["physics.raycast_options"],
809
+ "is_optional": "True"
810
+ }
811
+ ],
812
+ "examples": "How to perform a ray cast synchronously:\n<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">groups</span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;world&quot;</span><span class=\"p\">),</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;enemy&quot;</span><span class=\"p\">)}</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">update</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"p\">)</span>\n <span class=\"c1\">-- request ray cast</span>\n <span class=\"kd\">local</span> <span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">raycast</span><span class=\"p\">(</span><span class=\"n\">from</span><span class=\"p\">,</span> <span class=\"n\">to</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">groups</span><span class=\"p\">,</span> <span class=\"p\">{</span><span class=\"n\">all</span><span class=\"o\">=</span><span class=\"kc\">true</span><span class=\"p\">})</span>\n <span class=\"kr\">if</span> <span class=\"n\">result</span> <span class=\"o\">~=</span> <span class=\"kc\">nil</span> <span class=\"kr\">then</span>\n <span class=\"c1\">-- act on the hit (see &#39;ray_cast_response&#39;)</span>\n <span class=\"kr\">for</span> <span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">result</span> <span class=\"kr\">in</span> <span class=\"nb\">ipairs</span><span class=\"p\">(</span><span class=\"n\">results</span><span class=\"p\">)</span> <span class=\"kr\">do</span>\n <span class=\"n\">handle_result</span><span class=\"p\">(</span><span class=\"n\">result</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
813
+ "replaces": "",
814
+ "error": "",
815
+ "tparams": [],
816
+ "members": [],
817
+ "notes": [],
818
+ "language": ""
819
+ },
820
+ {
821
+ "type": "STRUCT",
822
+ "name": "physics.joint_properties",
823
+ "brief": "configurable joint properties",
824
+ "description": "The available fields depend on the joint type.",
825
+ "returnvalues": [],
826
+ "parameters": [],
827
+ "examples": "",
828
+ "replaces": "",
829
+ "error": "",
830
+ "tparams": [],
831
+ "members": [
832
+ {
833
+ "name": "collide_connected?",
834
+ "doc": "whether the connected objects should collide",
835
+ "type": "boolean"
836
+ },
837
+ {
838
+ "name": "length?",
839
+ "doc": "Natural spring length between the anchor points.",
840
+ "type": "number"
841
+ },
842
+ {
843
+ "name": "frequency?",
844
+ "doc": "Mass-spring-damper frequency in Hertz; zero disables softness.",
845
+ "type": "number"
846
+ },
847
+ {
848
+ "name": "damping?",
849
+ "doc": "Damping ratio, where zero is no damping and one is critical damping.",
850
+ "type": "number"
851
+ },
852
+ {
853
+ "name": "max_length?",
854
+ "doc": "Maximum fixed-joint rope length.",
855
+ "type": "number"
856
+ },
857
+ {
858
+ "name": "local_axis_a?",
859
+ "doc": "Local translation unit axis in the first body.",
860
+ "type": "vector3"
861
+ },
862
+ {
863
+ "name": "reference_angle?",
864
+ "doc": "Angle of the second body relative to the first body, in radians.",
865
+ "type": "number"
866
+ },
867
+ {
868
+ "name": "lower_angle?",
869
+ "doc": "Lower angular limit in radians.",
870
+ "type": "number"
871
+ },
872
+ {
873
+ "name": "upper_angle?",
874
+ "doc": "Upper angular limit in radians.",
875
+ "type": "number"
876
+ },
877
+ {
878
+ "name": "lower_translation?",
879
+ "doc": "Lower translation limit, usually in meters.",
880
+ "type": "number"
881
+ },
882
+ {
883
+ "name": "upper_translation?",
884
+ "doc": "Upper translation limit, usually in meters.",
885
+ "type": "number"
886
+ },
887
+ {
888
+ "name": "max_motor_torque?",
889
+ "doc": "Maximum motor torque used to reach the desired speed, usually in N-m.",
890
+ "type": "number"
891
+ },
892
+ {
893
+ "name": "max_motor_force?",
894
+ "doc": "Maximum motor force used to reach the desired speed.",
895
+ "type": "number"
896
+ },
897
+ {
898
+ "name": "motor_speed?",
899
+ "doc": "Desired motor speed.",
900
+ "type": "number"
901
+ },
902
+ {
903
+ "name": "enable_limit?",
904
+ "doc": "Whether joint limits are enabled.",
905
+ "type": "boolean"
906
+ },
907
+ {
908
+ "name": "enable_motor?",
909
+ "doc": "Whether the joint motor is enabled.",
910
+ "type": "boolean"
911
+ }
912
+ ],
913
+ "notes": [],
914
+ "language": ""
915
+ },
916
+ {
917
+ "type": "STRUCT",
918
+ "name": "physics.joint_properties_info",
919
+ "brief": "returned joint properties",
920
+ "description": "The available optional fields depend on the joint type.",
921
+ "returnvalues": [],
922
+ "parameters": [],
923
+ "examples": "",
924
+ "replaces": "",
925
+ "error": "",
926
+ "tparams": [],
927
+ "members": [
928
+ {
929
+ "name": "collide_connected",
930
+ "doc": "whether the connected objects collide",
931
+ "type": "boolean"
932
+ },
933
+ {
934
+ "name": "length?",
935
+ "doc": "spring length",
936
+ "type": "number"
937
+ },
938
+ {
939
+ "name": "frequency?",
940
+ "doc": "spring frequency",
941
+ "type": "number"
942
+ },
943
+ {
944
+ "name": "damping?",
945
+ "doc": "damping ratio",
946
+ "type": "number"
947
+ },
948
+ {
949
+ "name": "max_length?",
950
+ "doc": "fixed-joint maximum length",
951
+ "type": "number"
952
+ },
953
+ {
954
+ "name": "local_axis_a?",
955
+ "doc": "local joint axis",
956
+ "type": "vector3"
957
+ },
958
+ {
959
+ "name": "reference_angle?",
960
+ "doc": "reference angle",
961
+ "type": "number"
962
+ },
963
+ {
964
+ "name": "lower_angle?",
965
+ "doc": "lower angular limit",
966
+ "type": "number"
967
+ },
968
+ {
969
+ "name": "upper_angle?",
970
+ "doc": "upper angular limit",
971
+ "type": "number"
972
+ },
973
+ {
974
+ "name": "lower_translation?",
975
+ "doc": "lower translation limit",
976
+ "type": "number"
977
+ },
978
+ {
979
+ "name": "upper_translation?",
980
+ "doc": "upper translation limit",
981
+ "type": "number"
982
+ },
983
+ {
984
+ "name": "max_motor_torque?",
985
+ "doc": "maximum motor torque",
986
+ "type": "number"
987
+ },
988
+ {
989
+ "name": "max_motor_force?",
990
+ "doc": "maximum motor force",
991
+ "type": "number"
992
+ },
993
+ {
994
+ "name": "motor_speed?",
995
+ "doc": "motor speed",
996
+ "type": "number"
997
+ },
998
+ {
999
+ "name": "enable_limit?",
1000
+ "doc": "whether limits are enabled",
1001
+ "type": "boolean"
1002
+ },
1003
+ {
1004
+ "name": "enable_motor?",
1005
+ "doc": "whether the motor is enabled",
1006
+ "type": "boolean"
1007
+ },
1008
+ {
1009
+ "name": "joint_angle?",
1010
+ "doc": "Read-only current hinge angle in radians.",
1011
+ "type": "number"
1012
+ },
1013
+ {
1014
+ "name": "joint_speed?",
1015
+ "doc": "Read-only current hinge angular speed or slider/wheel translation speed.",
1016
+ "type": "number"
1017
+ },
1018
+ {
1019
+ "name": "joint_translation?",
1020
+ "doc": "Read-only current slider or wheel translation, usually in meters.",
1021
+ "type": "number"
1022
+ }
1023
+ ],
1024
+ "notes": [],
1025
+ "language": ""
1026
+ },
1027
+ {
1028
+ "type": "FUNCTION",
1029
+ "name": "physics.create_joint",
1030
+ "brief": "create a physics joint",
1031
+ "description": "Create a physics joint between two collision object components.\nNote: Currently only supported in 2D physics.",
1032
+ "returnvalues": [],
1033
+ "parameters": [
1034
+ {
1035
+ "name": "joint_type",
1036
+ "doc": "the joint type",
1037
+ "types": ["physics.JOINT_TYPE"],
1038
+ "is_optional": "False"
1039
+ },
1040
+ {
1041
+ "name": "collisionobject_a",
1042
+ "doc": "first collision object",
1043
+ "types": ["string", "hash", "url"],
1044
+ "is_optional": "False"
1045
+ },
1046
+ {
1047
+ "name": "joint_id",
1048
+ "doc": "id of the joint",
1049
+ "types": ["string", "hash"],
1050
+ "is_optional": "False"
1051
+ },
1052
+ {
1053
+ "name": "position_a",
1054
+ "doc": "local position where to attach the joint on the first collision object",
1055
+ "types": ["vector3"],
1056
+ "is_optional": "False"
1057
+ },
1058
+ {
1059
+ "name": "collisionobject_b",
1060
+ "doc": "second collision object",
1061
+ "types": ["string", "hash", "url"],
1062
+ "is_optional": "False"
1063
+ },
1064
+ {
1065
+ "name": "position_b",
1066
+ "doc": "local position where to attach the joint on the second collision object",
1067
+ "types": ["vector3"],
1068
+ "is_optional": "False"
1069
+ },
1070
+ {
1071
+ "name": "properties",
1072
+ "doc": "optional joint-specific properties",
1073
+ "types": ["physics.joint_properties"],
1074
+ "is_optional": "True"
1075
+ }
1076
+ ],
1077
+ "examples": "",
1078
+ "replaces": "",
1079
+ "error": "",
1080
+ "tparams": [],
1081
+ "members": [],
1082
+ "notes": [],
1083
+ "language": ""
1084
+ },
1085
+ {
1086
+ "type": "FUNCTION",
1087
+ "name": "physics.destroy_joint",
1088
+ "brief": "destroy a physics joint",
1089
+ "description": "Destroy an already physics joint. The joint has to be created before a\ndestroy can be issued.\nNote: Currently only supported in 2D physics.",
1090
+ "returnvalues": [],
1091
+ "parameters": [
1092
+ {
1093
+ "name": "collisionobject",
1094
+ "doc": "collision object where the joint exist",
1095
+ "types": ["string", "hash", "url"],
1096
+ "is_optional": "False"
1097
+ },
1098
+ {
1099
+ "name": "joint_id",
1100
+ "doc": "id of the joint",
1101
+ "types": ["string", "hash"],
1102
+ "is_optional": "False"
1103
+ }
1104
+ ],
1105
+ "examples": "",
1106
+ "replaces": "",
1107
+ "error": "",
1108
+ "tparams": [],
1109
+ "members": [],
1110
+ "notes": [],
1111
+ "language": ""
1112
+ },
1113
+ {
1114
+ "type": "FUNCTION",
1115
+ "name": "physics.get_joint_properties",
1116
+ "brief": "get properties for a joint",
1117
+ "description": "Get a table for properties for a connected joint. The joint has to be created before\nproperties can be retrieved.\nNote: Currently only supported in 2D physics.",
1118
+ "returnvalues": [
1119
+ {
1120
+ "name": "properties",
1121
+ "doc": "joint properties",
1122
+ "types": ["physics.joint_properties_info"]
1123
+ }
1124
+ ],
1125
+ "parameters": [
1126
+ {
1127
+ "name": "collisionobject",
1128
+ "doc": "collision object where the joint exist",
1129
+ "types": ["string", "hash", "url"],
1130
+ "is_optional": "False"
1131
+ },
1132
+ {
1133
+ "name": "joint_id",
1134
+ "doc": "id of the joint",
1135
+ "types": ["string", "hash"],
1136
+ "is_optional": "False"
1137
+ }
1138
+ ],
1139
+ "examples": "",
1140
+ "replaces": "",
1141
+ "error": "",
1142
+ "tparams": [],
1143
+ "members": [],
1144
+ "notes": [],
1145
+ "language": ""
1146
+ },
1147
+ {
1148
+ "type": "FUNCTION",
1149
+ "name": "physics.set_joint_properties",
1150
+ "brief": "set properties for a joint",
1151
+ "description": "Updates the properties for an already connected joint. The joint has to be created before\nproperties can be changed.\nNote: Currently only supported in 2D physics.",
1152
+ "returnvalues": [],
1153
+ "parameters": [
1154
+ {
1155
+ "name": "collisionobject",
1156
+ "doc": "collision object where the joint exist",
1157
+ "types": ["string", "hash", "url"],
1158
+ "is_optional": "False"
1159
+ },
1160
+ {
1161
+ "name": "joint_id",
1162
+ "doc": "id of the joint",
1163
+ "types": ["string", "hash"],
1164
+ "is_optional": "False"
1165
+ },
1166
+ {
1167
+ "name": "properties",
1168
+ "doc": "joint specific properties table\nNote: The <code>collide_connected</code> field cannot be updated/changed after a connection has been made.",
1169
+ "types": ["physics.joint_properties"],
1170
+ "is_optional": "False"
1171
+ }
1172
+ ],
1173
+ "examples": "",
1174
+ "replaces": "",
1175
+ "error": "",
1176
+ "tparams": [],
1177
+ "members": [],
1178
+ "notes": [],
1179
+ "language": ""
1180
+ },
1181
+ {
1182
+ "type": "FUNCTION",
1183
+ "name": "physics.get_joint_reaction_force",
1184
+ "brief": "get the reaction force for a joint",
1185
+ "description": "Get the reaction force for a joint. The joint has to be created before\nthe reaction force can be calculated.\nNote: Currently only supported in 2D physics.",
1186
+ "returnvalues": [
1187
+ {
1188
+ "name": "force",
1189
+ "doc": "reaction force for the joint",
1190
+ "types": ["vector3"]
1191
+ }
1192
+ ],
1193
+ "parameters": [
1194
+ {
1195
+ "name": "collisionobject",
1196
+ "doc": "collision object where the joint exist",
1197
+ "types": ["string", "hash", "url"],
1198
+ "is_optional": "False"
1199
+ },
1200
+ {
1201
+ "name": "joint_id",
1202
+ "doc": "id of the joint",
1203
+ "types": ["string", "hash"],
1204
+ "is_optional": "False"
1205
+ }
1206
+ ],
1207
+ "examples": "",
1208
+ "replaces": "",
1209
+ "error": "",
1210
+ "tparams": [],
1211
+ "members": [],
1212
+ "notes": [],
1213
+ "language": ""
1214
+ },
1215
+ {
1216
+ "type": "FUNCTION",
1217
+ "name": "physics.get_joint_reaction_torque",
1218
+ "brief": "get the reaction torque for a joint",
1219
+ "description": "Get the reaction torque for a joint. The joint has to be created before\nthe reaction torque can be calculated.\nNote: Currently only supported in 2D physics.",
1220
+ "returnvalues": [
1221
+ {
1222
+ "name": "torque",
1223
+ "doc": "the reaction torque on bodyB in N*m.",
1224
+ "types": ["number"]
1225
+ }
1226
+ ],
1227
+ "parameters": [
1228
+ {
1229
+ "name": "collisionobject",
1230
+ "doc": "collision object where the joint exist",
1231
+ "types": ["string", "hash", "url"],
1232
+ "is_optional": "False"
1233
+ },
1234
+ {
1235
+ "name": "joint_id",
1236
+ "doc": "id of the joint",
1237
+ "types": ["string", "hash"],
1238
+ "is_optional": "False"
1239
+ }
1240
+ ],
1241
+ "examples": "",
1242
+ "replaces": "",
1243
+ "error": "",
1244
+ "tparams": [],
1245
+ "members": [],
1246
+ "notes": [],
1247
+ "language": ""
1248
+ },
1249
+ {
1250
+ "type": "FUNCTION",
1251
+ "name": "physics.set_gravity",
1252
+ "brief": "set the gravity for collection",
1253
+ "description": "Set the gravity in runtime. The gravity change is not global, it will only affect\nthe collection that the function is called from.\nNote: For 2D physics the z component of the gravity vector will be ignored.",
1254
+ "returnvalues": [],
1255
+ "parameters": [
1256
+ {
1257
+ "name": "gravity",
1258
+ "doc": "the new gravity vector",
1259
+ "types": ["vector3"],
1260
+ "is_optional": "False"
1261
+ }
1262
+ ],
1263
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"c1\">-- Set &quot;upside down&quot; gravity for this collection.</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_gravity</span><span class=\"p\">(</span><span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mf\">10.0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">))</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1264
+ "replaces": "",
1265
+ "error": "",
1266
+ "tparams": [],
1267
+ "members": [],
1268
+ "notes": [],
1269
+ "language": ""
1270
+ },
1271
+ {
1272
+ "type": "FUNCTION",
1273
+ "name": "physics.get_gravity",
1274
+ "brief": "get the gravity for collection",
1275
+ "description": "Get the gravity in runtime. The gravity returned is not global, it will return\nthe gravity for the collection that the function is called from.\nNote: For 2D physics the z component will always be zero.",
1276
+ "returnvalues": [
1277
+ {
1278
+ "name": "gravity",
1279
+ "doc": "gravity vector of collection",
1280
+ "types": ["vector3"]
1281
+ }
1282
+ ],
1283
+ "parameters": [],
1284
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"kd\">local</span> <span class=\"n\">gravity</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">get_gravity</span><span class=\"p\">()</span>\n <span class=\"c1\">-- Inverse gravity!</span>\n <span class=\"n\">gravity</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">gravity</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_gravity</span><span class=\"p\">(</span><span class=\"n\">gravity</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1285
+ "replaces": "",
1286
+ "error": "",
1287
+ "tparams": [],
1288
+ "members": [],
1289
+ "notes": [],
1290
+ "language": ""
1291
+ },
1292
+ {
1293
+ "type": "FUNCTION",
1294
+ "name": "physics.set_hflip",
1295
+ "brief": "flip the geometry horizontally for a collision object",
1296
+ "description": "Flips the collision shapes horizontally for a collision object",
1297
+ "returnvalues": [],
1298
+ "parameters": [
1299
+ {
1300
+ "name": "url",
1301
+ "doc": "the collision object that should flip its shapes",
1302
+ "types": ["string", "hash", "url"],
1303
+ "is_optional": "False"
1304
+ },
1305
+ {
1306
+ "name": "flip",
1307
+ "doc": "<code>true</code> if the collision object should flip its shapes, <code>false</code> if not",
1308
+ "types": ["boolean"],
1309
+ "is_optional": "False"
1310
+ }
1311
+ ],
1312
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">fliph</span> <span class=\"o\">=</span> <span class=\"kc\">true</span> <span class=\"c1\">-- set on some condition</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_hflip</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">fliph</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1313
+ "replaces": "",
1314
+ "error": "",
1315
+ "tparams": [],
1316
+ "members": [],
1317
+ "notes": [],
1318
+ "language": ""
1319
+ },
1320
+ {
1321
+ "type": "FUNCTION",
1322
+ "name": "physics.set_vflip",
1323
+ "brief": "flip the geometry vertically for a collision object",
1324
+ "description": "Flips the collision shapes vertically for a collision object",
1325
+ "returnvalues": [],
1326
+ "parameters": [
1327
+ {
1328
+ "name": "url",
1329
+ "doc": "the collision object that should flip its shapes",
1330
+ "types": ["string", "hash", "url"],
1331
+ "is_optional": "False"
1332
+ },
1333
+ {
1334
+ "name": "flip",
1335
+ "doc": "<code>true</code> if the collision object should flip its shapes, <code>false</code> if not",
1336
+ "types": ["boolean"],
1337
+ "is_optional": "False"
1338
+ }
1339
+ ],
1340
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">flipv</span> <span class=\"o\">=</span> <span class=\"kc\">true</span> <span class=\"c1\">-- set on some condition</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_vflip</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"n\">self</span><span class=\"p\">.</span><span class=\"n\">flipv</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1341
+ "replaces": "",
1342
+ "error": "",
1343
+ "tparams": [],
1344
+ "members": [],
1345
+ "notes": [],
1346
+ "language": ""
1347
+ },
1348
+ {
1349
+ "type": "FUNCTION",
1350
+ "name": "physics.wakeup",
1351
+ "brief": "explicitly wakeup a collision object",
1352
+ "description": "Collision objects tend to fall asleep when inactive for a small period of time for\nefficiency reasons. This function wakes them up.",
1353
+ "returnvalues": [],
1354
+ "parameters": [
1355
+ {
1356
+ "name": "url",
1357
+ "doc": "the collision object to wake.",
1358
+ "types": ["string", "hash", "url"],
1359
+ "is_optional": "False"
1360
+ }
1361
+ ],
1362
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kr\">function</span> <span class=\"nf\">on_input</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">action_id</span><span class=\"p\">,</span> <span class=\"n\">action</span><span class=\"p\">)</span>\n <span class=\"kr\">if</span> <span class=\"n\">action_id</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;test&quot;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"n\">action</span><span class=\"p\">.</span><span class=\"n\">pressed</span> <span class=\"kr\">then</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">wakeup</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">)</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1363
+ "replaces": "",
1364
+ "error": "",
1365
+ "tparams": [],
1366
+ "members": [],
1367
+ "notes": [],
1368
+ "language": ""
1369
+ },
1370
+ {
1371
+ "type": "FUNCTION",
1372
+ "name": "physics.set_group",
1373
+ "brief": "change the group of a collision object",
1374
+ "description": "Updates the group property of a collision object to the specified\nstring value. The group name should exist i.e. have been used in\na collision object in the editor.",
1375
+ "returnvalues": [],
1376
+ "parameters": [
1377
+ {
1378
+ "name": "url",
1379
+ "doc": "the collision object affected.",
1380
+ "types": ["string", "hash", "url"],
1381
+ "is_optional": "False"
1382
+ },
1383
+ {
1384
+ "name": "group",
1385
+ "doc": "the new group name to be assigned.",
1386
+ "types": ["string"],
1387
+ "is_optional": "False"
1388
+ }
1389
+ ],
1390
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">change_collision_group</span><span class=\"p\">()</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_group</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;enemy&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1391
+ "replaces": "",
1392
+ "error": "",
1393
+ "tparams": [],
1394
+ "members": [],
1395
+ "notes": [],
1396
+ "language": ""
1397
+ },
1398
+ {
1399
+ "type": "FUNCTION",
1400
+ "name": "physics.get_group",
1401
+ "brief": "returns the group of a collision object",
1402
+ "description": "Returns the group name of a collision object as a hash.",
1403
+ "returnvalues": [
1404
+ {
1405
+ "name": "group",
1406
+ "doc": "hash value of the group.",
1407
+ "types": ["hash"]
1408
+ }
1409
+ ],
1410
+ "parameters": [
1411
+ {
1412
+ "name": "url",
1413
+ "doc": "the collision object to return the group of.",
1414
+ "types": ["string", "hash", "url"],
1415
+ "is_optional": "False"
1416
+ }
1417
+ ],
1418
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">check_is_enemy</span><span class=\"p\">()</span>\n <span class=\"kd\">local</span> <span class=\"n\">group</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">get_group</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">)</span>\n <span class=\"kr\">return</span> <span class=\"n\">group</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;enemy&quot;</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1419
+ "replaces": "",
1420
+ "error": "",
1421
+ "tparams": [],
1422
+ "members": [],
1423
+ "notes": [],
1424
+ "language": ""
1425
+ },
1426
+ {
1427
+ "type": "FUNCTION",
1428
+ "name": "physics.set_maskbit",
1429
+ "brief": "updates the mask of a collision object",
1430
+ "description": "Sets or clears the masking of a group (maskbit) in a collision object.",
1431
+ "returnvalues": [],
1432
+ "parameters": [
1433
+ {
1434
+ "name": "url",
1435
+ "doc": "the collision object to change the mask of.",
1436
+ "types": ["string", "hash", "url"],
1437
+ "is_optional": "False"
1438
+ },
1439
+ {
1440
+ "name": "group",
1441
+ "doc": "the name of the group (maskbit) to modify in the mask.",
1442
+ "types": ["string"],
1443
+ "is_optional": "False"
1444
+ },
1445
+ {
1446
+ "name": "maskbit",
1447
+ "doc": "boolean value of the new maskbit. 'true' to enable, 'false' to disable.",
1448
+ "types": ["boolean"],
1449
+ "is_optional": "False"
1450
+ }
1451
+ ],
1452
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">make_invincible</span><span class=\"p\">()</span>\n <span class=\"c1\">-- no longer collide with the &quot;bullet&quot; group</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_maskbit</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;bullet&quot;</span><span class=\"p\">,</span> <span class=\"kc\">false</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1453
+ "replaces": "",
1454
+ "error": "",
1455
+ "tparams": [],
1456
+ "members": [],
1457
+ "notes": [],
1458
+ "language": ""
1459
+ },
1460
+ {
1461
+ "type": "FUNCTION",
1462
+ "name": "physics.get_maskbit",
1463
+ "brief": "checks the presense of a group in the mask (maskbit) of a collision object",
1464
+ "description": "Returns true if the specified group is set in the mask of a collision\nobject, false otherwise.",
1465
+ "returnvalues": [
1466
+ {
1467
+ "name": "maskbit",
1468
+ "doc": "boolean value of the maskbit. 'true' if present, 'false' otherwise.",
1469
+ "types": ["boolean"]
1470
+ }
1471
+ ],
1472
+ "parameters": [
1473
+ {
1474
+ "name": "url",
1475
+ "doc": "the collision object to check the mask of.",
1476
+ "types": ["string", "hash", "url"],
1477
+ "is_optional": "False"
1478
+ },
1479
+ {
1480
+ "name": "group",
1481
+ "doc": "the name of the group to check for.",
1482
+ "types": ["string"],
1483
+ "is_optional": "False"
1484
+ }
1485
+ ],
1486
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">is_invincible</span><span class=\"p\">()</span>\n <span class=\"c1\">-- check if the collisionobject would collide with the &quot;bullet&quot; group</span>\n <span class=\"kd\">local</span> <span class=\"n\">invincible</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">get_maskbit</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;bullet&quot;</span><span class=\"p\">)</span>\n <span class=\"kr\">return</span> <span class=\"n\">invincible</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1487
+ "replaces": "",
1488
+ "error": "",
1489
+ "tparams": [],
1490
+ "members": [],
1491
+ "notes": [],
1492
+ "language": ""
1493
+ },
1494
+ {
1495
+ "type": "FUNCTION",
1496
+ "name": "physics.get_shape",
1497
+ "brief": "get collision shape info",
1498
+ "description": "Gets collision shape data from a collision object",
1499
+ "returnvalues": [
1500
+ {
1501
+ "name": "table",
1502
+ "doc": "collision shape data",
1503
+ "types": ["physics.shape_data"]
1504
+ }
1505
+ ],
1506
+ "parameters": [
1507
+ {
1508
+ "name": "url",
1509
+ "doc": "the collision object.",
1510
+ "types": ["string", "hash", "url"],
1511
+ "is_optional": "False"
1512
+ },
1513
+ {
1514
+ "name": "shape",
1515
+ "doc": "the name of the shape to get data for.",
1516
+ "types": ["string", "hash"],
1517
+ "is_optional": "False"
1518
+ }
1519
+ ],
1520
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">get_shape_meta</span><span class=\"p\">()</span>\n <span class=\"kd\">local</span> <span class=\"n\">sphere</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">get_shape</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_sphere_shape&quot;</span><span class=\"p\">)</span>\n <span class=\"c1\">-- returns a table with sphere.diameter</span>\n <span class=\"kr\">return</span> <span class=\"n\">sphere</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1521
+ "replaces": "",
1522
+ "error": "",
1523
+ "tparams": [],
1524
+ "members": [],
1525
+ "notes": [],
1526
+ "language": ""
1527
+ },
1528
+ {
1529
+ "type": "FUNCTION",
1530
+ "name": "physics.set_shape",
1531
+ "brief": "set collision shape data",
1532
+ "description": "Sets collision shape data for a collision object. Please note that updating data in 3D\ncan be quite costly for box and capsules. Because of the physics engine, the cost\ncomes from having to recreate the shape objects when certain shapes needs to be updated.",
1533
+ "returnvalues": [],
1534
+ "parameters": [
1535
+ {
1536
+ "name": "url",
1537
+ "doc": "the collision object.",
1538
+ "types": ["string", "hash", "url"],
1539
+ "is_optional": "False"
1540
+ },
1541
+ {
1542
+ "name": "shape",
1543
+ "doc": "the name of the shape to get data for.",
1544
+ "types": ["string", "hash"],
1545
+ "is_optional": "False"
1546
+ },
1547
+ {
1548
+ "name": "table",
1549
+ "doc": "updated collision shape data\nHull and mesh geometry cannot be changed with this function.",
1550
+ "types": ["physics.shape_data"],
1551
+ "is_optional": "False"
1552
+ }
1553
+ ],
1554
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">set_shape_data</span><span class=\"p\">()</span>\n <span class=\"c1\">-- set capsule shape data</span>\n <span class=\"kd\">local</span> <span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">SHAPE_TYPE_CAPSULE</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">diameter</span> <span class=\"o\">=</span> <span class=\"mi\">10</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">height</span> <span class=\"o\">=</span> <span class=\"mi\">20</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_shape</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_capsule_shape&quot;</span><span class=\"p\">,</span> <span class=\"n\">data</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- set sphere shape data</span>\n <span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">SHAPE_TYPE_SPHERE</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">diameter</span> <span class=\"o\">=</span> <span class=\"mi\">10</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_shape</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_sphere_shape&quot;</span><span class=\"p\">,</span> <span class=\"n\">data</span><span class=\"p\">)</span>\n\n <span class=\"c1\">-- set box shape data</span>\n <span class=\"n\">data</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">SHAPE_TYPE_BOX</span>\n <span class=\"n\">data</span><span class=\"p\">.</span><span class=\"n\">dimensions</span> <span class=\"o\">=</span> <span class=\"n\">vmath</span><span class=\"p\">.</span><span class=\"n\">vector3</span><span class=\"p\">(</span><span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"mi\">5</span><span class=\"p\">)</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_shape</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;my_box_shape&quot;</span><span class=\"p\">,</span> <span class=\"n\">data</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1555
+ "replaces": "",
1556
+ "error": "",
1557
+ "tparams": [],
1558
+ "members": [],
1559
+ "notes": [],
1560
+ "language": ""
1561
+ },
1562
+ {
1563
+ "type": "FUNCTION",
1564
+ "name": "physics.set_event_listener",
1565
+ "brief": "Sets a physics world event listener. If a function is set, physics messages will no longer be sent to on_message.",
1566
+ "description": "Only one physics world event listener can be set at a time.",
1567
+ "returnvalues": [],
1568
+ "parameters": [
1569
+ {
1570
+ "name": "callback",
1571
+ "doc": "A callback that receives information about all physics interactions in this physics world. Pass <code>nil</code> to remove the listener.\n<dl>\n<dt><code>self</code></dt>\n<dd><span class=\"type\">script_instance</span> The calling script instance</dd>\n<dt><code>events</code></dt>\n<dd><span class=\"type\">physics.event[</span>] An array of event tables. Each event table contains a <code>type</code> field with the hashed name of one of these messages, together with fields specific to that event type:</dd>\n</dl>\n<ul>\n<li><a href=\"#contact_point_event\">contact_point_event</a></li>\n<li><a href=\"#collision_event\">collision_event</a></li>\n<li><a href=\"#trigger_event\">trigger_event</a></li>\n<li><a href=\"#ray_cast_response\">ray_cast_response</a></li>\n<li><a href=\"#ray_cast_missed\">ray_cast_missed</a></li>\n</ul>",
1572
+ "types": ["fun(self:script_instance, events:physics.event[])", "nil"],
1573
+ "is_optional": "False"
1574
+ }
1575
+ ],
1576
+ "examples": "<div class=\"codehilite\"><pre><span></span><code><span class=\"kd\">local</span> <span class=\"kr\">function</span> <span class=\"nf\">physics_world_listener</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">,</span> <span class=\"n\">events</span><span class=\"p\">)</span>\n <span class=\"kr\">for</span> <span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">event</span> <span class=\"kr\">in</span> <span class=\"nb\">ipairs</span><span class=\"p\">(</span><span class=\"n\">events</span><span class=\"p\">)</span> <span class=\"kr\">do</span>\n <span class=\"kd\">local</span> <span class=\"n\">event_type</span> <span class=\"o\">=</span> <span class=\"n\">event</span><span class=\"p\">[</span><span class=\"s2\">&quot;type&quot;</span><span class=\"p\">]</span>\n <span class=\"kr\">if</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;contact_point_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- distance = 2.1490633487701,</span>\n <span class=\"c1\">-- applied_impulse = 0</span>\n <span class=\"c1\">-- a = { --[[0x113f7c6c0]]</span>\n <span class=\"c1\">-- group = hash: [box],</span>\n <span class=\"c1\">-- id = hash: [/box]</span>\n <span class=\"c1\">-- mass = 0,</span>\n <span class=\"c1\">-- normal = vmath.vector3(0.379, 0.925, -0),</span>\n <span class=\"c1\">-- position = vmath.vector3(517.337, 235.068, 0),</span>\n <span class=\"c1\">-- instance_position = vmath.vector3(480, 144, 0),</span>\n <span class=\"c1\">-- relative_velocity = vmath.vector3(-0, -0, -0),</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- b = { --[[0x113f7c840]]</span>\n <span class=\"c1\">-- group = hash: [circle],</span>\n <span class=\"c1\">-- id = hash: [/circle]</span>\n <span class=\"c1\">-- mass = 0,</span>\n <span class=\"c1\">-- normal = vmath.vector3(-0.379, -0.925, 0),</span>\n <span class=\"c1\">-- position = vmath.vector3(517.337, 235.068, 0),</span>\n <span class=\"c1\">-- instance_position = vmath.vector3(-0.0021, 0, -0.0022),</span>\n <span class=\"c1\">-- relative_velocity = vmath.vector3(0, 0, 0),</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- }</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;collision_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- a = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- position = vmath.vector3(183, 666, 0),</span>\n <span class=\"c1\">-- id = hash: [/go1]</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- b = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- position = vmath.vector3(185, 704.05865478516, 0),</span>\n <span class=\"c1\">-- id = hash: [/go2]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"c1\">-- }</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;trigger_event&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- enter = true,</span>\n <span class=\"c1\">-- b = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/go2]</span>\n <span class=\"c1\">-- },</span>\n <span class=\"c1\">-- a = {</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- id = hash: [/go1]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"c1\">-- },</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;ray_cast_response&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">--{</span>\n <span class=\"c1\">-- group = hash: [default],</span>\n <span class=\"c1\">-- request_id = 0,</span>\n <span class=\"c1\">-- position = vmath.vector3(249.92222595215, 249.92222595215, 0),</span>\n <span class=\"c1\">-- fraction = 0.68759721517563,</span>\n <span class=\"c1\">-- normal = vmath.vector3(0, 1, 0),</span>\n <span class=\"c1\">-- id = hash: [/go]</span>\n <span class=\"c1\">-- }</span>\n <span class=\"kr\">elseif</span> <span class=\"n\">event_type</span> <span class=\"o\">==</span> <span class=\"n\">hash</span><span class=\"p\">(</span><span class=\"s2\">&quot;ray_cast_missed&quot;</span><span class=\"p\">)</span> <span class=\"kr\">then</span>\n <span class=\"n\">pprint</span><span class=\"p\">(</span><span class=\"n\">event</span><span class=\"p\">)</span>\n <span class=\"c1\">-- {</span>\n <span class=\"c1\">-- request_id = 0</span>\n <span class=\"c1\">--},</span>\n <span class=\"kr\">end</span>\n<span class=\"kr\">end</span>\n\n<span class=\"kr\">function</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">self</span><span class=\"p\">)</span>\n <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">set_event_listener</span><span class=\"p\">(</span><span class=\"n\">physics_world_listener</span><span class=\"p\">)</span>\n<span class=\"kr\">end</span>\n</code></pre></div>",
1577
+ "replaces": "",
1578
+ "error": "",
1579
+ "tparams": [],
1580
+ "members": [],
1581
+ "notes": [],
1582
+ "language": ""
1583
+ },
1584
+ {
1585
+ "type": "FUNCTION",
1586
+ "name": "physics.update_mass",
1587
+ "brief": "updates the mass of a dynamic 2D collision object in the physics world.",
1588
+ "description": "The function recalculates the density of each shape based on the total area of all shapes and the specified mass, then updates the mass of the body accordingly.\nNote: Currently only supported in 2D physics.",
1589
+ "returnvalues": [],
1590
+ "parameters": [
1591
+ {
1592
+ "name": "collisionobject",
1593
+ "doc": "the collision object whose mass needs to be updated.",
1594
+ "types": ["string", "hash", "url"],
1595
+ "is_optional": "False"
1596
+ },
1597
+ {
1598
+ "name": "mass",
1599
+ "doc": "the new mass value to set for the collision object.",
1600
+ "types": ["number"],
1601
+ "is_optional": "False"
1602
+ }
1603
+ ],
1604
+ "examples": "<div class=\"codehilite\"><pre><span></span><code> <span class=\"n\">physics</span><span class=\"p\">.</span><span class=\"n\">update_mass</span><span class=\"p\">(</span><span class=\"s2\">&quot;#collisionobject&quot;</span><span class=\"p\">,</span> <span class=\"mi\">14</span><span class=\"p\">)</span>\n</code></pre></div>",
1605
+ "replaces": "",
1606
+ "error": "",
1607
+ "tparams": [],
1608
+ "members": [],
1609
+ "notes": [],
1610
+ "language": ""
1611
+ }
1612
+ ],
1613
+ "info": {
1614
+ "namespace": "physics",
1615
+ "name": "Collision object",
1616
+ "brief": "Collision object physics API documentation",
1617
+ "description": "Collision object physics API documentation",
1618
+ "path": "engine/gamesys/proto/gamesys/physics_ddf.proto",
1619
+ "file": "",
1620
+ "notes": [],
1621
+ "language": "Lua"
1622
+ },
1623
+ "format_version": 2
1624
+ }