@defold-typescript/types 0.40.0 → 0.42.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 +3963 -772
- package/api-migrations.json +27 -0
- package/api-signatures.json +18069 -10240
- package/api-targets.json +448 -11
- package/examples/translations.json +560 -89
- 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 +183 -20
- package/generated/b2d_world.d.ts +57 -63
- package/generated/buffer.d.ts +16 -15
- 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 +29 -32
- package/generated/collectionfactory.d.ts +15 -18
- 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 +235 -182
- package/generated/graphics.d.ts +335 -97
- package/generated/gui.d.ts +240 -471
- package/generated/html5.d.ts +2 -2
- package/generated/http.d.ts +28 -35
- package/generated/image.d.ts +105 -72
- package/generated/json.d.ts +34 -16
- package/generated/kinds/gui-script.d.ts +7 -0
- package/generated/kinds/render-script.d.ts +7 -0
- package/generated/kinds/script.d.ts +7 -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 +40 -39
- package/generated/particlefx.d.ts +19 -28
- package/generated/physics.d.ts +365 -133
- package/generated/profiler.d.ts +13 -23
- package/generated/render.d.ts +237 -297
- package/generated/resource.d.ts +664 -583
- package/generated/socket.d.ts +120 -133
- package/generated/sound.d.ts +62 -31
- package/generated/sprite.d.ts +31 -17
- package/generated/sys.d.ts +234 -190
- 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 +1 -3
- package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
- package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
- 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 +6 -12
- package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
- package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
- package/generated/versions/defold-1.12.4/http.d.ts +0 -13
- package/generated/versions/defold-1.12.4/image.d.ts +16 -33
- package/generated/versions/defold-1.12.4/index.d.ts +1 -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 +2 -10
- package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
- package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
- package/generated/versions/defold-1.12.4/render.d.ts +99 -128
- package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
- package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
- package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
- package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
- package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
- 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 +0 -21
- 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 +169 -8
- package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
- package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
- package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
- package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
- package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
- package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
- 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 +6 -12
- package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
- package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
- package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
- package/generated/versions/defold-1.13.0/http.d.ts +0 -13
- package/generated/versions/defold-1.13.0/image.d.ts +16 -33
- package/generated/versions/defold-1.13.0/index.d.ts +1 -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 +68 -106
- package/generated/versions/defold-1.13.0/model.d.ts +2 -10
- package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
- package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
- package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
- package/generated/versions/defold-1.13.0/render.d.ts +99 -128
- package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
- package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
- package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
- package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
- package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
- 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 +0 -21
- 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 +1 -21
- package/generated/window.d.ts +71 -71
- package/identity-vocabulary.json +561 -0
- package/index.d.ts +7 -0
- package/package.json +18 -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 +12 -2
- package/scripts/import-defold-release.ts +106 -26
- package/scripts/prose-constants.ts +77 -16
- package/scripts/regen.ts +391 -77
- package/scripts/shared-handle-methods.ts +53 -0
- package/scripts/signature-store-fs.ts +1 -0
- package/scripts/sync-api-docs.ts +48 -10
- package/src/api-availability.ts +0 -0
- package/src/api-doc.ts +201 -3
- package/src/api-identity.ts +252 -0
- package/src/core-types.ts +26 -3
- package/src/correction-pins.ts +49 -0
- package/src/doc-comment.ts +104 -11
- package/src/doc-corrections.ts +108 -0
- package/src/editor-vm-globals.d.ts +5 -2
- package/src/emit-dts.ts +2064 -281
- package/src/emit-messages.ts +52 -0
- 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 +25 -6
- package/src/index-base-table.ts +145 -0
- package/src/index-slot-classifications.ts +588 -0
- package/src/index.ts +38 -5
- 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 +8 -11
- package/src/render-overloads.d.ts +0 -15
- package/src/return-correction-provenance.ts +58 -16
- 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,13 @@ 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
|
+
*/
|
|
50
59
|
function are_contact_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
51
60
|
/**
|
|
52
61
|
* Check if hit events are enabled for a shape.
|
|
@@ -55,6 +64,13 @@ declare global {
|
|
|
55
64
|
* @returns true if hit events are enabled
|
|
56
65
|
*/
|
|
57
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
|
+
*/
|
|
58
74
|
function are_hit_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
59
75
|
/**
|
|
60
76
|
* Check if pre-solve events are enabled for a shape.
|
|
@@ -63,6 +79,13 @@ declare global {
|
|
|
63
79
|
* @returns true if pre-solve events are enabled
|
|
64
80
|
*/
|
|
65
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
|
+
*/
|
|
66
89
|
function are_pre_solve_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
67
90
|
/**
|
|
68
91
|
* Check if sensor events are enabled for a shape.
|
|
@@ -71,6 +94,13 @@ declare global {
|
|
|
71
94
|
* @returns true if sensor events are enabled
|
|
72
95
|
*/
|
|
73
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
|
+
*/
|
|
74
104
|
function are_sensor_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
75
105
|
/**
|
|
76
106
|
* Enable or disable contact events for a shape.
|
|
@@ -79,6 +109,13 @@ declare global {
|
|
|
79
109
|
* @param enable - true to enable contact events
|
|
80
110
|
*/
|
|
81
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
|
+
*/
|
|
82
119
|
function enable_contact_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
83
120
|
/**
|
|
84
121
|
* Enable or disable hit events for a shape.
|
|
@@ -87,6 +124,13 @@ declare global {
|
|
|
87
124
|
* @param enable - true to enable hit events
|
|
88
125
|
*/
|
|
89
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
|
+
*/
|
|
90
134
|
function enable_hit_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
91
135
|
/**
|
|
92
136
|
* Enable or disable pre-solve events for a shape.
|
|
@@ -95,6 +139,13 @@ declare global {
|
|
|
95
139
|
* @param enable - true to enable pre-solve events
|
|
96
140
|
*/
|
|
97
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
|
+
*/
|
|
98
149
|
function enable_pre_solve_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
99
150
|
/**
|
|
100
151
|
* Enable or disable sensor events for a shape.
|
|
@@ -103,6 +154,13 @@ declare global {
|
|
|
103
154
|
* @param enable - true to enable sensor events
|
|
104
155
|
*/
|
|
105
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
|
+
*/
|
|
106
164
|
function enable_sensor_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
107
165
|
/**
|
|
108
166
|
* Get the body owning a shape.
|
|
@@ -111,6 +169,13 @@ declare global {
|
|
|
111
169
|
* @returns owning body
|
|
112
170
|
*/
|
|
113
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
|
+
*/
|
|
114
179
|
function get_body(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2Body">;
|
|
115
180
|
/**
|
|
116
181
|
* Get the closest point on a shape.
|
|
@@ -120,6 +185,14 @@ declare global {
|
|
|
120
185
|
* @returns closest world point on the shape
|
|
121
186
|
*/
|
|
122
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
|
+
*/
|
|
123
196
|
function get_closest_point(body: Opaque<"b2Body">, shape_index: number, target: Vector3): Vector3;
|
|
124
197
|
/**
|
|
125
198
|
* Get shape contact capacity.
|
|
@@ -128,23 +201,44 @@ declare global {
|
|
|
128
201
|
* @returns maximum contact data count
|
|
129
202
|
*/
|
|
130
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
|
+
*/
|
|
131
211
|
function get_contact_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
132
212
|
/**
|
|
133
213
|
* Get touching contact data for a shape.
|
|
134
214
|
*
|
|
135
215
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
136
|
-
* @returns
|
|
216
|
+
* @returns touching contacts
|
|
137
217
|
*/
|
|
138
|
-
function get_contact_data(shape_id: Opaque<"b2Shape">):
|
|
139
|
-
|
|
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[];
|
|
140
227
|
/**
|
|
141
228
|
* Get mass data for a shape.
|
|
142
229
|
*
|
|
143
230
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
144
|
-
* @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
|
|
145
240
|
*/
|
|
146
|
-
function get_mass_data(
|
|
147
|
-
function get_mass_data(body: Opaque<"b2Body">, shape_index: number): { mass: number; center: Vector3; inertia: number };
|
|
241
|
+
function get_mass_data(body: Opaque<"b2Body">, shape_index: number): b2d.mass_data;
|
|
148
242
|
/**
|
|
149
243
|
* Get shape material id.
|
|
150
244
|
*
|
|
@@ -152,6 +246,13 @@ declare global {
|
|
|
152
246
|
* @returns shape material id
|
|
153
247
|
*/
|
|
154
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
|
+
*/
|
|
155
256
|
function get_material(body: Opaque<"b2Body">, shape_index: number): number;
|
|
156
257
|
/**
|
|
157
258
|
* Get sensor overlap capacity.
|
|
@@ -160,23 +261,44 @@ declare global {
|
|
|
160
261
|
* @returns maximum sensor overlap count
|
|
161
262
|
*/
|
|
162
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
|
+
*/
|
|
163
271
|
function get_sensor_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
164
272
|
/**
|
|
165
273
|
* Get sensor overlaps.
|
|
166
274
|
*
|
|
167
275
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
168
|
-
* @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
|
|
169
285
|
*/
|
|
170
|
-
function get_sensor_overlaps(
|
|
171
|
-
function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): { shape_id: number }[];
|
|
286
|
+
function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): b2d.shape_info[];
|
|
172
287
|
/**
|
|
173
288
|
* Get a shape's geometry.
|
|
174
289
|
*
|
|
175
290
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
176
291
|
* @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
177
292
|
*/
|
|
178
|
-
function get_shape(shape_id: Opaque<"b2Shape">):
|
|
179
|
-
|
|
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;
|
|
180
302
|
/**
|
|
181
303
|
* Get the world owning a shape.
|
|
182
304
|
*
|
|
@@ -184,6 +306,13 @@ declare global {
|
|
|
184
306
|
* @returns owning world
|
|
185
307
|
*/
|
|
186
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
|
+
*/
|
|
187
316
|
function get_world(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2World">;
|
|
188
317
|
/**
|
|
189
318
|
* Validate a shape handle.
|
|
@@ -192,6 +321,13 @@ declare global {
|
|
|
192
321
|
* @returns true if the shape handle still refers to a live Box2D shape
|
|
193
322
|
*/
|
|
194
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
|
+
*/
|
|
195
331
|
function is_valid(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
196
332
|
/**
|
|
197
333
|
* Ray cast a shape directly.
|
|
@@ -200,10 +336,20 @@ declare global {
|
|
|
200
336
|
* @param origin - world ray origin
|
|
201
337
|
* @param translation - world ray translation
|
|
202
338
|
* @param max_fraction - optional maximum translation fraction, defaults to 1
|
|
203
|
-
* @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`
|
|
204
351
|
*/
|
|
205
|
-
function ray_cast(
|
|
206
|
-
function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number };
|
|
352
|
+
function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): b2d.shape_cast_output | undefined;
|
|
207
353
|
/**
|
|
208
354
|
* Set shape material id.
|
|
209
355
|
*
|
|
@@ -211,6 +357,13 @@ declare global {
|
|
|
211
357
|
* @param material - shape material id
|
|
212
358
|
*/
|
|
213
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
|
+
*/
|
|
214
367
|
function set_material(body: Opaque<"b2Body">, shape_index: number, material: number): void;
|
|
215
368
|
/**
|
|
216
369
|
* This updates the shape geometry using the same table format as
|
|
@@ -225,14 +378,24 @@ declare global {
|
|
|
225
378
|
* const body = b2d.get_body("#collisionobject");
|
|
226
379
|
* if (body !== undefined) {
|
|
227
380
|
* const circle = b2d.shape.get_shape(body, 1);
|
|
228
|
-
*
|
|
229
|
-
* 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);
|
|
230
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) });
|
|
231
384
|
* }
|
|
232
385
|
* ```
|
|
233
386
|
*/
|
|
234
|
-
function set_shape(shape_id: Opaque<"b2Shape">, definition: { type
|
|
235
|
-
|
|
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;
|
|
236
399
|
}
|
|
237
400
|
}
|
|
238
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
|
*
|