@defold-typescript/types 0.39.0 → 0.41.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.
- package/api-availability.json +4024 -716
- package/api-migrations.json +27 -0
- package/api-signatures.json +18118 -10264
- package/api-targets.json +448 -11
- package/examples/translations.json +619 -148
- package/fixtures/messages_doc.json +96 -0
- package/generated/b2d.d.ts +680 -4
- package/generated/b2d_body.d.ts +29 -103
- package/generated/b2d_chain.d.ts +5 -6
- package/generated/b2d_fixture.d.ts +34 -38
- package/generated/b2d_joint.d.ts +503 -25
- package/generated/b2d_shape.d.ts +199 -14
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +33 -29
- package/generated/builtin-messages.d.ts +7 -1
- package/generated/bullet3d.d.ts +91 -0
- package/generated/bullet3d_collision_object.d.ts +433 -0
- package/generated/bullet3d_constraint.d.ts +818 -0
- package/generated/bullet3d_rigid_body.d.ts +429 -0
- package/generated/bullet3d_shape.d.ts +123 -0
- package/generated/bullet3d_world.d.ts +492 -0
- package/generated/camera.d.ts +31 -34
- package/generated/collectionfactory.d.ts +26 -27
- package/generated/collectionproxy.d.ts +22 -6
- package/generated/compute.d.ts +12 -238
- package/generated/crash.d.ts +24 -10
- package/generated/editor-vm/http.d.ts +90 -7
- package/generated/editor-vm/image.d.ts +7 -7
- package/generated/editor-vm/json.d.ts +11 -0
- package/generated/editor-vm/localization.d.ts +7 -7
- package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
- package/generated/editor-vm/zip.d.ts +28 -0
- package/generated/editor.d.ts +1496 -430
- package/generated/factory.d.ts +21 -25
- package/generated/font.d.ts +64 -22
- package/generated/go.d.ts +243 -186
- package/generated/graphics.d.ts +374 -84
- package/generated/gui.d.ts +282 -492
- package/generated/html5.d.ts +5 -3
- package/generated/http.d.ts +31 -36
- package/generated/image.d.ts +127 -85
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +8 -0
- package/generated/kinds/render-script.d.ts +8 -0
- package/generated/kinds/script.d.ts +8 -0
- package/generated/label.d.ts +77 -7
- package/generated/liveupdate.d.ts +13 -10
- package/generated/material.d.ts +312 -360
- package/generated/model.d.ts +72 -42
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +378 -144
- package/generated/profiler.d.ts +14 -24
- package/generated/render.d.ts +294 -297
- package/generated/resource.d.ts +753 -641
- package/generated/socket.d.ts +131 -134
- package/generated/sound.d.ts +65 -34
- package/generated/sprite.d.ts +39 -17
- package/generated/sys.d.ts +237 -182
- package/generated/tilemap.d.ts +21 -16
- package/generated/timer.d.ts +34 -21
- package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
- package/generated/versions/defold-1.12.4/buffer.d.ts +18 -17
- package/generated/versions/defold-1.12.4/camera.d.ts +23 -23
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +21 -19
- package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
- package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
- package/generated/versions/defold-1.12.4/go.d.ts +15 -17
- package/generated/versions/defold-1.12.4/gui.d.ts +111 -193
- package/generated/versions/defold-1.12.4/html5.d.ts +4 -2
- package/generated/versions/defold-1.12.4/http.d.ts +4 -15
- package/generated/versions/defold-1.12.4/image.d.ts +38 -46
- package/generated/versions/defold-1.12.4/index.d.ts +2 -0
- package/generated/versions/defold-1.12.4/json.d.ts +10 -6
- package/generated/versions/defold-1.12.4/label.d.ts +2 -3
- package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
- package/generated/versions/defold-1.12.4/model.d.ts +34 -13
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +82 -78
- package/generated/versions/defold-1.12.4/profiler.d.ts +3 -6
- package/generated/versions/defold-1.12.4/render.d.ts +160 -132
- package/generated/versions/defold-1.12.4/resource.d.ts +212 -209
- package/generated/versions/defold-1.12.4/socket.d.ts +45 -61
- package/generated/versions/defold-1.12.4/sound.d.ts +11 -11
- package/generated/versions/defold-1.12.4/sprite.d.ts +24 -6
- package/generated/versions/defold-1.12.4/sys.d.ts +45 -68
- package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
- package/generated/versions/defold-1.12.4/vmath.d.ts +5 -26
- package/generated/versions/defold-1.12.4/window.d.ts +1 -16
- package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
- package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
- package/generated/versions/defold-1.13.0/b2d_shape.d.ts +188 -5
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +18 -17
- package/generated/versions/defold-1.13.0/camera.d.ts +27 -27
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +21 -19
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +1 -70
- package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
- package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
- package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
- package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
- package/generated/versions/defold-1.13.0/go.d.ts +15 -17
- package/generated/versions/defold-1.13.0/graphics.d.ts +121 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +111 -193
- package/generated/versions/defold-1.13.0/html5.d.ts +4 -2
- package/generated/versions/defold-1.13.0/http.d.ts +4 -15
- package/generated/versions/defold-1.13.0/image.d.ts +38 -46
- package/generated/versions/defold-1.13.0/index.d.ts +2 -0
- package/generated/versions/defold-1.13.0/json.d.ts +10 -6
- package/generated/versions/defold-1.13.0/label.d.ts +2 -3
- package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
- package/generated/versions/defold-1.13.0/material.d.ts +69 -107
- package/generated/versions/defold-1.13.0/model.d.ts +34 -13
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +82 -78
- package/generated/versions/defold-1.13.0/profiler.d.ts +3 -6
- package/generated/versions/defold-1.13.0/render.d.ts +160 -132
- package/generated/versions/defold-1.13.0/resource.d.ts +217 -210
- package/generated/versions/defold-1.13.0/socket.d.ts +45 -61
- package/generated/versions/defold-1.13.0/sound.d.ts +11 -11
- package/generated/versions/defold-1.13.0/sprite.d.ts +24 -6
- package/generated/versions/defold-1.13.0/sys.d.ts +45 -68
- package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
- package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
- package/generated/versions/defold-1.13.0/vmath.d.ts +5 -26
- package/generated/versions/defold-1.13.0/window.d.ts +1 -16
- package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
- package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
- package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
- package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
- package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
- package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
- package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
- package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
- package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
- package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
- package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
- package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
- package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
- package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
- package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
- package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
- package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
- package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
- package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
- package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
- package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
- package/generated/versions/defold-1.13.1/font.d.ts +81 -0
- package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
- package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
- package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
- package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
- package/generated/versions/defold-1.13.1/http.d.ts +77 -0
- package/generated/versions/defold-1.13.1/image.d.ts +131 -0
- package/generated/versions/defold-1.13.1/index.d.ts +57 -0
- package/generated/versions/defold-1.13.1/json.d.ts +80 -0
- package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
- package/generated/versions/defold-1.13.1/label.d.ts +93 -0
- package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
- package/generated/versions/defold-1.13.1/material.d.ts +408 -0
- package/generated/versions/defold-1.13.1/model.d.ts +272 -0
- package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
- package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
- package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
- package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
- package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
- package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
- package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
- package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
- package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
- package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
- package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
- package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
- package/generated/versions/defold-1.13.1/types.d.ts +61 -0
- package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
- package/generated/versions/defold-1.13.1/window.d.ts +183 -0
- package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
- package/generated/vmath.d.ts +6 -26
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +8 -0
- package/package.json +13 -2
- package/scripts/example-store-io.ts +12 -1
- package/scripts/extension-goldens.ts +1 -0
- package/scripts/fidelity-baseline.json +146 -46
- package/scripts/generate-api-availability.ts +90 -12
- package/scripts/generate-api-signatures.ts +14 -3
- package/scripts/import-defold-release.ts +85 -24
- package/scripts/prose-constants.ts +157 -0
- package/scripts/regen.ts +396 -78
- package/scripts/shared-handle-methods.ts +53 -0
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +16 -5
- package/src/api-availability.ts +0 -0
- package/src/api-doc.ts +201 -3
- package/src/api-identity.ts +252 -0
- package/src/component-properties.d.ts +33 -0
- package/src/core-types.ts +28 -3
- package/src/correction-pins.ts +49 -0
- package/src/custom-messages.d.ts +4 -3
- package/src/doc-comment.ts +139 -23
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2474 -281
- package/src/emit-messages.ts +52 -0
- package/src/engine-globals.d.ts +2 -2
- package/src/example-store.ts +125 -14
- package/src/field-correction-coverage.ts +204 -0
- package/src/fnv1a.ts +16 -0
- package/src/go-overloads.d.ts +33 -13
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +39 -2
- package/src/library-index-slot-classifications.ts +332 -0
- package/src/lifecycle.ts +61 -199
- package/src/luals-type-expr.ts +354 -0
- package/src/msg-overloads.d.ts +0 -1
- package/src/param-correction-provenance.ts +64 -0
- package/src/return-correction-provenance.ts +58 -16
- package/src/script-api.ts +3 -1
- package/src/sys-overloads.d.ts +48 -0
- package/src/vmath-overloads.d.ts +27 -1
- package/src/window-event-guard.d.ts +6 -9
- package/url-parameters.json +1 -2
package/generated/b2d_shape.d.ts
CHANGED
|
@@ -8,8 +8,10 @@ declare global {
|
|
|
8
8
|
*/
|
|
9
9
|
namespace b2d.shape {
|
|
10
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;
|
|
11
13
|
/**
|
|
12
|
-
* Uses the polygon enum value, but indicates the `hx`/`hy` box convenience format.
|
|
14
|
+
* Box shape type alias. Uses the polygon enum value, but indicates the `hx`/`hy` box convenience format.
|
|
13
15
|
*/
|
|
14
16
|
const SHAPE_TYPE_BOX: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_BOX" };
|
|
15
17
|
/**
|
|
@@ -25,7 +27,7 @@ declare global {
|
|
|
25
27
|
*/
|
|
26
28
|
const SHAPE_TYPE_CIRCLE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_CIRCLE" };
|
|
27
29
|
/**
|
|
28
|
-
* Edge shape type.
|
|
30
|
+
* Edge shape type alias. Compatibility alias for `b2d.shape.SHAPE_TYPE_SEGMENT`.
|
|
29
31
|
*/
|
|
30
32
|
const SHAPE_TYPE_EDGE: number & { readonly __brand: "b2d.shape.SHAPE_TYPE_EDGE" };
|
|
31
33
|
/**
|
|
@@ -47,6 +49,14 @@ declare global {
|
|
|
47
49
|
* @returns true if contact events are enabled
|
|
48
50
|
*/
|
|
49
51
|
function are_contact_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if contact events are enabled for a shape.
|
|
54
|
+
*
|
|
55
|
+
* @param body - The body that owns the shape.
|
|
56
|
+
* @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.**
|
|
57
|
+
* @returns true if contact events are enabled
|
|
58
|
+
*/
|
|
59
|
+
function are_contact_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
50
60
|
/**
|
|
51
61
|
* Check if hit events are enabled for a shape.
|
|
52
62
|
*
|
|
@@ -54,6 +64,14 @@ declare global {
|
|
|
54
64
|
* @returns true if hit events are enabled
|
|
55
65
|
*/
|
|
56
66
|
function are_hit_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Check if hit events are enabled for a shape.
|
|
69
|
+
*
|
|
70
|
+
* @param body - The body that owns the shape.
|
|
71
|
+
* @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.**
|
|
72
|
+
* @returns true if hit events are enabled
|
|
73
|
+
*/
|
|
74
|
+
function are_hit_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
57
75
|
/**
|
|
58
76
|
* Check if pre-solve events are enabled for a shape.
|
|
59
77
|
*
|
|
@@ -61,6 +79,14 @@ declare global {
|
|
|
61
79
|
* @returns true if pre-solve events are enabled
|
|
62
80
|
*/
|
|
63
81
|
function are_pre_solve_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Check if pre-solve events are enabled for a shape.
|
|
84
|
+
*
|
|
85
|
+
* @param body - The body that owns the shape.
|
|
86
|
+
* @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.**
|
|
87
|
+
* @returns true if pre-solve events are enabled
|
|
88
|
+
*/
|
|
89
|
+
function are_pre_solve_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
64
90
|
/**
|
|
65
91
|
* Check if sensor events are enabled for a shape.
|
|
66
92
|
*
|
|
@@ -68,6 +94,14 @@ declare global {
|
|
|
68
94
|
* @returns true if sensor events are enabled
|
|
69
95
|
*/
|
|
70
96
|
function are_sensor_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Check if sensor events are enabled for a shape.
|
|
99
|
+
*
|
|
100
|
+
* @param body - The body that owns the shape.
|
|
101
|
+
* @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.**
|
|
102
|
+
* @returns true if sensor events are enabled
|
|
103
|
+
*/
|
|
104
|
+
function are_sensor_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
71
105
|
/**
|
|
72
106
|
* Enable or disable contact events for a shape.
|
|
73
107
|
*
|
|
@@ -75,6 +109,14 @@ declare global {
|
|
|
75
109
|
* @param enable - true to enable contact events
|
|
76
110
|
*/
|
|
77
111
|
function enable_contact_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
112
|
+
/**
|
|
113
|
+
* Enable or disable contact events for a shape.
|
|
114
|
+
*
|
|
115
|
+
* @param body - The body that owns the shape.
|
|
116
|
+
* @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.**
|
|
117
|
+
* @param enable - true to enable contact events
|
|
118
|
+
*/
|
|
119
|
+
function enable_contact_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
78
120
|
/**
|
|
79
121
|
* Enable or disable hit events for a shape.
|
|
80
122
|
*
|
|
@@ -82,6 +124,14 @@ declare global {
|
|
|
82
124
|
* @param enable - true to enable hit events
|
|
83
125
|
*/
|
|
84
126
|
function enable_hit_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
127
|
+
/**
|
|
128
|
+
* Enable or disable hit events for a shape.
|
|
129
|
+
*
|
|
130
|
+
* @param body - The body that owns the shape.
|
|
131
|
+
* @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.**
|
|
132
|
+
* @param enable - true to enable hit events
|
|
133
|
+
*/
|
|
134
|
+
function enable_hit_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
85
135
|
/**
|
|
86
136
|
* Enable or disable pre-solve events for a shape.
|
|
87
137
|
*
|
|
@@ -89,6 +139,14 @@ declare global {
|
|
|
89
139
|
* @param enable - true to enable pre-solve events
|
|
90
140
|
*/
|
|
91
141
|
function enable_pre_solve_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
142
|
+
/**
|
|
143
|
+
* Enable or disable pre-solve events for a shape.
|
|
144
|
+
*
|
|
145
|
+
* @param body - The body that owns the shape.
|
|
146
|
+
* @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.**
|
|
147
|
+
* @param enable - true to enable pre-solve events
|
|
148
|
+
*/
|
|
149
|
+
function enable_pre_solve_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
92
150
|
/**
|
|
93
151
|
* Enable or disable sensor events for a shape.
|
|
94
152
|
*
|
|
@@ -96,6 +154,14 @@ declare global {
|
|
|
96
154
|
* @param enable - true to enable sensor events
|
|
97
155
|
*/
|
|
98
156
|
function enable_sensor_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
157
|
+
/**
|
|
158
|
+
* Enable or disable sensor events for a shape.
|
|
159
|
+
*
|
|
160
|
+
* @param body - The body that owns the shape.
|
|
161
|
+
* @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.**
|
|
162
|
+
* @param enable - true to enable sensor events
|
|
163
|
+
*/
|
|
164
|
+
function enable_sensor_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
99
165
|
/**
|
|
100
166
|
* Get the body owning a shape.
|
|
101
167
|
*
|
|
@@ -103,6 +169,14 @@ declare global {
|
|
|
103
169
|
* @returns owning body
|
|
104
170
|
*/
|
|
105
171
|
function get_body(shape_id: Opaque<"b2Shape">): Opaque<"b2Body">;
|
|
172
|
+
/**
|
|
173
|
+
* Get the body owning a shape.
|
|
174
|
+
*
|
|
175
|
+
* @param body - The body that owns the shape.
|
|
176
|
+
* @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.**
|
|
177
|
+
* @returns owning body
|
|
178
|
+
*/
|
|
179
|
+
function get_body(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2Body">;
|
|
106
180
|
/**
|
|
107
181
|
* Get the closest point on a shape.
|
|
108
182
|
*
|
|
@@ -111,6 +185,15 @@ declare global {
|
|
|
111
185
|
* @returns closest world point on the shape
|
|
112
186
|
*/
|
|
113
187
|
function get_closest_point(shape_id: Opaque<"b2Shape">, target: Vector3): Vector3;
|
|
188
|
+
/**
|
|
189
|
+
* Get the closest point on a shape.
|
|
190
|
+
*
|
|
191
|
+
* @param body - The body that owns the shape.
|
|
192
|
+
* @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.**
|
|
193
|
+
* @param target - world target point
|
|
194
|
+
* @returns closest world point on the shape
|
|
195
|
+
*/
|
|
196
|
+
function get_closest_point(body: Opaque<"b2Body">, shape_index: number, target: Vector3): Vector3;
|
|
114
197
|
/**
|
|
115
198
|
* Get shape contact capacity.
|
|
116
199
|
*
|
|
@@ -118,20 +201,44 @@ declare global {
|
|
|
118
201
|
* @returns maximum contact data count
|
|
119
202
|
*/
|
|
120
203
|
function get_contact_capacity(shape_id: Opaque<"b2Shape">): number;
|
|
204
|
+
/**
|
|
205
|
+
* Get shape contact capacity.
|
|
206
|
+
*
|
|
207
|
+
* @param body - The body that owns the shape.
|
|
208
|
+
* @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.**
|
|
209
|
+
* @returns maximum contact data count
|
|
210
|
+
*/
|
|
211
|
+
function get_contact_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
121
212
|
/**
|
|
122
213
|
* Get touching contact data for a shape.
|
|
123
214
|
*
|
|
124
215
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
125
|
-
* @returns
|
|
216
|
+
* @returns touching contacts
|
|
126
217
|
*/
|
|
127
|
-
function get_contact_data(shape_id: Opaque<"b2Shape">):
|
|
218
|
+
function get_contact_data(shape_id: Opaque<"b2Shape">): b2d.contact_data[];
|
|
219
|
+
/**
|
|
220
|
+
* Get touching contact data for a shape.
|
|
221
|
+
*
|
|
222
|
+
* @param body - The body that owns the shape.
|
|
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
|
+
* @returns touching contacts
|
|
225
|
+
*/
|
|
226
|
+
function get_contact_data(body: Opaque<"b2Body">, shape_index: number): b2d.contact_data[];
|
|
128
227
|
/**
|
|
129
228
|
* Get mass data for a shape.
|
|
130
229
|
*
|
|
131
230
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
132
|
-
* @returns
|
|
231
|
+
* @returns shape mass data
|
|
232
|
+
*/
|
|
233
|
+
function get_mass_data(shape_id: Opaque<"b2Shape">): b2d.mass_data;
|
|
234
|
+
/**
|
|
235
|
+
* Get mass data for a shape.
|
|
236
|
+
*
|
|
237
|
+
* @param body - The body that owns the shape.
|
|
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
|
+
* @returns shape mass data
|
|
133
240
|
*/
|
|
134
|
-
function get_mass_data(
|
|
241
|
+
function get_mass_data(body: Opaque<"b2Body">, shape_index: number): b2d.mass_data;
|
|
135
242
|
/**
|
|
136
243
|
* Get shape material id.
|
|
137
244
|
*
|
|
@@ -139,6 +246,14 @@ declare global {
|
|
|
139
246
|
* @returns shape material id
|
|
140
247
|
*/
|
|
141
248
|
function get_material(shape_id: Opaque<"b2Shape">): number;
|
|
249
|
+
/**
|
|
250
|
+
* Get shape material id.
|
|
251
|
+
*
|
|
252
|
+
* @param body - The body that owns the shape.
|
|
253
|
+
* @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.**
|
|
254
|
+
* @returns shape material id
|
|
255
|
+
*/
|
|
256
|
+
function get_material(body: Opaque<"b2Body">, shape_index: number): number;
|
|
142
257
|
/**
|
|
143
258
|
* Get sensor overlap capacity.
|
|
144
259
|
*
|
|
@@ -146,20 +261,44 @@ declare global {
|
|
|
146
261
|
* @returns maximum sensor overlap count
|
|
147
262
|
*/
|
|
148
263
|
function get_sensor_capacity(shape_id: Opaque<"b2Shape">): number;
|
|
264
|
+
/**
|
|
265
|
+
* Get sensor overlap capacity.
|
|
266
|
+
*
|
|
267
|
+
* @param body - The body that owns the shape.
|
|
268
|
+
* @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.**
|
|
269
|
+
* @returns maximum sensor overlap count
|
|
270
|
+
*/
|
|
271
|
+
function get_sensor_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
149
272
|
/**
|
|
150
273
|
* Get sensor overlaps.
|
|
151
274
|
*
|
|
152
275
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
153
|
-
* @returns
|
|
276
|
+
* @returns overlapping shapes
|
|
277
|
+
*/
|
|
278
|
+
function get_sensor_overlaps(shape_id: Opaque<"b2Shape">): b2d.shape_info[];
|
|
279
|
+
/**
|
|
280
|
+
* Get sensor overlaps.
|
|
281
|
+
*
|
|
282
|
+
* @param body - The body that owns the shape.
|
|
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
|
+
* @returns overlapping shapes
|
|
154
285
|
*/
|
|
155
|
-
function get_sensor_overlaps(
|
|
286
|
+
function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): b2d.shape_info[];
|
|
156
287
|
/**
|
|
157
288
|
* Get a shape's geometry.
|
|
158
289
|
*
|
|
159
290
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
160
291
|
* @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
161
292
|
*/
|
|
162
|
-
function get_shape(shape_id: Opaque<"b2Shape">):
|
|
293
|
+
function get_shape(shape_id: Opaque<"b2Shape">): b2d.shape.definition;
|
|
294
|
+
/**
|
|
295
|
+
* Get a shape's geometry.
|
|
296
|
+
*
|
|
297
|
+
* @param body - The body that owns the shape.
|
|
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
|
+
* @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
300
|
+
*/
|
|
301
|
+
function get_shape(body: Opaque<"b2Body">, shape_index: number): b2d.shape.definition;
|
|
163
302
|
/**
|
|
164
303
|
* Get the world owning a shape.
|
|
165
304
|
*
|
|
@@ -167,6 +306,14 @@ declare global {
|
|
|
167
306
|
* @returns owning world
|
|
168
307
|
*/
|
|
169
308
|
function get_world(shape_id: Opaque<"b2Shape">): Opaque<"b2World">;
|
|
309
|
+
/**
|
|
310
|
+
* Get the world owning a shape.
|
|
311
|
+
*
|
|
312
|
+
* @param body - The body that owns the shape.
|
|
313
|
+
* @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.**
|
|
314
|
+
* @returns owning world
|
|
315
|
+
*/
|
|
316
|
+
function get_world(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2World">;
|
|
170
317
|
/**
|
|
171
318
|
* Validate a shape handle.
|
|
172
319
|
*
|
|
@@ -174,6 +321,14 @@ declare global {
|
|
|
174
321
|
* @returns true if the shape handle still refers to a live Box2D shape
|
|
175
322
|
*/
|
|
176
323
|
function is_valid(shape_id: Opaque<"b2Shape">): boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Validate a shape handle.
|
|
326
|
+
*
|
|
327
|
+
* @param body - The body that owns the shape.
|
|
328
|
+
* @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.**
|
|
329
|
+
* @returns true if the shape handle still refers to a live Box2D shape
|
|
330
|
+
*/
|
|
331
|
+
function is_valid(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
177
332
|
/**
|
|
178
333
|
* Ray cast a shape directly.
|
|
179
334
|
*
|
|
@@ -181,9 +336,20 @@ declare global {
|
|
|
181
336
|
* @param origin - world ray origin
|
|
182
337
|
* @param translation - world ray translation
|
|
183
338
|
* @param max_fraction - optional maximum translation fraction, defaults to 1
|
|
184
|
-
* @returns
|
|
339
|
+
* @returns cast result, or `nil`
|
|
340
|
+
*/
|
|
341
|
+
function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.shape_cast_output | undefined;
|
|
342
|
+
/**
|
|
343
|
+
* Ray cast a shape directly.
|
|
344
|
+
*
|
|
345
|
+
* @param body - The body that owns the shape.
|
|
346
|
+
* @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.**
|
|
347
|
+
* @param origin - world ray origin
|
|
348
|
+
* @param translation - world ray translation
|
|
349
|
+
* @param max_fraction - optional maximum translation fraction, defaults to 1
|
|
350
|
+
* @returns cast result, or `nil`
|
|
185
351
|
*/
|
|
186
|
-
function ray_cast(
|
|
352
|
+
function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.shape_cast_output | undefined;
|
|
187
353
|
/**
|
|
188
354
|
* Set shape material id.
|
|
189
355
|
*
|
|
@@ -191,6 +357,14 @@ declare global {
|
|
|
191
357
|
* @param material - shape material id
|
|
192
358
|
*/
|
|
193
359
|
function set_material(shape_id: Opaque<"b2Shape">, material: number): void;
|
|
360
|
+
/**
|
|
361
|
+
* Set shape material id.
|
|
362
|
+
*
|
|
363
|
+
* @param body - The body that owns the shape.
|
|
364
|
+
* @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.**
|
|
365
|
+
* @param material - shape material id
|
|
366
|
+
*/
|
|
367
|
+
function set_material(body: Opaque<"b2Body">, shape_index: number, material: number): void;
|
|
194
368
|
/**
|
|
195
369
|
* This updates the shape geometry using the same table format as
|
|
196
370
|
* `b2d.body.create_shape` and `b2d.shape.get_shape`. The body mass is not
|
|
@@ -204,13 +378,24 @@ declare global {
|
|
|
204
378
|
* const body = b2d.get_body("#collisionobject");
|
|
205
379
|
* if (body !== undefined) {
|
|
206
380
|
* const circle = b2d.shape.get_shape(body, 1);
|
|
207
|
-
*
|
|
208
|
-
* b2d.shape.set_shape(body, 1,
|
|
381
|
+
* const radius = "radius" in circle ? circle.radius : undefined;
|
|
382
|
+
* b2d.shape.set_shape(body, 1, { type: b2d.shape.SHAPE_TYPE_CIRCLE, radius: radius ?? 16, center: vmath.vector3(24, 0, 0) }, true);
|
|
209
383
|
* b2d.shape.set_shape(body, 2, { type: b2d.shape.SHAPE_TYPE_SEGMENT, v1: vmath.vector3(-32, 0, 0), v2: vmath.vector3(32, 0, 0) });
|
|
210
384
|
* }
|
|
211
385
|
* ```
|
|
212
386
|
*/
|
|
213
|
-
function set_shape(shape_id: Opaque<"b2Shape">, definition: { type
|
|
387
|
+
function set_shape(shape_id: Opaque<"b2Shape">, definition: { 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 }, update_mass?: boolean): void;
|
|
388
|
+
/**
|
|
389
|
+
* This updates the shape geometry using the same table format as
|
|
390
|
+
* `b2d.body.create_shape` and `b2d.shape.get_shape`. The body mass is not
|
|
391
|
+
* updated unless `update_mass` is true.
|
|
392
|
+
*
|
|
393
|
+
* @param body - The body that owns the shape.
|
|
394
|
+
* @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.**
|
|
395
|
+
* @param definition - shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
396
|
+
* @param update_mass - true to reset body mass from shapes
|
|
397
|
+
*/
|
|
398
|
+
function set_shape(body: Opaque<"b2Body">, shape_index: number, definition: { 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 }, update_mass?: boolean): void;
|
|
214
399
|
}
|
|
215
400
|
}
|
|
216
401
|
|
package/generated/b2d_world.d.ts
CHANGED
|
@@ -7,27 +7,26 @@ declare global {
|
|
|
7
7
|
*/
|
|
8
8
|
namespace b2d.world {
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
11
|
-
* value is the fraction of `translation` that can be traveled before collision,
|
|
10
|
+
* The return value is the fraction of `translation` that can be traveled before collision,
|
|
12
11
|
* or 1 if there is no hit.
|
|
13
12
|
*
|
|
14
13
|
* @param world - world
|
|
15
|
-
* @param capsule - capsule
|
|
14
|
+
* @param capsule - mover capsule
|
|
16
15
|
* @param translation - capsule displacement
|
|
17
|
-
* @param filter - optional query filter
|
|
16
|
+
* @param filter - optional query filter
|
|
18
17
|
* @returns travel fraction before collision
|
|
19
18
|
*/
|
|
20
|
-
function cast_mover(world: Opaque<"b2World">, capsule:
|
|
19
|
+
function cast_mover(world: Opaque<"b2World">, capsule: b2d.mover_capsule, translation: Vector3, filter?: b2d.query_filter): number;
|
|
21
20
|
/**
|
|
22
21
|
* Cast a ray.
|
|
23
22
|
*
|
|
24
|
-
* @param world - world from
|
|
23
|
+
* @param world - world from b2d.get_world or b2d.body.get_world
|
|
25
24
|
* @param origin - world ray origin
|
|
26
25
|
* @param translation - world ray translation
|
|
27
|
-
* @param filter - optional query filter
|
|
26
|
+
* @param filter - optional query filter
|
|
28
27
|
* @param max_results - optional maximum result count
|
|
29
28
|
*/
|
|
30
|
-
function cast_ray(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter
|
|
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]>;
|
|
31
30
|
/**
|
|
32
31
|
* The translation is the ray displacement from `origin`. Result order is not
|
|
33
32
|
* guaranteed by Box2D.
|
|
@@ -35,63 +34,61 @@ declare global {
|
|
|
35
34
|
* @param world - world
|
|
36
35
|
* @param origin - ray start position
|
|
37
36
|
* @param translation - ray displacement
|
|
38
|
-
* @param filter - optional query filter
|
|
37
|
+
* @param filter - optional query filter
|
|
39
38
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
40
39
|
*/
|
|
41
|
-
function cast_ray(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?:
|
|
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]>;
|
|
42
41
|
/**
|
|
43
42
|
* Cast a ray and return the closest hit.
|
|
44
43
|
*
|
|
45
|
-
* @param world - world from
|
|
44
|
+
* @param world - world from b2d.get_world or b2d.body.get_world
|
|
46
45
|
* @param origin - world ray origin
|
|
47
46
|
* @param translation - world ray translation
|
|
48
|
-
* @param filter - optional query filter
|
|
49
|
-
* @returns hit
|
|
47
|
+
* @param filter - optional query filter
|
|
48
|
+
* @returns closest hit, or `nil`
|
|
50
49
|
*/
|
|
51
|
-
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter
|
|
50
|
+
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter): b2d.fixture_cast_hit | undefined;
|
|
52
51
|
/**
|
|
53
52
|
* The translation is the ray displacement from `origin`.
|
|
54
53
|
*
|
|
55
54
|
* @param world - world
|
|
56
55
|
* @param origin - ray start position
|
|
57
56
|
* @param translation - ray displacement
|
|
58
|
-
* @param filter - optional query filter
|
|
59
|
-
* @returns closest
|
|
57
|
+
* @param filter - optional query filter
|
|
58
|
+
* @returns closest hit, or `nil`
|
|
60
59
|
*/
|
|
61
|
-
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?:
|
|
60
|
+
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter?: b2d.query_filter): b2d.shape_cast_hit | undefined;
|
|
62
61
|
/**
|
|
63
62
|
* Uses Box2D v2 time-of-impact for fixture child shapes that support distance proxies.
|
|
64
63
|
* Grid fixture children are skipped.
|
|
65
64
|
*
|
|
66
|
-
* @param world - world from
|
|
67
|
-
* @param shape -
|
|
65
|
+
* @param world - world from b2d.get_world or b2d.body.get_world
|
|
66
|
+
* @param shape - query shape
|
|
68
67
|
* @param translation - world shape translation
|
|
69
|
-
* @param filter - optional query filter
|
|
68
|
+
* @param filter - optional query filter
|
|
70
69
|
* @param max_results - optional maximum result count
|
|
71
70
|
*/
|
|
72
|
-
function cast_shape(world: Opaque<"b2World">, shape: { type
|
|
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]>;
|
|
73
72
|
/**
|
|
74
|
-
* The
|
|
75
|
-
* as `b2d.body.create_shape`. The translation is the shape displacement.
|
|
73
|
+
* The translation is the shape displacement.
|
|
76
74
|
*
|
|
77
75
|
* @param world - world
|
|
78
|
-
* @param shape - shape
|
|
76
|
+
* @param shape - cast shape
|
|
79
77
|
* @param translation - shape displacement
|
|
80
|
-
* @param filter - optional query filter
|
|
78
|
+
* @param filter - optional query filter
|
|
81
79
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
82
80
|
*/
|
|
83
|
-
function cast_shape(world: Opaque<"b2World">, shape: { type
|
|
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]>;
|
|
84
82
|
/**
|
|
85
|
-
*
|
|
86
|
-
* tables include `shape`, `normal`, `offset`, and `hit`.
|
|
83
|
+
* Collide a mover capsule against the world.
|
|
87
84
|
*
|
|
88
85
|
* @param world - world
|
|
89
|
-
* @param capsule - capsule
|
|
90
|
-
* @param filter - optional query filter
|
|
86
|
+
* @param capsule - mover capsule
|
|
87
|
+
* @param filter - optional query filter
|
|
91
88
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
92
|
-
* @returns
|
|
89
|
+
* @returns collision planes
|
|
93
90
|
*/
|
|
94
|
-
function collide_mover(world: Opaque<"b2World">, capsule:
|
|
91
|
+
function collide_mover(world: Opaque<"b2World">, capsule: b2d.mover_capsule, filter?: b2d.query_filter, max_results?: number): b2d.mover_plane[];
|
|
95
92
|
/**
|
|
96
93
|
* Enable or disable continuous collision.
|
|
97
94
|
*
|
|
@@ -121,13 +118,12 @@ declare global {
|
|
|
121
118
|
*/
|
|
122
119
|
function enable_warm_starting(world: Opaque<"b2World">, enable: boolean): void;
|
|
123
120
|
/**
|
|
124
|
-
*
|
|
125
|
-
* `impulse_per_length`. It may also include `mask_bits`.
|
|
121
|
+
* Apply an explosion impulse.
|
|
126
122
|
*
|
|
127
123
|
* @param world - world
|
|
128
124
|
* @param definition - explosion definition
|
|
129
125
|
*/
|
|
130
|
-
function explode(world: Opaque<"b2World">, definition:
|
|
126
|
+
function explode(world: Opaque<"b2World">, definition: b2d.explosion_definition): void;
|
|
131
127
|
/**
|
|
132
128
|
* Get the number of awake bodies.
|
|
133
129
|
*
|
|
@@ -136,14 +132,12 @@ declare global {
|
|
|
136
132
|
*/
|
|
137
133
|
function get_awake_body_count(world: Opaque<"b2World">): number;
|
|
138
134
|
/**
|
|
139
|
-
*
|
|
140
|
-
* `joint_count`, `island_count`, `stack_used`, `static_tree_height`,
|
|
141
|
-
* `tree_height`, `byte_count`, `task_count`, and `color_counts`.
|
|
135
|
+
* Get world counters.
|
|
142
136
|
*
|
|
143
137
|
* @param world - world
|
|
144
138
|
* @returns world counters
|
|
145
139
|
*/
|
|
146
|
-
function get_counters(world: Opaque<"b2World">):
|
|
140
|
+
function get_counters(world: Opaque<"b2World">): b2d.world_counters;
|
|
147
141
|
/**
|
|
148
142
|
* Get world gravity.
|
|
149
143
|
*
|
|
@@ -166,17 +160,12 @@ declare global {
|
|
|
166
160
|
*/
|
|
167
161
|
function get_maximum_linear_speed(world: Opaque<"b2World">): number;
|
|
168
162
|
/**
|
|
169
|
-
*
|
|
170
|
-
* `collide`, `solve`, `merge_islands`, `prepare_stages`, `solve_constraints`,
|
|
171
|
-
* `prepare_constraints`, `integrate_velocities`, `warm_start`,
|
|
172
|
-
* `solve_impulses`, `integrate_positions`, `relax_impulses`,
|
|
173
|
-
* `apply_restitution`, `store_impulses`, `split_islands`, `transforms`,
|
|
174
|
-
* `hit_events`, `refit`, `bullets`, `sleep_islands`, and `sensors`.
|
|
163
|
+
* Get world profiling data.
|
|
175
164
|
*
|
|
176
165
|
* @param world - world
|
|
177
166
|
* @returns world profiling data
|
|
178
167
|
*/
|
|
179
|
-
function get_profile(world: Opaque<"b2World">):
|
|
168
|
+
function get_profile(world: Opaque<"b2World">): b2d.world_profile;
|
|
180
169
|
/**
|
|
181
170
|
* Get the restitution threshold.
|
|
182
171
|
*
|
|
@@ -223,40 +212,45 @@ declare global {
|
|
|
223
212
|
/**
|
|
224
213
|
* Overlap an AABB.
|
|
225
214
|
*
|
|
226
|
-
* @param world - world from
|
|
227
|
-
* @param aabb -
|
|
228
|
-
* @param filter - optional query filter
|
|
215
|
+
* @param world - world from b2d.get_world or b2d.body.get_world
|
|
216
|
+
* @param aabb - query bounds
|
|
217
|
+
* @param filter - optional query filter
|
|
229
218
|
* @param max_results - optional maximum result count
|
|
219
|
+
* @returns `[fixtures, stats]`:
|
|
220
|
+
* - `fixtures` — overlapping fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
221
|
+
* - `stats` — broad-phase query statistics
|
|
230
222
|
*/
|
|
231
|
-
function overlap_aabb(world: Opaque<"b2World">, aabb:
|
|
223
|
+
function overlap_aabb(world: Opaque<"b2World">, aabb: b2d.aabb, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.fixture_info[], b2d.tree_stats]>;
|
|
232
224
|
/**
|
|
233
|
-
*
|
|
225
|
+
* Find shapes overlapping an AABB.
|
|
234
226
|
*
|
|
235
227
|
* @param world - world
|
|
236
|
-
* @param aabb -
|
|
237
|
-
* @param filter - optional query filter
|
|
228
|
+
* @param aabb - query bounds
|
|
229
|
+
* @param filter - optional query filter
|
|
238
230
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
239
231
|
*/
|
|
240
|
-
function overlap_aabb(world: Opaque<"b2World">, aabb:
|
|
232
|
+
function overlap_aabb(world: Opaque<"b2World">, aabb: b2d.aabb, filter?: b2d.query_filter, max_results?: number): LuaMultiReturn<[b2d.shape_info[], b2d.tree_stats]>;
|
|
241
233
|
/**
|
|
242
234
|
* Overlap a shape.
|
|
243
235
|
*
|
|
244
|
-
* @param world - world from
|
|
245
|
-
* @param shape -
|
|
246
|
-
* @param filter - optional query filter
|
|
236
|
+
* @param world - world from b2d.get_world or b2d.body.get_world
|
|
237
|
+
* @param shape - query shape
|
|
238
|
+
* @param filter - optional query filter
|
|
247
239
|
* @param max_results - optional maximum result count
|
|
240
|
+
* @returns `[fixtures, stats]`:
|
|
241
|
+
* - `fixtures` — overlapping fixtures. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
242
|
+
* - `stats` — broad-phase query statistics
|
|
248
243
|
*/
|
|
249
|
-
function overlap_shape(world: Opaque<"b2World">, shape: { type
|
|
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]>;
|
|
250
245
|
/**
|
|
251
|
-
*
|
|
252
|
-
* as `b2d.body.create_shape`.
|
|
246
|
+
* Find shapes overlapping a shape proxy.
|
|
253
247
|
*
|
|
254
248
|
* @param world - world
|
|
255
|
-
* @param shape - shape
|
|
256
|
-
* @param filter - optional query filter
|
|
249
|
+
* @param shape - query shape
|
|
250
|
+
* @param filter - optional query filter
|
|
257
251
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
258
252
|
*/
|
|
259
|
-
function overlap_shape(world: Opaque<"b2World">, shape: { type
|
|
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]>;
|
|
260
254
|
/**
|
|
261
255
|
* Rebuild the static broad-phase tree.
|
|
262
256
|
*
|