@defold-typescript/types 0.51.0 → 0.53.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 (228) hide show
  1. package/api-availability.json +4 -58
  2. package/api-signatures.json +2804 -3172
  3. package/api-targets.json +15 -5
  4. package/examples/translations.json +19 -71
  5. package/generated/b2d.d.ts +39 -39
  6. package/generated/b2d_body.d.ts +11 -11
  7. package/generated/b2d_chain.d.ts +3 -3
  8. package/generated/b2d_fixture.d.ts +5 -5
  9. package/generated/b2d_joint.d.ts +29 -29
  10. package/generated/b2d_shape.d.ts +13 -13
  11. package/generated/b2d_world.d.ts +15 -15
  12. package/generated/buffer.d.ts +10 -11
  13. package/generated/bullet3d.d.ts +6 -6
  14. package/generated/bullet3d_collision_object.d.ts +10 -10
  15. package/generated/bullet3d_constraint.d.ts +173 -71
  16. package/generated/bullet3d_rigid_body.d.ts +3 -3
  17. package/generated/bullet3d_shape.d.ts +11 -11
  18. package/generated/bullet3d_world.d.ts +20 -20
  19. package/generated/camera.d.ts +4 -4
  20. package/generated/collectionfactory.d.ts +2 -3
  21. package/generated/collectionproxy.d.ts +5 -5
  22. package/generated/compute.d.ts +5 -5
  23. package/generated/crash.d.ts +7 -7
  24. package/generated/editor-vm/http.d.ts +13 -13
  25. package/generated/editor-vm/image.d.ts +4 -4
  26. package/generated/editor-vm/json.d.ts +1 -1
  27. package/generated/editor-vm/tilemap_tiles.d.ts +9 -9
  28. package/generated/editor-vm/zip.d.ts +4 -4
  29. package/generated/editor.d.ts +183 -183
  30. package/generated/factory.d.ts +2 -3
  31. package/generated/font.d.ts +4 -4
  32. package/generated/go.d.ts +122 -230
  33. package/generated/graphics.d.ts +23 -25
  34. package/generated/gui.d.ts +186 -423
  35. package/generated/http.d.ts +3 -3
  36. package/generated/image.d.ts +63 -11
  37. package/generated/json.d.ts +4 -4
  38. package/generated/kinds/gui-script.d.ts +2 -0
  39. package/generated/kinds/render-script.d.ts +14 -15
  40. package/generated/label.d.ts +5 -5
  41. package/generated/liveupdate.d.ts +7 -3
  42. package/generated/material.d.ts +49 -49
  43. package/generated/model.d.ts +46 -14
  44. package/generated/particlefx.d.ts +24 -5
  45. package/generated/physics.d.ts +64 -20
  46. package/generated/profiler.d.ts +3 -5
  47. package/generated/render-script-modules/b2d.d.ts +711 -0
  48. package/generated/render-script-modules/bullet3d.d.ts +73 -0
  49. package/generated/render-script-modules/collectionfactory.d.ts +24 -0
  50. package/generated/render-script-modules/collectionproxy.d.ts +39 -0
  51. package/generated/render-script-modules/factory.d.ts +24 -0
  52. package/generated/render-script-modules/go.d.ts +434 -0
  53. package/generated/render-script-modules/label.d.ts +105 -0
  54. package/generated/render-script-modules/model.d.ts +121 -0
  55. package/generated/render-script-modules/particlefx.d.ts +59 -0
  56. package/generated/render-script-modules/physics.d.ts +333 -0
  57. package/generated/render-script-modules/resource.d.ts +1232 -0
  58. package/generated/render-script-modules/sound.d.ts +227 -0
  59. package/generated/render-script-modules/sprite.d.ts +68 -0
  60. package/generated/render-script-modules/tilemap.d.ts +43 -0
  61. package/generated/render.d.ts +172 -47
  62. package/generated/resource.d.ts +81 -61
  63. package/generated/socket.d.ts +18 -23
  64. package/generated/sound.d.ts +6 -6
  65. package/generated/sprite.d.ts +51 -3
  66. package/generated/sys.d.ts +87 -24
  67. package/generated/tilemap.d.ts +3 -3
  68. package/generated/timer.d.ts +3 -3
  69. package/generated/versions/defold-1.12.4/b2d.d.ts +2 -2
  70. package/generated/versions/defold-1.12.4/b2d_body.d.ts +2 -2
  71. package/generated/versions/defold-1.12.4/buffer.d.ts +8 -8
  72. package/generated/versions/defold-1.12.4/go.d.ts +117 -345
  73. package/generated/versions/defold-1.12.4/graphics.d.ts +2 -1
  74. package/generated/versions/defold-1.12.4/gui.d.ts +169 -532
  75. package/generated/versions/defold-1.12.4/http.d.ts +2 -2
  76. package/generated/versions/defold-1.12.4/image.d.ts +82 -2
  77. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  78. package/generated/versions/defold-1.12.4/label.d.ts +1 -1
  79. package/generated/versions/defold-1.12.4/liveupdate.d.ts +4 -0
  80. package/generated/versions/defold-1.12.4/model.d.ts +42 -10
  81. package/generated/versions/defold-1.12.4/particlefx.d.ts +23 -2
  82. package/generated/versions/defold-1.12.4/physics.d.ts +46 -2
  83. package/generated/versions/defold-1.12.4/render.d.ts +83 -7
  84. package/generated/versions/defold-1.12.4/resource.d.ts +50 -17
  85. package/generated/versions/defold-1.12.4/socket.d.ts +12 -12
  86. package/generated/versions/defold-1.12.4/sound.d.ts +1 -1
  87. package/generated/versions/defold-1.12.4/sprite.d.ts +59 -2
  88. package/generated/versions/defold-1.12.4/sys.d.ts +103 -8
  89. package/generated/versions/defold-1.12.4/tilemap.d.ts +1 -1
  90. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -24
  91. package/generated/versions/defold-1.12.4/window.d.ts +3 -4
  92. package/generated/versions/defold-1.13.0/b2d.d.ts +2 -2
  93. package/generated/versions/defold-1.13.0/b2d_body.d.ts +2 -2
  94. package/generated/versions/defold-1.13.0/b2d_chain.d.ts +1 -1
  95. package/generated/versions/defold-1.13.0/b2d_joint.d.ts +1 -1
  96. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +1 -1
  97. package/generated/versions/defold-1.13.0/buffer.d.ts +8 -8
  98. package/generated/versions/defold-1.13.0/camera.d.ts +1 -1
  99. package/generated/versions/defold-1.13.0/go.d.ts +117 -372
  100. package/generated/versions/defold-1.13.0/graphics.d.ts +2 -1
  101. package/generated/versions/defold-1.13.0/gui.d.ts +169 -532
  102. package/generated/versions/defold-1.13.0/http.d.ts +2 -2
  103. package/generated/versions/defold-1.13.0/image.d.ts +82 -2
  104. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  105. package/generated/versions/defold-1.13.0/label.d.ts +1 -1
  106. package/generated/versions/defold-1.13.0/liveupdate.d.ts +4 -0
  107. package/generated/versions/defold-1.13.0/material.d.ts +3 -1
  108. package/generated/versions/defold-1.13.0/model.d.ts +42 -10
  109. package/generated/versions/defold-1.13.0/particlefx.d.ts +23 -2
  110. package/generated/versions/defold-1.13.0/physics.d.ts +46 -2
  111. package/generated/versions/defold-1.13.0/render.d.ts +147 -9
  112. package/generated/versions/defold-1.13.0/resource.d.ts +50 -17
  113. package/generated/versions/defold-1.13.0/socket.d.ts +12 -12
  114. package/generated/versions/defold-1.13.0/sound.d.ts +1 -1
  115. package/generated/versions/defold-1.13.0/sprite.d.ts +59 -2
  116. package/generated/versions/defold-1.13.0/sys.d.ts +103 -8
  117. package/generated/versions/defold-1.13.0/tilemap.d.ts +1 -1
  118. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -24
  119. package/generated/versions/defold-1.13.0/window.d.ts +3 -4
  120. package/generated/versions/defold-1.13.1/b2d.d.ts +2 -2
  121. package/generated/versions/defold-1.13.1/b2d_body.d.ts +2 -2
  122. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +1 -1
  123. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +1 -1
  124. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +1 -1
  125. package/generated/versions/defold-1.13.1/buffer.d.ts +8 -8
  126. package/generated/versions/defold-1.13.1/camera.d.ts +1 -1
  127. package/generated/versions/defold-1.13.1/go.d.ts +117 -372
  128. package/generated/versions/defold-1.13.1/graphics.d.ts +2 -1
  129. package/generated/versions/defold-1.13.1/gui.d.ts +169 -548
  130. package/generated/versions/defold-1.13.1/http.d.ts +2 -2
  131. package/generated/versions/defold-1.13.1/image.d.ts +82 -2
  132. package/generated/versions/defold-1.13.1/index.d.ts +2 -0
  133. package/generated/versions/defold-1.13.1/label.d.ts +1 -1
  134. package/generated/versions/defold-1.13.1/liveupdate.d.ts +4 -0
  135. package/generated/versions/defold-1.13.1/material.d.ts +3 -1
  136. package/generated/versions/defold-1.13.1/model.d.ts +42 -10
  137. package/generated/versions/defold-1.13.1/particlefx.d.ts +23 -2
  138. package/generated/versions/defold-1.13.1/physics.d.ts +46 -2
  139. package/generated/versions/defold-1.13.1/render.d.ts +147 -9
  140. package/generated/versions/defold-1.13.1/resource.d.ts +50 -17
  141. package/generated/versions/defold-1.13.1/socket.d.ts +12 -12
  142. package/generated/versions/defold-1.13.1/sound.d.ts +1 -1
  143. package/generated/versions/defold-1.13.1/sprite.d.ts +59 -2
  144. package/generated/versions/defold-1.13.1/sys.d.ts +103 -8
  145. package/generated/versions/defold-1.13.1/tilemap.d.ts +1 -1
  146. package/generated/versions/defold-1.13.1/vmath.d.ts +0 -24
  147. package/generated/versions/defold-1.13.1/window.d.ts +3 -4
  148. package/generated/versions/defold-1.13.2/b2d.d.ts +39 -39
  149. package/generated/versions/defold-1.13.2/b2d_body.d.ts +11 -11
  150. package/generated/versions/defold-1.13.2/b2d_chain.d.ts +3 -3
  151. package/generated/versions/defold-1.13.2/b2d_fixture.d.ts +5 -5
  152. package/generated/versions/defold-1.13.2/b2d_joint.d.ts +29 -29
  153. package/generated/versions/defold-1.13.2/b2d_shape.d.ts +13 -13
  154. package/generated/versions/defold-1.13.2/b2d_world.d.ts +15 -15
  155. package/generated/versions/defold-1.13.2/buffer.d.ts +10 -11
  156. package/generated/versions/defold-1.13.2/bullet3d.d.ts +6 -6
  157. package/generated/versions/defold-1.13.2/bullet3d_collision_object.d.ts +10 -10
  158. package/generated/versions/defold-1.13.2/bullet3d_constraint.d.ts +173 -71
  159. package/generated/versions/defold-1.13.2/bullet3d_rigid_body.d.ts +3 -3
  160. package/generated/versions/defold-1.13.2/bullet3d_shape.d.ts +11 -11
  161. package/generated/versions/defold-1.13.2/bullet3d_world.d.ts +20 -20
  162. package/generated/versions/defold-1.13.2/camera.d.ts +4 -4
  163. package/generated/versions/defold-1.13.2/collectionfactory.d.ts +2 -3
  164. package/generated/versions/defold-1.13.2/collectionproxy.d.ts +5 -5
  165. package/generated/versions/defold-1.13.2/compute.d.ts +5 -5
  166. package/generated/versions/defold-1.13.2/crash.d.ts +7 -7
  167. package/generated/versions/defold-1.13.2/editor-vm/http.d.ts +13 -13
  168. package/generated/versions/defold-1.13.2/editor-vm/image.d.ts +4 -4
  169. package/generated/versions/defold-1.13.2/editor-vm/json.d.ts +1 -1
  170. package/generated/versions/defold-1.13.2/editor-vm/tilemap_tiles.d.ts +9 -9
  171. package/generated/versions/defold-1.13.2/editor-vm/zip.d.ts +4 -4
  172. package/generated/versions/defold-1.13.2/editor.d.ts +183 -183
  173. package/generated/versions/defold-1.13.2/factory.d.ts +2 -3
  174. package/generated/versions/defold-1.13.2/font.d.ts +4 -4
  175. package/generated/versions/defold-1.13.2/go.d.ts +122 -230
  176. package/generated/versions/defold-1.13.2/graphics.d.ts +22 -24
  177. package/generated/versions/defold-1.13.2/gui.d.ts +186 -423
  178. package/generated/versions/defold-1.13.2/http.d.ts +3 -3
  179. package/generated/versions/defold-1.13.2/image.d.ts +63 -11
  180. package/generated/versions/defold-1.13.2/index.d.ts +2 -0
  181. package/generated/versions/defold-1.13.2/json.d.ts +4 -4
  182. package/generated/versions/defold-1.13.2/label.d.ts +5 -5
  183. package/generated/versions/defold-1.13.2/liveupdate.d.ts +7 -3
  184. package/generated/versions/defold-1.13.2/material.d.ts +49 -49
  185. package/generated/versions/defold-1.13.2/model.d.ts +46 -14
  186. package/generated/versions/defold-1.13.2/particlefx.d.ts +24 -5
  187. package/generated/versions/defold-1.13.2/physics.d.ts +64 -20
  188. package/generated/versions/defold-1.13.2/profiler.d.ts +3 -5
  189. package/generated/versions/defold-1.13.2/render.d.ts +161 -46
  190. package/generated/versions/defold-1.13.2/resource.d.ts +81 -61
  191. package/generated/versions/defold-1.13.2/socket.d.ts +18 -23
  192. package/generated/versions/defold-1.13.2/sound.d.ts +6 -6
  193. package/generated/versions/defold-1.13.2/sprite.d.ts +51 -3
  194. package/generated/versions/defold-1.13.2/sys.d.ts +87 -24
  195. package/generated/versions/defold-1.13.2/tilemap.d.ts +3 -3
  196. package/generated/versions/defold-1.13.2/timer.d.ts +3 -3
  197. package/generated/versions/defold-1.13.2/vmath.d.ts +0 -25
  198. package/generated/versions/defold-1.13.2/window.d.ts +8 -10
  199. package/generated/vmath.d.ts +0 -25
  200. package/generated/window.d.ts +8 -10
  201. package/identity-vocabulary.json +86 -34
  202. package/index.d.ts +2 -0
  203. package/package.json +3 -1
  204. package/scripts/generate-api-availability.ts +10 -24
  205. package/scripts/generate-api-signatures.ts +75 -14
  206. package/scripts/materialize-version.ts +48 -7
  207. package/scripts/regen.ts +214 -19
  208. package/scripts/shared-handle-methods.ts +3 -2
  209. package/scripts/signature-store-fs.ts +1 -0
  210. package/scripts/target-version.ts +26 -0
  211. package/src/api-doc.ts +34 -0
  212. package/src/api-identity.ts +32 -1
  213. package/src/component-properties.d.ts +96 -7
  214. package/src/core-types.ts +71 -28
  215. package/src/doc-corrections.ts +62 -5
  216. package/src/emit-dts.ts +1423 -401
  217. package/src/engine-globals.d.ts +5 -1
  218. package/src/engine-type-name.ts +33 -0
  219. package/src/go-overloads.d.ts +74 -19
  220. package/src/gui-overloads.d.ts +489 -0
  221. package/src/gui-texture-removal.d.ts +41 -0
  222. package/src/index.ts +3 -0
  223. package/src/lifecycle.ts +32 -23
  224. package/src/msg-overloads.d.ts +25 -13
  225. package/src/signature-store.ts +50 -0
  226. package/src/socket-types.d.ts +3 -3
  227. package/src/timers.d.ts +2 -1
  228. package/src/vmath-overloads.d.ts +26 -0
@@ -6,8 +6,8 @@ declare global {
6
6
  * Functions for interacting with Box2D bodies.
7
7
  */
8
8
  namespace b2d.body {
9
- type b2Body = Opaque<"b2Body">;
10
- type b2World = Opaque<"b2World">;
9
+ type B2Body = Opaque<"b2Body">;
10
+ type B2World = Opaque<"b2World">;
11
11
  type B2 = typeof b2d.body.B2_DYNAMIC_BODY | typeof b2d.body.B2_KINEMATIC_BODY | typeof b2d.body.B2_STATIC_BODY;
12
12
  /**
13
13
  * Dynamic body
@@ -77,7 +77,7 @@ declare global {
77
77
  * @param body - body
78
78
  * @returns body bounds
79
79
  */
80
- function compute_aabb(body: Opaque<"b2Body">): b2d.aabb;
80
+ function compute_aabb(body: Opaque<"b2Body">): b2d.Aabb;
81
81
  /**
82
82
  * Chains are one-sided connected segments with optional ghost vertices at
83
83
  * the ends of open chains. Ghost vertices are creation-time chain data only and
@@ -96,7 +96,7 @@ declare global {
96
96
  * }
97
97
  * ```
98
98
  */
99
- function create_chain(body: Opaque<"b2Body">, definition: b2d.chain_definition): LuaMultiReturn<[Opaque<"b2Chain">, b2d.shape_info[]]>;
99
+ function create_chain(body: Opaque<"b2Body">, definition: b2d.ChainDefinition): LuaMultiReturn<[Opaque<"b2Chain">, b2d.ShapeInfo[]]>;
100
100
  /**
101
101
  * Creates a fixture and attach it to this body. Use this function if you need
102
102
  * to set some fixture parameters, like friction. Otherwise you can create the
@@ -118,7 +118,7 @@ declare global {
118
118
  * }
119
119
  * ```
120
120
  */
121
- function create_fixture(body: Opaque<"b2Body">, definition: { shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }; friction?: number; restitution?: number; density?: number; sensor?: boolean; is_sensor?: boolean; filter?: { category_bits: number; mask_bits: number; group_index: number } }): b2d.fixture_info;
121
+ function create_fixture(body: Opaque<"b2Body">, definition: { shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }; friction?: number; restitution?: number; density?: number; sensor?: boolean; is_sensor?: boolean; filter?: { category_bits: number; mask_bits: number; group_index: number } }): b2d.FixtureInfo;
122
122
  /**
123
123
  * Creates a shape and attaches it to this body.
124
124
  * If the density is non-zero, this function automatically updates the mass of the body.
@@ -201,14 +201,14 @@ declare global {
201
201
  * @param body - body
202
202
  * @returns array of contact tables
203
203
  */
204
- function get_contact_data(body: Opaque<"b2Body">): b2d.contact_data[];
204
+ function get_contact_data(body: Opaque<"b2Body">): b2d.ContactData[];
205
205
  /**
206
206
  * Get the fixtures attached to this body.
207
207
  *
208
208
  * @param body - body
209
209
  * @returns the attached fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
210
210
  */
211
- function get_fixtures(body: Opaque<"b2Body">): b2d.fixture_info[];
211
+ function get_fixtures(body: Opaque<"b2Body">): b2d.FixtureInfo[];
212
212
  /**
213
213
  * Get the total force currently applied on this object
214
214
  *
@@ -309,7 +309,7 @@ declare global {
309
309
  * @param body - body
310
310
  * @returns the mass data
311
311
  */
312
- function get_mass_data(body: Opaque<"b2Body">): b2d.mass_data;
312
+ function get_mass_data(body: Opaque<"b2Body">): b2d.MassData;
313
313
  /**
314
314
  * Get the body name.
315
315
  *
@@ -344,7 +344,7 @@ declare global {
344
344
  * @param body - body
345
345
  * @returns attached shapes
346
346
  */
347
- function get_shapes(body: Opaque<"b2Body">): b2d.shape_info[];
347
+ function get_shapes(body: Opaque<"b2Body">): b2d.ShapeInfo[];
348
348
  /**
349
349
  * Get the sleep velocity threshold.
350
350
  *
@@ -358,7 +358,7 @@ declare global {
358
358
  * @param body - body
359
359
  * @returns the body transform
360
360
  */
361
- function get_transform(body: Opaque<"b2Body">): b2d.transform;
361
+ function get_transform(body: Opaque<"b2Body">): b2d.Transform;
362
362
  /**
363
363
  * Get the type of this body.
364
364
  *
@@ -539,7 +539,7 @@ declare global {
539
539
  * @param body - body
540
540
  * @param data - the mass data
541
541
  */
542
- function set_mass_data(body: Opaque<"b2Body">, data: b2d.mass_data): void;
542
+ function set_mass_data(body: Opaque<"b2Body">, data: b2d.MassData): void;
543
543
  /**
544
544
  * Set the body name.
545
545
  *
@@ -7,7 +7,7 @@ declare global {
7
7
  * shapes, so it is represented by a separate `b2Chain` handle.
8
8
  */
9
9
  namespace b2d.chain {
10
- type b2Chain = Opaque<"b2Chain">;
10
+ type B2Chain = Opaque<"b2Chain">;
11
11
  /**
12
12
  * Destroying a chain removes all segment shapes owned by the chain. Destroying
13
13
  * any segment shape through `b2d.body.destroy_shape` also destroys its parent chain.
@@ -35,7 +35,7 @@ declare global {
35
35
  * @param chain - chain
36
36
  * @returns chain geometry
37
37
  */
38
- function get_geometry(chain: Opaque<"b2Chain">): b2d.chain_geometry;
38
+ function get_geometry(chain: Opaque<"b2Chain">): b2d.ChainGeometry;
39
39
  /**
40
40
  * Get chain material id.
41
41
  *
@@ -63,7 +63,7 @@ declare global {
63
63
  * @param chain - chain
64
64
  * @returns chain segment shapes
65
65
  */
66
- function get_segments(chain: Opaque<"b2Chain">): b2d.shape_info[];
66
+ function get_segments(chain: Opaque<"b2Chain">): b2d.ShapeInfo[];
67
67
  /**
68
68
  * Get the world owning a chain.
69
69
  *
@@ -15,7 +15,7 @@ declare global {
15
15
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
16
16
  * @returns the fixture AABB
17
17
  */
18
- function get_aabb(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.aabb;
18
+ function get_aabb(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.Aabb;
19
19
  /**
20
20
  * Get fixture density.
21
21
  *
@@ -32,7 +32,7 @@ declare global {
32
32
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
33
33
  * @returns the filter data
34
34
  */
35
- function get_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.filter;
35
+ function get_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number): b2d.Filter;
36
36
  /**
37
37
  * Get fixture friction.
38
38
  *
@@ -54,14 +54,14 @@ declare global {
54
54
  * @param fixture_index - 1-based fixture index from b2d.body.get_fixtures. **⚠️ 1-based; passed to Defold unchanged.**
55
55
  * @returns the shape definition, suitable for reuse in b2d.body.create_fixture
56
56
  */
57
- function get_shape(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.definition;
57
+ function get_shape(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.Definition;
58
58
  /**
59
59
  * Get the fixture type.
60
60
  *
61
61
  * @param body - body
62
62
  * @param fixture_index - 1-based fixture index from b2d.body.get_fixtures. **⚠️ 1-based; passed to Defold unchanged.**
63
63
  */
64
- function get_type(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.SHAPE_TYPE;
64
+ function get_type(body: Opaque<"b2Body">, fixture_index: number): b2d.shape.ShapeType;
65
65
  /**
66
66
  * Check if a fixture is a sensor.
67
67
  *
@@ -94,7 +94,7 @@ declare global {
94
94
  * @param child_index - 1-based child shape index. **⚠️ 1-based; passed to Defold unchanged.**
95
95
  * @param filter - the filter data
96
96
  */
97
- function set_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number, filter: b2d.filter): void;
97
+ function set_filter_data(body: Opaque<"b2Body">, fixture_index: number, child_index: number, filter: b2d.Filter): void;
98
98
  /**
99
99
  * Set fixture friction.
100
100
  *
@@ -6,11 +6,11 @@ declare global {
6
6
  * Functions for interacting with native Box2D joints.
7
7
  */
8
8
  namespace b2d.joint {
9
- type b2Joint = Opaque<"b2Joint">;
9
+ type B2Joint = Opaque<"b2Joint">;
10
10
  /**
11
11
  * Box2D distance-joint definition
12
12
  */
13
- interface distance_definition {
13
+ interface DistanceDefinition {
14
14
  /**
15
15
  * Local anchor on the first body.
16
16
  */
@@ -72,11 +72,11 @@ declare global {
72
72
  */
73
73
  collide_connected?: boolean;
74
74
  }
75
- type filter_definition = {};
75
+ type FilterDefinition = {};
76
76
  /**
77
77
  * Box2D friction-joint definition
78
78
  */
79
- interface friction_definition {
79
+ interface FrictionDefinition {
80
80
  /**
81
81
  * Local anchor on the first body.
82
82
  */
@@ -101,7 +101,7 @@ declare global {
101
101
  /**
102
102
  * Box2D gear-joint definition
103
103
  */
104
- interface gear_definition {
104
+ interface GearDefinition {
105
105
  /**
106
106
  * Gear ratio.
107
107
  */
@@ -114,7 +114,7 @@ declare global {
114
114
  /**
115
115
  * Box2D motor-joint definition
116
116
  */
117
- interface motor_definition {
117
+ interface MotorDefinition {
118
118
  /**
119
119
  * Linear target offset.
120
120
  */
@@ -143,7 +143,7 @@ declare global {
143
143
  /**
144
144
  * Box2D mouse-joint definition
145
145
  */
146
- interface mouse_definition {
146
+ interface MouseDefinition {
147
147
  /**
148
148
  * Target position.
149
149
  */
@@ -176,7 +176,7 @@ declare global {
176
176
  /**
177
177
  * Box2D prismatic-joint definition
178
178
  */
179
- interface prismatic_definition {
179
+ interface PrismaticDefinition {
180
180
  /**
181
181
  * Local anchor on the first body.
182
182
  */
@@ -245,7 +245,7 @@ declare global {
245
245
  /**
246
246
  * Box2D pulley-joint definition
247
247
  */
248
- interface pulley_definition {
248
+ interface PulleyDefinition {
249
249
  /**
250
250
  * First ground anchor.
251
251
  */
@@ -282,7 +282,7 @@ declare global {
282
282
  /**
283
283
  * Box2D revolute-joint definition
284
284
  */
285
- interface revolute_definition {
285
+ interface RevoluteDefinition {
286
286
  /**
287
287
  * Local anchor on the first body.
288
288
  */
@@ -347,7 +347,7 @@ declare global {
347
347
  /**
348
348
  * Box2D rope-joint definition
349
349
  */
350
- interface rope_definition {
350
+ interface RopeDefinition {
351
351
  /**
352
352
  * Local anchor on the first body.
353
353
  */
@@ -368,7 +368,7 @@ declare global {
368
368
  /**
369
369
  * Box2D weld-joint definition
370
370
  */
371
- interface weld_definition {
371
+ interface WeldDefinition {
372
372
  /**
373
373
  * Local anchor on the first body.
374
374
  */
@@ -421,7 +421,7 @@ declare global {
421
421
  /**
422
422
  * Box2D wheel-joint definition
423
423
  */
424
- interface wheel_definition {
424
+ interface WheelDefinition {
425
425
  /**
426
426
  * Local anchor on the first body.
427
427
  */
@@ -483,8 +483,8 @@ declare global {
483
483
  */
484
484
  collide_connected?: boolean;
485
485
  }
486
- type JOINT_TYPE = typeof b2d.joint.JOINT_TYPE_DISTANCE | typeof b2d.joint.JOINT_TYPE_FILTER | typeof b2d.joint.JOINT_TYPE_FRICTION | typeof b2d.joint.JOINT_TYPE_GEAR | typeof b2d.joint.JOINT_TYPE_MOTOR | typeof b2d.joint.JOINT_TYPE_MOUSE | typeof b2d.joint.JOINT_TYPE_PRISMATIC | typeof b2d.joint.JOINT_TYPE_PULLEY | typeof b2d.joint.JOINT_TYPE_REVOLUTE | typeof b2d.joint.JOINT_TYPE_ROPE | typeof b2d.joint.JOINT_TYPE_UNKNOWN | typeof b2d.joint.JOINT_TYPE_WELD | typeof b2d.joint.JOINT_TYPE_WHEEL;
487
- type LIMIT_STATE = typeof b2d.joint.LIMIT_STATE_AT_LOWER | typeof b2d.joint.LIMIT_STATE_AT_UPPER | typeof b2d.joint.LIMIT_STATE_EQUAL | typeof b2d.joint.LIMIT_STATE_INACTIVE;
486
+ type JointType = typeof b2d.joint.JOINT_TYPE_DISTANCE | typeof b2d.joint.JOINT_TYPE_FILTER | typeof b2d.joint.JOINT_TYPE_FRICTION | typeof b2d.joint.JOINT_TYPE_GEAR | typeof b2d.joint.JOINT_TYPE_MOTOR | typeof b2d.joint.JOINT_TYPE_MOUSE | typeof b2d.joint.JOINT_TYPE_PRISMATIC | typeof b2d.joint.JOINT_TYPE_PULLEY | typeof b2d.joint.JOINT_TYPE_REVOLUTE | typeof b2d.joint.JOINT_TYPE_ROPE | typeof b2d.joint.JOINT_TYPE_UNKNOWN | typeof b2d.joint.JOINT_TYPE_WELD | typeof b2d.joint.JOINT_TYPE_WHEEL;
487
+ type LimitState = typeof b2d.joint.LIMIT_STATE_AT_LOWER | typeof b2d.joint.LIMIT_STATE_AT_UPPER | typeof b2d.joint.LIMIT_STATE_EQUAL | typeof b2d.joint.LIMIT_STATE_INACTIVE;
488
488
  /**
489
489
  * Distance joint type.
490
490
  */
@@ -561,7 +561,7 @@ declare global {
561
561
  * @param definition - optional joint definition
562
562
  * @returns created joint
563
563
  */
564
- function create_distance(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.distance_definition): Opaque<"b2Joint">;
564
+ function create_distance(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.DistanceDefinition): Opaque<"b2Joint">;
565
565
  /**
566
566
  * Create a filter joint.
567
567
  *
@@ -570,7 +570,7 @@ declare global {
570
570
  * @param definition - optional definition table
571
571
  * @returns created joint
572
572
  */
573
- function create_filter(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.filter_definition): Opaque<"b2Joint">;
573
+ function create_filter(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.FilterDefinition): Opaque<"b2Joint">;
574
574
  /**
575
575
  * Create a friction joint.
576
576
  *
@@ -579,7 +579,7 @@ declare global {
579
579
  * @param definition - optional joint definition
580
580
  * @returns created joint
581
581
  */
582
- function create_friction(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.friction_definition): Opaque<"b2Joint">;
582
+ function create_friction(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.FrictionDefinition): Opaque<"b2Joint">;
583
583
  /**
584
584
  * Create a gear joint.
585
585
  *
@@ -588,7 +588,7 @@ declare global {
588
588
  * @param definition - optional joint definition
589
589
  * @returns created joint
590
590
  */
591
- function create_gear(joint1: Opaque<"b2Joint">, joint2: Opaque<"b2Joint">, definition?: b2d.joint.gear_definition): Opaque<"b2Joint">;
591
+ function create_gear(joint1: Opaque<"b2Joint">, joint2: Opaque<"b2Joint">, definition?: b2d.joint.GearDefinition): Opaque<"b2Joint">;
592
592
  /**
593
593
  * Create a motor joint.
594
594
  *
@@ -597,7 +597,7 @@ declare global {
597
597
  * @param definition - optional joint definition
598
598
  * @returns created joint
599
599
  */
600
- function create_motor(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.motor_definition): Opaque<"b2Joint">;
600
+ function create_motor(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.MotorDefinition): Opaque<"b2Joint">;
601
601
  /**
602
602
  * Create a mouse joint.
603
603
  *
@@ -606,7 +606,7 @@ declare global {
606
606
  * @param definition - optional joint definition
607
607
  * @returns created joint
608
608
  */
609
- function create_mouse(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.mouse_definition): Opaque<"b2Joint">;
609
+ function create_mouse(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.MouseDefinition): Opaque<"b2Joint">;
610
610
  /**
611
611
  * Create a prismatic joint.
612
612
  *
@@ -615,7 +615,7 @@ declare global {
615
615
  * @param definition - optional joint definition
616
616
  * @returns created joint
617
617
  */
618
- function create_prismatic(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.prismatic_definition): Opaque<"b2Joint">;
618
+ function create_prismatic(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.PrismaticDefinition): Opaque<"b2Joint">;
619
619
  /**
620
620
  * Create a pulley joint.
621
621
  *
@@ -624,7 +624,7 @@ declare global {
624
624
  * @param definition - optional joint definition
625
625
  * @returns created joint
626
626
  */
627
- function create_pulley(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.pulley_definition): Opaque<"b2Joint">;
627
+ function create_pulley(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.PulleyDefinition): Opaque<"b2Joint">;
628
628
  /**
629
629
  * Create a revolute joint.
630
630
  *
@@ -633,7 +633,7 @@ declare global {
633
633
  * @param definition - optional joint definition
634
634
  * @returns created joint
635
635
  */
636
- function create_revolute(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.revolute_definition): Opaque<"b2Joint">;
636
+ function create_revolute(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.RevoluteDefinition): Opaque<"b2Joint">;
637
637
  /**
638
638
  * Create a rope joint.
639
639
  *
@@ -642,7 +642,7 @@ declare global {
642
642
  * @param definition - optional joint definition
643
643
  * @returns created joint
644
644
  */
645
- function create_rope(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.rope_definition): Opaque<"b2Joint">;
645
+ function create_rope(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.RopeDefinition): Opaque<"b2Joint">;
646
646
  /**
647
647
  * Create a weld joint.
648
648
  *
@@ -651,7 +651,7 @@ declare global {
651
651
  * @param definition - optional joint definition
652
652
  * @returns created joint
653
653
  */
654
- function create_weld(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.weld_definition): Opaque<"b2Joint">;
654
+ function create_weld(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.WeldDefinition): Opaque<"b2Joint">;
655
655
  /**
656
656
  * Create a wheel joint.
657
657
  *
@@ -660,7 +660,7 @@ declare global {
660
660
  * @param definition - optional joint definition
661
661
  * @returns created joint
662
662
  */
663
- function create_wheel(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.wheel_definition): Opaque<"b2Joint">;
663
+ function create_wheel(body_a: Opaque<"b2Body">, body_b: Opaque<"b2Body">, definition?: b2d.joint.WheelDefinition): Opaque<"b2Joint">;
664
664
  /**
665
665
  * Destroy a joint created by `b2d.joint`.
666
666
  *
@@ -855,7 +855,7 @@ declare global {
855
855
  * @param joint - rope joint
856
856
  * @returns one of the `LIMIT_STATE_*` constants
857
857
  */
858
- function get_limit_state(joint: Opaque<"b2Joint">): b2d.joint.LIMIT_STATE;
858
+ function get_limit_state(joint: Opaque<"b2Joint">): b2d.joint.LimitState;
859
859
  /**
860
860
  * Get weld joint linear damping ratio.
861
861
  *
@@ -1055,7 +1055,7 @@ declare global {
1055
1055
  * @param joint - joint
1056
1056
  * @returns one of the `JOINT_TYPE_*` constants
1057
1057
  */
1058
- function get_type(joint: Opaque<"b2Joint">): b2d.joint.JOINT_TYPE;
1058
+ function get_type(joint: Opaque<"b2Joint">): b2d.joint.JointType;
1059
1059
  /**
1060
1060
  * Get the upper joint limit.
1061
1061
  *
@@ -7,9 +7,9 @@ declare global {
7
7
  * and returned from `b2d.fixture.get_shape`.
8
8
  */
9
9
  namespace b2d.shape {
10
- type b2Shape = Opaque<"b2Shape">;
11
- type definition = { type: b2d.shape.SHAPE_TYPE; radius: number; center?: Vector3 } | { type: b2d.shape.SHAPE_TYPE; radius: number; center1: Vector3; center2: Vector3 } | { type: b2d.shape.SHAPE_TYPE; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: b2d.shape.SHAPE_TYPE; hx: number; hy: number; center?: Vector3; angle?: number } | { type: b2d.shape.SHAPE_TYPE; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 };
12
- type SHAPE_TYPE = typeof b2d.shape.SHAPE_TYPE_BOX | typeof b2d.shape.SHAPE_TYPE_CAPSULE | typeof b2d.shape.SHAPE_TYPE_CHAIN | typeof b2d.shape.SHAPE_TYPE_CIRCLE | typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_GRID | typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_SEGMENT;
10
+ type B2Shape = Opaque<"b2Shape">;
11
+ type Definition = { type: b2d.shape.ShapeType; radius: number; center?: Vector3 } | { type: b2d.shape.ShapeType; radius: number; center1: Vector3; center2: Vector3 } | { type: b2d.shape.ShapeType; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: b2d.shape.ShapeType; hx: number; hy: number; center?: Vector3; angle?: number } | { type: b2d.shape.ShapeType; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 };
12
+ type ShapeType = typeof b2d.shape.SHAPE_TYPE_BOX | typeof b2d.shape.SHAPE_TYPE_CAPSULE | typeof b2d.shape.SHAPE_TYPE_CHAIN | typeof b2d.shape.SHAPE_TYPE_CIRCLE | typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_GRID | typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_SEGMENT;
13
13
  /**
14
14
  * Box shape type alias. Uses the polygon enum value, but indicates the `hx`/`hy` box convenience format.
15
15
  */
@@ -215,7 +215,7 @@ declare global {
215
215
  * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
216
216
  * @returns touching contacts
217
217
  */
218
- function get_contact_data(shape_id: Opaque<"b2Shape">): b2d.contact_data[];
218
+ function get_contact_data(shape_id: Opaque<"b2Shape">): b2d.ContactData[];
219
219
  /**
220
220
  * Get touching contact data for a shape.
221
221
  *
@@ -223,14 +223,14 @@ declare global {
223
223
  * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
224
224
  * @returns touching contacts
225
225
  */
226
- function get_contact_data(body: Opaque<"b2Body">, shape_index: number): b2d.contact_data[];
226
+ function get_contact_data(body: Opaque<"b2Body">, shape_index: number): b2d.ContactData[];
227
227
  /**
228
228
  * Get mass data for a shape.
229
229
  *
230
230
  * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
231
231
  * @returns shape mass data
232
232
  */
233
- function get_mass_data(shape_id: Opaque<"b2Shape">): b2d.mass_data;
233
+ function get_mass_data(shape_id: Opaque<"b2Shape">): b2d.MassData;
234
234
  /**
235
235
  * Get mass data for a shape.
236
236
  *
@@ -238,7 +238,7 @@ declare global {
238
238
  * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
239
239
  * @returns shape mass data
240
240
  */
241
- function get_mass_data(body: Opaque<"b2Body">, shape_index: number): b2d.mass_data;
241
+ function get_mass_data(body: Opaque<"b2Body">, shape_index: number): b2d.MassData;
242
242
  /**
243
243
  * Get shape material id.
244
244
  *
@@ -275,7 +275,7 @@ declare global {
275
275
  * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
276
276
  * @returns overlapping shapes
277
277
  */
278
- function get_sensor_overlaps(shape_id: Opaque<"b2Shape">): b2d.shape_info[];
278
+ function get_sensor_overlaps(shape_id: Opaque<"b2Shape">): b2d.ShapeInfo[];
279
279
  /**
280
280
  * Get sensor overlaps.
281
281
  *
@@ -283,14 +283,14 @@ declare global {
283
283
  * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
284
284
  * @returns overlapping shapes
285
285
  */
286
- function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): b2d.shape_info[];
286
+ function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): b2d.ShapeInfo[];
287
287
  /**
288
288
  * Get a shape's geometry.
289
289
  *
290
290
  * @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
291
291
  * @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
292
292
  */
293
- function get_shape(shape_id: Opaque<"b2Shape">): b2d.shape.definition;
293
+ function get_shape(shape_id: Opaque<"b2Shape">): b2d.shape.Definition;
294
294
  /**
295
295
  * Get a shape's geometry.
296
296
  *
@@ -298,7 +298,7 @@ declare global {
298
298
  * @param shape_index - The shape's position on that body, in the order `b2d.body.get_shapes` lists them. **⚠️ 1-based; passed to Defold unchanged.**
299
299
  * @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
300
300
  */
301
- function get_shape(body: Opaque<"b2Body">, shape_index: number): b2d.shape.definition;
301
+ function get_shape(body: Opaque<"b2Body">, shape_index: number): b2d.shape.Definition;
302
302
  /**
303
303
  * Get the world owning a shape.
304
304
  *
@@ -338,7 +338,7 @@ declare global {
338
338
  * @param max_fraction - optional maximum translation fraction, defaults to 1
339
339
  * @returns cast result, or `nil`
340
340
  */
341
- function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.shape_cast_output | undefined;
341
+ function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.ShapeCastOutput | undefined;
342
342
  /**
343
343
  * Ray cast a shape directly.
344
344
  *
@@ -349,7 +349,7 @@ declare global {
349
349
  * @param max_fraction - optional maximum translation fraction, defaults to 1
350
350
  * @returns cast result, or `nil`
351
351
  */
352
- function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.shape_cast_output | undefined;
352
+ function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.ShapeCastOutput | undefined;
353
353
  /**
354
354
  * Set shape material id.
355
355
  *
@@ -16,7 +16,7 @@ declare global {
16
16
  * @param filter - optional query filter
17
17
  * @returns travel fraction before collision
18
18
  */
19
- function cast_mover(world: Opaque<"b2World">, capsule: b2d.mover_capsule, translation: Vector3, filter?: b2d.query_filter): number;
19
+ function cast_mover(world: Opaque<"b2World">, capsule: b2d.MoverCapsule, translation: Vector3, filter?: b2d.QueryFilter): number;
20
20
  /**
21
21
  * Cast a ray.
22
22
  *
@@ -26,7 +26,7 @@ declare global {
26
26
  * @param filter - optional query filter
27
27
  * @param max_results - optional maximum result count
28
28
  */
29
- function cast_ray(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.fixture_cast_hit[], b2d.tree_stats]>;
29
+ function cast_ray<Backend extends "v2" = "v2">(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.FixtureCastHit[], b2d.TreeStats]>;
30
30
  /**
31
31
  * The translation is the ray displacement from `origin`. Result order is not
32
32
  * guaranteed by Box2D.
@@ -37,7 +37,7 @@ declare global {
37
37
  * @param filter - optional query filter
38
38
  * @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
39
39
  */
40
- function cast_ray(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.shape_cast_hit[], b2d.tree_stats]>;
40
+ function cast_ray<Backend extends "v3">(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.ShapeCastHit[], b2d.TreeStats]>;
41
41
  /**
42
42
  * Cast a ray and return the closest hit.
43
43
  *
@@ -47,7 +47,7 @@ declare global {
47
47
  * @param filter - optional query filter
48
48
  * @returns closest hit, or `nil`
49
49
  */
50
- function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter): b2d.fixture_cast_hit | undefined;
50
+ function cast_ray_closest<Backend extends "v2" = "v2">(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.QueryFilter): b2d.FixtureCastHit | undefined;
51
51
  /**
52
52
  * The translation is the ray displacement from `origin`.
53
53
  *
@@ -57,7 +57,7 @@ declare global {
57
57
  * @param filter - optional query filter
58
58
  * @returns closest hit, or `nil`
59
59
  */
60
- function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter): b2d.shape_cast_hit | undefined;
60
+ function cast_ray_closest<Backend extends "v3">(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.QueryFilter): b2d.ShapeCastHit | undefined;
61
61
  /**
62
62
  * Uses Box2D v2 time-of-impact for fixture child shapes that support distance proxies.
63
63
  * Grid fixture children are skipped.
@@ -68,7 +68,7 @@ declare global {
68
68
  * @param filter - optional query filter
69
69
  * @param max_results - optional maximum result count
70
70
  */
71
- function cast_shape(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, translation: Vector3, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.fixture_cast_hit[], b2d.tree_stats]>;
71
+ function cast_shape<Backend extends "v2" = "v2">(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, translation: Vector3, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.FixtureCastHit[], b2d.TreeStats]>;
72
72
  /**
73
73
  * The translation is the shape displacement.
74
74
  *
@@ -78,7 +78,7 @@ declare global {
78
78
  * @param filter - optional query filter
79
79
  * @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
80
80
  */
81
- function cast_shape(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, translation: Vector3, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.shape_cast_hit[], b2d.tree_stats]>;
81
+ function cast_shape<Backend extends "v3">(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, translation: Vector3, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.ShapeCastHit[], b2d.TreeStats]>;
82
82
  /**
83
83
  * Collide a mover capsule against the world.
84
84
  *
@@ -88,7 +88,7 @@ declare global {
88
88
  * @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
89
89
  * @returns collision planes
90
90
  */
91
- function collide_mover(world: Opaque<"b2World">, capsule: b2d.mover_capsule, filter?: b2d.query_filter, max_results?: number): b2d.mover_plane[];
91
+ function collide_mover(world: Opaque<"b2World">, capsule: b2d.MoverCapsule, filter?: b2d.QueryFilter, max_results?: number): b2d.MoverPlane[];
92
92
  /**
93
93
  * Enable or disable continuous collision.
94
94
  *
@@ -123,7 +123,7 @@ declare global {
123
123
  * @param world - world
124
124
  * @param definition - explosion definition
125
125
  */
126
- function explode(world: Opaque<"b2World">, definition: b2d.explosion_definition): void;
126
+ function explode(world: Opaque<"b2World">, definition: b2d.ExplosionDefinition): void;
127
127
  /**
128
128
  * Get the number of awake bodies.
129
129
  *
@@ -137,7 +137,7 @@ declare global {
137
137
  * @param world - world
138
138
  * @returns world counters
139
139
  */
140
- function get_counters(world: Opaque<"b2World">): b2d.world_counters;
140
+ function get_counters(world: Opaque<"b2World">): b2d.WorldCounters;
141
141
  /**
142
142
  * Get world gravity.
143
143
  *
@@ -165,7 +165,7 @@ declare global {
165
165
  * @param world - world
166
166
  * @returns world profiling data
167
167
  */
168
- function get_profile(world: Opaque<"b2World">): b2d.world_profile;
168
+ function get_profile(world: Opaque<"b2World">): b2d.WorldProfile;
169
169
  /**
170
170
  * Get the restitution threshold.
171
171
  *
@@ -220,7 +220,7 @@ declare global {
220
220
  * - `fixtures` — overlapping fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
221
221
  * - `stats` — broad-phase query statistics
222
222
  */
223
- function overlap_aabb(world: Opaque<"b2World">, aabb: b2d.aabb, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.fixture_info[], b2d.tree_stats]>;
223
+ function overlap_aabb<Backend extends "v2" = "v2">(world: Opaque<"b2World">, aabb: b2d.Aabb, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.FixtureInfo[], b2d.TreeStats]>;
224
224
  /**
225
225
  * Find shapes overlapping an AABB.
226
226
  *
@@ -229,7 +229,7 @@ declare global {
229
229
  * @param filter - optional query filter
230
230
  * @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
231
231
  */
232
- function overlap_aabb(world: Opaque<"b2World">, aabb: b2d.aabb, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.shape_info[], b2d.tree_stats]>;
232
+ function overlap_aabb<Backend extends "v3">(world: Opaque<"b2World">, aabb: b2d.Aabb, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.ShapeInfo[], b2d.TreeStats]>;
233
233
  /**
234
234
  * Overlap a shape.
235
235
  *
@@ -241,7 +241,7 @@ declare global {
241
241
  * - `fixtures` — overlapping fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
242
242
  * - `stats` — broad-phase query statistics
243
243
  */
244
- function overlap_shape(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.fixture_info[], b2d.tree_stats]>;
244
+ function overlap_shape<Backend extends "v2" = "v2">(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.FixtureInfo[], b2d.TreeStats]>;
245
245
  /**
246
246
  * Find shapes overlapping a shape proxy.
247
247
  *
@@ -250,7 +250,7 @@ declare global {
250
250
  * @param filter - optional query filter
251
251
  * @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
252
252
  */
253
- function overlap_shape(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.shape_info[], b2d.tree_stats]>;
253
+ function overlap_shape<Backend extends "v3">(world: Opaque<"b2World">, shape: { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; hx: number; hy: number; center?: Vector3; angle?: number } | { type: typeof b2d.shape.SHAPE_TYPE_POLYGON | typeof b2d.shape.SHAPE_TYPE_BOX; vertices: Vector3[] } | { type: typeof b2d.shape.SHAPE_TYPE_CIRCLE; radius: number; center?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CAPSULE; radius: number; center1: Vector3; center2: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_EDGE | typeof b2d.shape.SHAPE_TYPE_SEGMENT; v1: Vector3; v2: Vector3; v0?: Vector3; v3?: Vector3 } | { type: typeof b2d.shape.SHAPE_TYPE_CHAIN; vertices: Vector3[]; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 }, filter?: b2d.QueryFilter, max_results?: number): LuaMultiReturn<[b2d.ShapeInfo[], b2d.TreeStats]>;
254
254
  /**
255
255
  * Rebuild the static broad-phase tree.
256
256
  *