@defold-typescript/types 0.40.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 +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 +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 +12 -2
- package/scripts/import-defold-release.ts +85 -24
- 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 +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/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
|
@@ -47,6 +47,13 @@ declare global {
|
|
|
47
47
|
* @returns true if contact events are enabled
|
|
48
48
|
*/
|
|
49
49
|
function are_contact_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Check if contact events are enabled for a shape.
|
|
52
|
+
*
|
|
53
|
+
* @param body - The body that owns the shape.
|
|
54
|
+
* @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.**
|
|
55
|
+
* @returns true if contact events are enabled
|
|
56
|
+
*/
|
|
50
57
|
function are_contact_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
51
58
|
/**
|
|
52
59
|
* Check if hit events are enabled for a shape.
|
|
@@ -55,6 +62,13 @@ declare global {
|
|
|
55
62
|
* @returns true if hit events are enabled
|
|
56
63
|
*/
|
|
57
64
|
function are_hit_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Check if hit events are enabled for a shape.
|
|
67
|
+
*
|
|
68
|
+
* @param body - The body that owns the shape.
|
|
69
|
+
* @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.**
|
|
70
|
+
* @returns true if hit events are enabled
|
|
71
|
+
*/
|
|
58
72
|
function are_hit_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
59
73
|
/**
|
|
60
74
|
* Check if pre-solve events are enabled for a shape.
|
|
@@ -63,6 +77,13 @@ declare global {
|
|
|
63
77
|
* @returns true if pre-solve events are enabled
|
|
64
78
|
*/
|
|
65
79
|
function are_pre_solve_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Check if pre-solve events are enabled for a shape.
|
|
82
|
+
*
|
|
83
|
+
* @param body - The body that owns the shape.
|
|
84
|
+
* @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.**
|
|
85
|
+
* @returns true if pre-solve events are enabled
|
|
86
|
+
*/
|
|
66
87
|
function are_pre_solve_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
67
88
|
/**
|
|
68
89
|
* Check if sensor events are enabled for a shape.
|
|
@@ -71,6 +92,13 @@ declare global {
|
|
|
71
92
|
* @returns true if sensor events are enabled
|
|
72
93
|
*/
|
|
73
94
|
function are_sensor_events_enabled(shape_id: Opaque<"b2Shape">): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Check if sensor events are enabled for a shape.
|
|
97
|
+
*
|
|
98
|
+
* @param body - The body that owns the shape.
|
|
99
|
+
* @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.**
|
|
100
|
+
* @returns true if sensor events are enabled
|
|
101
|
+
*/
|
|
74
102
|
function are_sensor_events_enabled(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
75
103
|
/**
|
|
76
104
|
* Enable or disable contact events for a shape.
|
|
@@ -79,6 +107,13 @@ declare global {
|
|
|
79
107
|
* @param enable - true to enable contact events
|
|
80
108
|
*/
|
|
81
109
|
function enable_contact_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
110
|
+
/**
|
|
111
|
+
* Enable or disable contact events for a shape.
|
|
112
|
+
*
|
|
113
|
+
* @param body - The body that owns the shape.
|
|
114
|
+
* @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.**
|
|
115
|
+
* @param enable - true to enable contact events
|
|
116
|
+
*/
|
|
82
117
|
function enable_contact_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
83
118
|
/**
|
|
84
119
|
* Enable or disable hit events for a shape.
|
|
@@ -87,6 +122,13 @@ declare global {
|
|
|
87
122
|
* @param enable - true to enable hit events
|
|
88
123
|
*/
|
|
89
124
|
function enable_hit_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
125
|
+
/**
|
|
126
|
+
* Enable or disable hit events for a shape.
|
|
127
|
+
*
|
|
128
|
+
* @param body - The body that owns the shape.
|
|
129
|
+
* @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.**
|
|
130
|
+
* @param enable - true to enable hit events
|
|
131
|
+
*/
|
|
90
132
|
function enable_hit_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
91
133
|
/**
|
|
92
134
|
* Enable or disable pre-solve events for a shape.
|
|
@@ -95,6 +137,13 @@ declare global {
|
|
|
95
137
|
* @param enable - true to enable pre-solve events
|
|
96
138
|
*/
|
|
97
139
|
function enable_pre_solve_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
140
|
+
/**
|
|
141
|
+
* Enable or disable pre-solve events for a shape.
|
|
142
|
+
*
|
|
143
|
+
* @param body - The body that owns the shape.
|
|
144
|
+
* @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.**
|
|
145
|
+
* @param enable - true to enable pre-solve events
|
|
146
|
+
*/
|
|
98
147
|
function enable_pre_solve_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
99
148
|
/**
|
|
100
149
|
* Enable or disable sensor events for a shape.
|
|
@@ -103,6 +152,13 @@ declare global {
|
|
|
103
152
|
* @param enable - true to enable sensor events
|
|
104
153
|
*/
|
|
105
154
|
function enable_sensor_events(shape_id: Opaque<"b2Shape">, enable: boolean): void;
|
|
155
|
+
/**
|
|
156
|
+
* Enable or disable sensor events for a shape.
|
|
157
|
+
*
|
|
158
|
+
* @param body - The body that owns the shape.
|
|
159
|
+
* @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.**
|
|
160
|
+
* @param enable - true to enable sensor events
|
|
161
|
+
*/
|
|
106
162
|
function enable_sensor_events(body: Opaque<"b2Body">, shape_index: number, enable: boolean): void;
|
|
107
163
|
/**
|
|
108
164
|
* Get the body owning a shape.
|
|
@@ -111,6 +167,13 @@ declare global {
|
|
|
111
167
|
* @returns owning body
|
|
112
168
|
*/
|
|
113
169
|
function get_body(shape_id: Opaque<"b2Shape">): Opaque<"b2Body">;
|
|
170
|
+
/**
|
|
171
|
+
* Get the body owning a shape.
|
|
172
|
+
*
|
|
173
|
+
* @param body - The body that owns the shape.
|
|
174
|
+
* @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.**
|
|
175
|
+
* @returns owning body
|
|
176
|
+
*/
|
|
114
177
|
function get_body(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2Body">;
|
|
115
178
|
/**
|
|
116
179
|
* Get the closest point on a shape.
|
|
@@ -120,6 +183,14 @@ declare global {
|
|
|
120
183
|
* @returns closest world point on the shape
|
|
121
184
|
*/
|
|
122
185
|
function get_closest_point(shape_id: Opaque<"b2Shape">, target: Vector3): Vector3;
|
|
186
|
+
/**
|
|
187
|
+
* Get the closest point on a shape.
|
|
188
|
+
*
|
|
189
|
+
* @param body - The body that owns the shape.
|
|
190
|
+
* @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.**
|
|
191
|
+
* @param target - world target point
|
|
192
|
+
* @returns closest world point on the shape
|
|
193
|
+
*/
|
|
123
194
|
function get_closest_point(body: Opaque<"b2Body">, shape_index: number, target: Vector3): Vector3;
|
|
124
195
|
/**
|
|
125
196
|
* Get shape contact capacity.
|
|
@@ -128,6 +199,13 @@ declare global {
|
|
|
128
199
|
* @returns maximum contact data count
|
|
129
200
|
*/
|
|
130
201
|
function get_contact_capacity(shape_id: Opaque<"b2Shape">): number;
|
|
202
|
+
/**
|
|
203
|
+
* Get shape contact capacity.
|
|
204
|
+
*
|
|
205
|
+
* @param body - The body that owns the shape.
|
|
206
|
+
* @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.**
|
|
207
|
+
* @returns maximum contact data count
|
|
208
|
+
*/
|
|
131
209
|
function get_contact_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
132
210
|
/**
|
|
133
211
|
* Get touching contact data for a shape.
|
|
@@ -136,6 +214,13 @@ declare global {
|
|
|
136
214
|
* @returns array of contact tables
|
|
137
215
|
*/
|
|
138
216
|
function get_contact_data(shape_id: Opaque<"b2Shape">): Record<string | number, unknown>;
|
|
217
|
+
/**
|
|
218
|
+
* Get touching contact data for a shape.
|
|
219
|
+
*
|
|
220
|
+
* @param body - The body that owns the shape.
|
|
221
|
+
* @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.**
|
|
222
|
+
* @returns array of contact tables
|
|
223
|
+
*/
|
|
139
224
|
function get_contact_data(body: Opaque<"b2Body">, shape_index: number): Record<string | number, unknown>;
|
|
140
225
|
/**
|
|
141
226
|
* Get mass data for a shape.
|
|
@@ -144,6 +229,13 @@ declare global {
|
|
|
144
229
|
* @returns table with `mass`, `center`, and `inertia`
|
|
145
230
|
*/
|
|
146
231
|
function get_mass_data(shape_id: Opaque<"b2Shape">): { mass: number; center: Vector3; inertia: number };
|
|
232
|
+
/**
|
|
233
|
+
* Get mass data for a shape.
|
|
234
|
+
*
|
|
235
|
+
* @param body - The body that owns the shape.
|
|
236
|
+
* @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.**
|
|
237
|
+
* @returns table with `mass`, `center`, and `inertia`
|
|
238
|
+
*/
|
|
147
239
|
function get_mass_data(body: Opaque<"b2Body">, shape_index: number): { mass: number; center: Vector3; inertia: number };
|
|
148
240
|
/**
|
|
149
241
|
* Get shape material id.
|
|
@@ -152,6 +244,13 @@ declare global {
|
|
|
152
244
|
* @returns shape material id
|
|
153
245
|
*/
|
|
154
246
|
function get_material(shape_id: Opaque<"b2Shape">): number;
|
|
247
|
+
/**
|
|
248
|
+
* Get shape material id.
|
|
249
|
+
*
|
|
250
|
+
* @param body - The body that owns the shape.
|
|
251
|
+
* @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.**
|
|
252
|
+
* @returns shape material id
|
|
253
|
+
*/
|
|
155
254
|
function get_material(body: Opaque<"b2Body">, shape_index: number): number;
|
|
156
255
|
/**
|
|
157
256
|
* Get sensor overlap capacity.
|
|
@@ -160,6 +259,13 @@ declare global {
|
|
|
160
259
|
* @returns maximum sensor overlap count
|
|
161
260
|
*/
|
|
162
261
|
function get_sensor_capacity(shape_id: Opaque<"b2Shape">): number;
|
|
262
|
+
/**
|
|
263
|
+
* Get sensor overlap capacity.
|
|
264
|
+
*
|
|
265
|
+
* @param body - The body that owns the shape.
|
|
266
|
+
* @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.**
|
|
267
|
+
* @returns maximum sensor overlap count
|
|
268
|
+
*/
|
|
163
269
|
function get_sensor_capacity(body: Opaque<"b2Body">, shape_index: number): number;
|
|
164
270
|
/**
|
|
165
271
|
* Get sensor overlaps.
|
|
@@ -168,6 +274,13 @@ declare global {
|
|
|
168
274
|
* @returns array of shape info tables
|
|
169
275
|
*/
|
|
170
276
|
function get_sensor_overlaps(shape_id: Opaque<"b2Shape">): { shape_id: number }[];
|
|
277
|
+
/**
|
|
278
|
+
* Get sensor overlaps.
|
|
279
|
+
*
|
|
280
|
+
* @param body - The body that owns the shape.
|
|
281
|
+
* @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.**
|
|
282
|
+
* @returns array of shape info tables
|
|
283
|
+
*/
|
|
171
284
|
function get_sensor_overlaps(body: Opaque<"b2Body">, shape_index: number): { shape_id: number }[];
|
|
172
285
|
/**
|
|
173
286
|
* Get a shape's geometry.
|
|
@@ -175,8 +288,15 @@ declare global {
|
|
|
175
288
|
* @param shape_id - shape handle from a shape info table, or pass `body, shape_index`
|
|
176
289
|
* @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
177
290
|
*/
|
|
178
|
-
function get_shape(shape_id: Opaque<"b2Shape">): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3 };
|
|
179
|
-
|
|
291
|
+
function get_shape(shape_id: Opaque<"b2Shape">): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3; center1?: Vector3; center2?: Vector3 };
|
|
292
|
+
/**
|
|
293
|
+
* Get a shape's geometry.
|
|
294
|
+
*
|
|
295
|
+
* @param body - The body that owns the shape.
|
|
296
|
+
* @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.**
|
|
297
|
+
* @returns shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
298
|
+
*/
|
|
299
|
+
function get_shape(body: Opaque<"b2Body">, shape_index: number): { type: number; radius?: number; center?: Vector3; v0?: Vector3; v1?: Vector3; v2?: Vector3; v3?: Vector3; vertices?: Vector3[]; hx?: number; hy?: number; angle?: number; loop?: boolean; prev_vertex?: Vector3; next_vertex?: Vector3; center1?: Vector3; center2?: Vector3 };
|
|
180
300
|
/**
|
|
181
301
|
* Get the world owning a shape.
|
|
182
302
|
*
|
|
@@ -184,6 +304,13 @@ declare global {
|
|
|
184
304
|
* @returns owning world
|
|
185
305
|
*/
|
|
186
306
|
function get_world(shape_id: Opaque<"b2Shape">): Opaque<"b2World">;
|
|
307
|
+
/**
|
|
308
|
+
* Get the world owning a shape.
|
|
309
|
+
*
|
|
310
|
+
* @param body - The body that owns the shape.
|
|
311
|
+
* @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.**
|
|
312
|
+
* @returns owning world
|
|
313
|
+
*/
|
|
187
314
|
function get_world(body: Opaque<"b2Body">, shape_index: number): Opaque<"b2World">;
|
|
188
315
|
/**
|
|
189
316
|
* Validate a shape handle.
|
|
@@ -192,6 +319,13 @@ declare global {
|
|
|
192
319
|
* @returns true if the shape handle still refers to a live Box2D shape
|
|
193
320
|
*/
|
|
194
321
|
function is_valid(shape_id: Opaque<"b2Shape">): boolean;
|
|
322
|
+
/**
|
|
323
|
+
* Validate a shape handle.
|
|
324
|
+
*
|
|
325
|
+
* @param body - The body that owns the shape.
|
|
326
|
+
* @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.**
|
|
327
|
+
* @returns true if the shape handle still refers to a live Box2D shape
|
|
328
|
+
*/
|
|
195
329
|
function is_valid(body: Opaque<"b2Body">, shape_index: number): boolean;
|
|
196
330
|
/**
|
|
197
331
|
* Ray cast a shape directly.
|
|
@@ -202,8 +336,18 @@ declare global {
|
|
|
202
336
|
* @param max_fraction - optional maximum translation fraction, defaults to 1
|
|
203
337
|
* @returns hit table with `point`, `normal`, `fraction`, and `iterations`, or nil
|
|
204
338
|
*/
|
|
205
|
-
function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number };
|
|
206
|
-
|
|
339
|
+
function ray_cast(shape_id: Opaque<"b2Shape">, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number } | undefined;
|
|
340
|
+
/**
|
|
341
|
+
* Ray cast a shape directly.
|
|
342
|
+
*
|
|
343
|
+
* @param body - The body that owns the shape.
|
|
344
|
+
* @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.**
|
|
345
|
+
* @param origin - world ray origin
|
|
346
|
+
* @param translation - world ray translation
|
|
347
|
+
* @param max_fraction - optional maximum translation fraction, defaults to 1
|
|
348
|
+
* @returns hit table with `point`, `normal`, `fraction`, and `iterations`, or nil
|
|
349
|
+
*/
|
|
350
|
+
function ray_cast(body: Opaque<"b2Body">, shape_index: number, origin: Vector3, translation: Vector3, max_fraction?: number): { point: Vector3; normal: Vector3; fraction: number; iterations: number } | undefined;
|
|
207
351
|
/**
|
|
208
352
|
* Set shape material id.
|
|
209
353
|
*
|
|
@@ -211,6 +355,13 @@ declare global {
|
|
|
211
355
|
* @param material - shape material id
|
|
212
356
|
*/
|
|
213
357
|
function set_material(shape_id: Opaque<"b2Shape">, material: number): void;
|
|
358
|
+
/**
|
|
359
|
+
* Set shape material id.
|
|
360
|
+
*
|
|
361
|
+
* @param body - The body that owns the shape.
|
|
362
|
+
* @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.**
|
|
363
|
+
* @param material - shape material id
|
|
364
|
+
*/
|
|
214
365
|
function set_material(body: Opaque<"b2Body">, shape_index: number, material: number): void;
|
|
215
366
|
/**
|
|
216
367
|
* This updates the shape geometry using the same table format as
|
|
@@ -225,14 +376,24 @@ declare global {
|
|
|
225
376
|
* const body = b2d.get_body("#collisionobject");
|
|
226
377
|
* if (body !== undefined) {
|
|
227
378
|
* const circle = b2d.shape.get_shape(body, 1);
|
|
228
|
-
*
|
|
229
|
-
* b2d.shape.set_shape(body, 1,
|
|
379
|
+
* const radius = "radius" in circle ? circle.radius : undefined;
|
|
380
|
+
* b2d.shape.set_shape(body, 1, { type: b2d.shape.SHAPE_TYPE_CIRCLE, radius: radius ?? 16, center: vmath.vector3(24, 0, 0) }, true);
|
|
230
381
|
* 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
382
|
* }
|
|
232
383
|
* ```
|
|
233
384
|
*/
|
|
234
|
-
function set_shape(shape_id: Opaque<"b2Shape">, definition: { type
|
|
235
|
-
|
|
385
|
+
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;
|
|
386
|
+
/**
|
|
387
|
+
* This updates the shape geometry using the same table format as
|
|
388
|
+
* `b2d.body.create_shape` and `b2d.shape.get_shape`. The body mass is not
|
|
389
|
+
* updated unless `update_mass` is true.
|
|
390
|
+
*
|
|
391
|
+
* @param body - The body that owns the shape.
|
|
392
|
+
* @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.**
|
|
393
|
+
* @param definition - shape table with numeric `type` from `b2d.shape.SHAPE_TYPE_*`
|
|
394
|
+
* @param update_mass - true to reset body mass from shapes
|
|
395
|
+
*/
|
|
396
|
+
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
397
|
}
|
|
237
398
|
}
|
|
238
399
|
|
|
@@ -17,7 +17,7 @@ declare global {
|
|
|
17
17
|
* @param filter - optional query filter with `category_bits` and `mask_bits`
|
|
18
18
|
* @returns travel fraction before collision
|
|
19
19
|
*/
|
|
20
|
-
function cast_mover(world: Opaque<"b2World">, capsule: { center1
|
|
20
|
+
function cast_mover(world: Opaque<"b2World">, capsule: { center1: Vector3; center2: Vector3; radius: number }, translation: Vector3, filter?: { category_bits?: number; mask_bits?: number }): number;
|
|
21
21
|
/**
|
|
22
22
|
* Cast a ray.
|
|
23
23
|
*
|
|
@@ -48,7 +48,7 @@ declare global {
|
|
|
48
48
|
* @param filter - optional query filter with `category_bits`, `mask_bits`, and optional `group_index`
|
|
49
49
|
* @returns hit table with `fixture`, `shape`, `point`, `normal`, `fraction`, `node_visits`, and `leaf_visits`, or nil
|
|
50
50
|
*/
|
|
51
|
-
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter: { category_bits?: number; mask_bits?: number; group_index?: number }): { fixture: number; shape: number; point: Vector3; normal: Vector3; fraction: number; node_visits: number; leaf_visits: number };
|
|
51
|
+
function cast_ray_closest(world: Opaque<"b2World">, origin: Vector3, translation: Vector3, filter: { category_bits?: number; mask_bits?: number; group_index?: number }): { fixture: number; shape: number; point: Vector3; normal: Vector3; fraction: number; node_visits: number; leaf_visits: number } | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* The translation is the ray displacement from `origin`.
|
|
54
54
|
*
|
|
@@ -69,7 +69,7 @@ declare global {
|
|
|
69
69
|
* @param filter - optional query filter with `category_bits`, `mask_bits`, and optional `group_index`
|
|
70
70
|
* @param max_results - optional maximum result count
|
|
71
71
|
*/
|
|
72
|
-
function cast_shape(world: Opaque<"b2World">, shape: { type
|
|
72
|
+
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: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results: number): LuaMultiReturn<[{ fixture: number; shape: number; point: Vector3; normal: Vector3; fraction: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
73
73
|
/**
|
|
74
74
|
* The shape table uses the same circle, capsule, segment, polygon, and box formats
|
|
75
75
|
* as `b2d.body.create_shape`. The translation is the shape displacement.
|
|
@@ -80,7 +80,7 @@ declare global {
|
|
|
80
80
|
* @param filter - optional query filter with `category_bits` and `mask_bits`
|
|
81
81
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
82
82
|
*/
|
|
83
|
-
function cast_shape(world: Opaque<"b2World">, shape: { type
|
|
83
|
+
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?: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results?: number): LuaMultiReturn<[{ fixture: number; shape: number; point: Vector3; normal: Vector3; fraction: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
84
84
|
/**
|
|
85
85
|
* The capsule table has `center1`, `center2`, and `radius` fields. Plane result
|
|
86
86
|
* tables include `shape`, `normal`, `offset`, and `hit`.
|
|
@@ -91,7 +91,7 @@ declare global {
|
|
|
91
91
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
92
92
|
* @returns array of plane result tables
|
|
93
93
|
*/
|
|
94
|
-
function collide_mover(world: Opaque<"b2World">, capsule: { center1
|
|
94
|
+
function collide_mover(world: Opaque<"b2World">, capsule: { center1: Vector3; center2: Vector3; radius: number }, filter?: { category_bits?: number; mask_bits?: number }, max_results?: number): Record<string | number, unknown>;
|
|
95
95
|
/**
|
|
96
96
|
* Enable or disable continuous collision.
|
|
97
97
|
*
|
|
@@ -127,7 +127,7 @@ declare global {
|
|
|
127
127
|
* @param world - world
|
|
128
128
|
* @param definition - explosion definition
|
|
129
129
|
*/
|
|
130
|
-
function explode(world: Opaque<"b2World">, definition:
|
|
130
|
+
function explode(world: Opaque<"b2World">, definition: { position: Vector3; radius: number; falloff: number; impulse_per_length: number; mask_bits?: number }): void;
|
|
131
131
|
/**
|
|
132
132
|
* Get the number of awake bodies.
|
|
133
133
|
*
|
|
@@ -227,8 +227,11 @@ declare global {
|
|
|
227
227
|
* @param aabb - table with `lower` and `upper` vector3 fields
|
|
228
228
|
* @param filter - optional query filter with `category_bits`, `mask_bits`, and optional `group_index`
|
|
229
229
|
* @param max_results - optional maximum result count
|
|
230
|
+
* @returns `[fixtures, stats]`:
|
|
231
|
+
* - `fixtures` — array of fixture info tables. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
232
|
+
* - `stats` — table with `node_visits` and `leaf_visits`
|
|
230
233
|
*/
|
|
231
|
-
function overlap_aabb(world: Opaque<"b2World">, aabb: { lower
|
|
234
|
+
function overlap_aabb(world: Opaque<"b2World">, aabb: { lower: Vector3; upper: Vector3 }, filter: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results: number): LuaMultiReturn<[{ index: number; type: number; sensor: boolean; density: number; friction: number; restitution: number; child_count: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
232
235
|
/**
|
|
233
236
|
* The AABB table has `lower` and `upper` `vector3` fields.
|
|
234
237
|
*
|
|
@@ -237,7 +240,7 @@ declare global {
|
|
|
237
240
|
* @param filter - optional query filter with `category_bits` and `mask_bits`
|
|
238
241
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
239
242
|
*/
|
|
240
|
-
function overlap_aabb(world: Opaque<"b2World">, aabb: { lower
|
|
243
|
+
function overlap_aabb(world: Opaque<"b2World">, aabb: { lower: Vector3; upper: Vector3 }, filter?: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results?: number): LuaMultiReturn<[{ shape_id: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
241
244
|
/**
|
|
242
245
|
* Overlap a shape.
|
|
243
246
|
*
|
|
@@ -245,8 +248,11 @@ declare global {
|
|
|
245
248
|
* @param shape - shape table using the same format as the `shape` field in `b2d.body.create_fixture`
|
|
246
249
|
* @param filter - optional query filter with `category_bits`, `mask_bits`, and optional `group_index`
|
|
247
250
|
* @param max_results - optional maximum result count
|
|
251
|
+
* @returns `[fixtures, stats]`:
|
|
252
|
+
* - `fixtures` — array of fixture info tables. **⚠️ `index` is 1-based; passed to Defold unchanged.**
|
|
253
|
+
* - `stats` — table with `node_visits` and `leaf_visits`
|
|
248
254
|
*/
|
|
249
|
-
function overlap_shape(world: Opaque<"b2World">, shape: { type
|
|
255
|
+
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: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results: number): LuaMultiReturn<[{ index: number; type: number; sensor: boolean; density: number; friction: number; restitution: number; child_count: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
250
256
|
/**
|
|
251
257
|
* The shape table uses the same circle, capsule, segment, polygon, and box formats
|
|
252
258
|
* as `b2d.body.create_shape`.
|
|
@@ -256,7 +262,7 @@ declare global {
|
|
|
256
262
|
* @param filter - optional query filter with `category_bits` and `mask_bits`
|
|
257
263
|
* @param max_results - optional maximum result count. Omit or pass 0 for unlimited results.
|
|
258
264
|
*/
|
|
259
|
-
function overlap_shape(world: Opaque<"b2World">, shape: { type
|
|
265
|
+
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?: { category_bits?: number; mask_bits?: number; group_index?: number }, max_results?: number): LuaMultiReturn<[{ shape_id: number }[], { node_visits: number; leaf_visits: number }]>;
|
|
260
266
|
/**
|
|
261
267
|
* Rebuild the static broad-phase tree.
|
|
262
268
|
*
|
|
@@ -102,9 +102,7 @@ declare global {
|
|
|
102
102
|
* @param declaration - A table where each entry (table) describes a stream
|
|
103
103
|
*
|
|
104
104
|
* - hash | string `name`: The name of the stream
|
|
105
|
-
*
|
|
106
105
|
* - constant `type`: The data type of the stream
|
|
107
|
-
*
|
|
108
106
|
* - number `count`: The number of values each element should hold
|
|
109
107
|
* @returns the new buffer
|
|
110
108
|
* @example
|
|
@@ -131,7 +129,7 @@ declare global {
|
|
|
131
129
|
* });
|
|
132
130
|
* ```
|
|
133
131
|
*/
|
|
134
|
-
function create(element_count: number, declaration: { name?: Hash | string; type
|
|
132
|
+
function create(element_count: number, declaration: { name?: Hash | string; type: buffer.ValueType; count?: number }[]): Opaque<"buffer">;
|
|
135
133
|
/**
|
|
136
134
|
* Get a copy of all the bytes from a specified stream as a Lua string.
|
|
137
135
|
*
|