@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.
Files changed (224) hide show
  1. package/api-availability.json +3963 -772
  2. package/api-migrations.json +27 -0
  3. package/api-signatures.json +18069 -10240
  4. package/api-targets.json +448 -11
  5. package/examples/translations.json +560 -89
  6. package/fixtures/messages_doc.json +96 -0
  7. package/generated/b2d.d.ts +680 -4
  8. package/generated/b2d_body.d.ts +29 -103
  9. package/generated/b2d_chain.d.ts +5 -6
  10. package/generated/b2d_fixture.d.ts +34 -38
  11. package/generated/b2d_joint.d.ts +503 -25
  12. package/generated/b2d_shape.d.ts +183 -20
  13. package/generated/b2d_world.d.ts +57 -63
  14. package/generated/buffer.d.ts +16 -15
  15. package/generated/builtin-messages.d.ts +7 -1
  16. package/generated/bullet3d.d.ts +91 -0
  17. package/generated/bullet3d_collision_object.d.ts +433 -0
  18. package/generated/bullet3d_constraint.d.ts +818 -0
  19. package/generated/bullet3d_rigid_body.d.ts +429 -0
  20. package/generated/bullet3d_shape.d.ts +123 -0
  21. package/generated/bullet3d_world.d.ts +492 -0
  22. package/generated/camera.d.ts +29 -32
  23. package/generated/collectionfactory.d.ts +15 -18
  24. package/generated/collectionproxy.d.ts +22 -6
  25. package/generated/compute.d.ts +12 -238
  26. package/generated/crash.d.ts +24 -10
  27. package/generated/editor-vm/http.d.ts +90 -7
  28. package/generated/editor-vm/image.d.ts +7 -7
  29. package/generated/editor-vm/json.d.ts +11 -0
  30. package/generated/editor-vm/localization.d.ts +7 -7
  31. package/generated/editor-vm/tilemap_tiles.d.ts +56 -10
  32. package/generated/editor-vm/zip.d.ts +28 -0
  33. package/generated/editor.d.ts +1496 -430
  34. package/generated/factory.d.ts +21 -25
  35. package/generated/font.d.ts +64 -22
  36. package/generated/go.d.ts +235 -182
  37. package/generated/graphics.d.ts +335 -97
  38. package/generated/gui.d.ts +240 -471
  39. package/generated/html5.d.ts +2 -2
  40. package/generated/http.d.ts +28 -35
  41. package/generated/image.d.ts +105 -72
  42. package/generated/json.d.ts +34 -16
  43. package/generated/kinds/gui-script.d.ts +7 -0
  44. package/generated/kinds/render-script.d.ts +7 -0
  45. package/generated/kinds/script.d.ts +7 -0
  46. package/generated/label.d.ts +77 -7
  47. package/generated/liveupdate.d.ts +13 -10
  48. package/generated/material.d.ts +312 -360
  49. package/generated/model.d.ts +40 -39
  50. package/generated/particlefx.d.ts +19 -28
  51. package/generated/physics.d.ts +365 -133
  52. package/generated/profiler.d.ts +13 -23
  53. package/generated/render.d.ts +237 -297
  54. package/generated/resource.d.ts +664 -583
  55. package/generated/socket.d.ts +120 -133
  56. package/generated/sound.d.ts +62 -31
  57. package/generated/sprite.d.ts +31 -17
  58. package/generated/sys.d.ts +234 -190
  59. package/generated/tilemap.d.ts +21 -16
  60. package/generated/timer.d.ts +34 -21
  61. package/generated/versions/defold-1.12.4/b2d_body.d.ts +0 -7
  62. package/generated/versions/defold-1.12.4/buffer.d.ts +1 -3
  63. package/generated/versions/defold-1.12.4/camera.d.ts +21 -21
  64. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +9 -9
  65. package/generated/versions/defold-1.12.4/collectionproxy.d.ts +2 -2
  66. package/generated/versions/defold-1.12.4/crash.d.ts +2 -2
  67. package/generated/versions/defold-1.12.4/factory.d.ts +15 -16
  68. package/generated/versions/defold-1.12.4/go.d.ts +6 -12
  69. package/generated/versions/defold-1.12.4/gui.d.ts +77 -175
  70. package/generated/versions/defold-1.12.4/html5.d.ts +1 -1
  71. package/generated/versions/defold-1.12.4/http.d.ts +0 -13
  72. package/generated/versions/defold-1.12.4/image.d.ts +16 -33
  73. package/generated/versions/defold-1.12.4/index.d.ts +1 -0
  74. package/generated/versions/defold-1.12.4/json.d.ts +10 -6
  75. package/generated/versions/defold-1.12.4/label.d.ts +2 -3
  76. package/generated/versions/defold-1.12.4/liveupdate.d.ts +5 -3
  77. package/generated/versions/defold-1.12.4/model.d.ts +2 -10
  78. package/generated/versions/defold-1.12.4/particlefx.d.ts +2 -5
  79. package/generated/versions/defold-1.12.4/physics.d.ts +69 -67
  80. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -5
  81. package/generated/versions/defold-1.12.4/render.d.ts +99 -128
  82. package/generated/versions/defold-1.12.4/resource.d.ts +120 -148
  83. package/generated/versions/defold-1.12.4/socket.d.ts +34 -60
  84. package/generated/versions/defold-1.12.4/sound.d.ts +8 -8
  85. package/generated/versions/defold-1.12.4/sprite.d.ts +15 -5
  86. package/generated/versions/defold-1.12.4/sys.d.ts +37 -71
  87. package/generated/versions/defold-1.12.4/tilemap.d.ts +18 -11
  88. package/generated/versions/defold-1.12.4/timer.d.ts +5 -3
  89. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -21
  90. package/generated/versions/defold-1.12.4/window.d.ts +1 -16
  91. package/generated/versions/defold-1.13.0/b2d_body.d.ts +10 -55
  92. package/generated/versions/defold-1.13.0/b2d_fixture.d.ts +25 -25
  93. package/generated/versions/defold-1.13.0/b2d_shape.d.ts +169 -8
  94. package/generated/versions/defold-1.13.0/b2d_world.d.ts +16 -10
  95. package/generated/versions/defold-1.13.0/buffer.d.ts +1 -3
  96. package/generated/versions/defold-1.13.0/camera.d.ts +25 -25
  97. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +9 -9
  98. package/generated/versions/defold-1.13.0/collectionproxy.d.ts +2 -2
  99. package/generated/versions/defold-1.13.0/compute.d.ts +0 -69
  100. package/generated/versions/defold-1.13.0/crash.d.ts +2 -2
  101. package/generated/versions/defold-1.13.0/editor-vm/tilemap_tiles.d.ts +3 -3
  102. package/generated/versions/defold-1.13.0/editor.d.ts +34 -24
  103. package/generated/versions/defold-1.13.0/factory.d.ts +15 -16
  104. package/generated/versions/defold-1.13.0/go.d.ts +6 -12
  105. package/generated/versions/defold-1.13.0/graphics.d.ts +73 -37
  106. package/generated/versions/defold-1.13.0/gui.d.ts +77 -175
  107. package/generated/versions/defold-1.13.0/html5.d.ts +1 -1
  108. package/generated/versions/defold-1.13.0/http.d.ts +0 -13
  109. package/generated/versions/defold-1.13.0/image.d.ts +16 -33
  110. package/generated/versions/defold-1.13.0/index.d.ts +1 -0
  111. package/generated/versions/defold-1.13.0/json.d.ts +10 -6
  112. package/generated/versions/defold-1.13.0/label.d.ts +2 -3
  113. package/generated/versions/defold-1.13.0/liveupdate.d.ts +7 -5
  114. package/generated/versions/defold-1.13.0/material.d.ts +68 -106
  115. package/generated/versions/defold-1.13.0/model.d.ts +2 -10
  116. package/generated/versions/defold-1.13.0/particlefx.d.ts +2 -5
  117. package/generated/versions/defold-1.13.0/physics.d.ts +69 -67
  118. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -5
  119. package/generated/versions/defold-1.13.0/render.d.ts +99 -128
  120. package/generated/versions/defold-1.13.0/resource.d.ts +126 -150
  121. package/generated/versions/defold-1.13.0/socket.d.ts +34 -60
  122. package/generated/versions/defold-1.13.0/sound.d.ts +8 -8
  123. package/generated/versions/defold-1.13.0/sprite.d.ts +15 -5
  124. package/generated/versions/defold-1.13.0/sys.d.ts +37 -71
  125. package/generated/versions/defold-1.13.0/tilemap.d.ts +18 -11
  126. package/generated/versions/defold-1.13.0/timer.d.ts +5 -3
  127. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -21
  128. package/generated/versions/defold-1.13.0/window.d.ts +1 -16
  129. package/generated/versions/defold-1.13.1/b2d.d.ts +33 -0
  130. package/generated/versions/defold-1.13.1/b2d_body.d.ts +636 -0
  131. package/generated/versions/defold-1.13.1/b2d_chain.d.ts +106 -0
  132. package/generated/versions/defold-1.13.1/b2d_fixture.d.ts +157 -0
  133. package/generated/versions/defold-1.13.1/b2d_joint.d.ts +823 -0
  134. package/generated/versions/defold-1.13.1/b2d_shape.d.ts +400 -0
  135. package/generated/versions/defold-1.13.1/b2d_world.d.ts +320 -0
  136. package/generated/versions/defold-1.13.1/buffer.d.ts +189 -0
  137. package/generated/versions/defold-1.13.1/camera.d.ts +303 -0
  138. package/generated/versions/defold-1.13.1/collectionfactory.d.ts +151 -0
  139. package/generated/versions/defold-1.13.1/collectionproxy.d.ts +93 -0
  140. package/generated/versions/defold-1.13.1/compute.d.ts +237 -0
  141. package/generated/versions/defold-1.13.1/crash.d.ts +143 -0
  142. package/generated/versions/defold-1.13.1/editor-vm/http.d.ts +56 -0
  143. package/generated/versions/defold-1.13.1/editor-vm/image.d.ts +48 -0
  144. package/generated/versions/defold-1.13.1/editor-vm/json.d.ts +10 -0
  145. package/generated/versions/defold-1.13.1/editor-vm/localization.d.ts +42 -0
  146. package/generated/versions/defold-1.13.1/editor-vm/tilemap_tiles.d.ts +80 -0
  147. package/generated/versions/defold-1.13.1/editor-vm/zip.d.ts +10 -0
  148. package/generated/versions/defold-1.13.1/editor-vm/zlib.d.ts +24 -0
  149. package/generated/versions/defold-1.13.1/editor.d.ts +1121 -0
  150. package/generated/versions/defold-1.13.1/factory.d.ts +124 -0
  151. package/generated/versions/defold-1.13.1/font.d.ts +81 -0
  152. package/generated/versions/defold-1.13.1/go.d.ts +1107 -0
  153. package/generated/versions/defold-1.13.1/graphics.d.ts +411 -0
  154. package/generated/versions/defold-1.13.1/gui.d.ts +2353 -0
  155. package/generated/versions/defold-1.13.1/html5.d.ts +55 -0
  156. package/generated/versions/defold-1.13.1/http.d.ts +77 -0
  157. package/generated/versions/defold-1.13.1/image.d.ts +131 -0
  158. package/generated/versions/defold-1.13.1/index.d.ts +57 -0
  159. package/generated/versions/defold-1.13.1/json.d.ts +80 -0
  160. package/generated/versions/defold-1.13.1/kinds/editor-script.d.ts +14 -0
  161. package/generated/versions/defold-1.13.1/label.d.ts +93 -0
  162. package/generated/versions/defold-1.13.1/liveupdate.d.ts +142 -0
  163. package/generated/versions/defold-1.13.1/material.d.ts +408 -0
  164. package/generated/versions/defold-1.13.1/model.d.ts +272 -0
  165. package/generated/versions/defold-1.13.1/msg.d.ts +10 -0
  166. package/generated/versions/defold-1.13.1/particlefx.d.ts +163 -0
  167. package/generated/versions/defold-1.13.1/physics.d.ts +559 -0
  168. package/generated/versions/defold-1.13.1/profiler.d.ts +235 -0
  169. package/generated/versions/defold-1.13.1/render.d.ts +1190 -0
  170. package/generated/versions/defold-1.13.1/resource.d.ts +1523 -0
  171. package/generated/versions/defold-1.13.1/socket.d.ts +784 -0
  172. package/generated/versions/defold-1.13.1/sound.d.ts +292 -0
  173. package/generated/versions/defold-1.13.1/sprite.d.ts +175 -0
  174. package/generated/versions/defold-1.13.1/sys.d.ts +678 -0
  175. package/generated/versions/defold-1.13.1/tilemap.d.ts +208 -0
  176. package/generated/versions/defold-1.13.1/timer.d.ts +125 -0
  177. package/generated/versions/defold-1.13.1/types.d.ts +61 -0
  178. package/generated/versions/defold-1.13.1/vmath.d.ts +774 -0
  179. package/generated/versions/defold-1.13.1/window.d.ts +183 -0
  180. package/generated/versions/defold-1.13.1/zlib.d.ts +41 -0
  181. package/generated/vmath.d.ts +1 -21
  182. package/generated/window.d.ts +71 -71
  183. package/identity-vocabulary.json +561 -0
  184. package/index.d.ts +7 -0
  185. package/package.json +18 -2
  186. package/scripts/example-store-io.ts +12 -1
  187. package/scripts/extension-goldens.ts +1 -0
  188. package/scripts/fidelity-baseline.json +146 -46
  189. package/scripts/generate-api-availability.ts +90 -12
  190. package/scripts/generate-api-signatures.ts +12 -2
  191. package/scripts/import-defold-release.ts +106 -26
  192. package/scripts/prose-constants.ts +77 -16
  193. package/scripts/regen.ts +391 -77
  194. package/scripts/shared-handle-methods.ts +53 -0
  195. package/scripts/signature-store-fs.ts +1 -0
  196. package/scripts/sync-api-docs.ts +48 -10
  197. package/src/api-availability.ts +0 -0
  198. package/src/api-doc.ts +201 -3
  199. package/src/api-identity.ts +252 -0
  200. package/src/core-types.ts +26 -3
  201. package/src/correction-pins.ts +49 -0
  202. package/src/doc-comment.ts +104 -11
  203. package/src/doc-corrections.ts +108 -0
  204. package/src/editor-vm-globals.d.ts +5 -2
  205. package/src/emit-dts.ts +2064 -281
  206. package/src/emit-messages.ts +52 -0
  207. package/src/example-store.ts +125 -14
  208. package/src/field-correction-coverage.ts +204 -0
  209. package/src/fnv1a.ts +16 -0
  210. package/src/go-overloads.d.ts +25 -6
  211. package/src/index-base-table.ts +145 -0
  212. package/src/index-slot-classifications.ts +588 -0
  213. package/src/index.ts +38 -5
  214. package/src/library-index-slot-classifications.ts +332 -0
  215. package/src/lifecycle.ts +61 -199
  216. package/src/luals-type-expr.ts +354 -0
  217. package/src/msg-overloads.d.ts +0 -1
  218. package/src/param-correction-provenance.ts +8 -11
  219. package/src/render-overloads.d.ts +0 -15
  220. package/src/return-correction-provenance.ts +58 -16
  221. package/src/sys-overloads.d.ts +48 -0
  222. package/src/vmath-overloads.d.ts +27 -1
  223. package/src/window-event-guard.d.ts +6 -9
  224. package/url-parameters.json +1 -2
@@ -0,0 +1,818 @@
1
+ /** @noSelfInFile */
2
+ import type { Opaque, Quaternion, Vector3 } from "../src/core-types";
3
+
4
+ declare global {
5
+ /**
6
+ * Creates and controls Bullet constraints between Defold rigid bodies. A
7
+ * constraint belongs to the supplied world and is destroyed automatically
8
+ * with either body, with the world, or when the module is finalized. It is
9
+ * temporarily removed from the native world while either linked body is
10
+ * disabled and is restored when both bodies are enabled again. Dropping its
11
+ * Lua userdata does not destroy the native constraint; call `destroy` for
12
+ * early release.
13
+ *
14
+ * Creator positions and all other linear values use Defold units and are
15
+ * converted with `physics.scale`. Angles are radians. Axes are one-based in
16
+ * Lua: axes 1-3 are linear and axes 4-6 are angular. Mutating functions cannot
17
+ * be called while the physics world is stepping. Floating-point and vector
18
+ * inputs must be finite. Axis vectors must be non-zero and are normalized.
19
+ * Input rotations must be finite, non-zero quaternions and are normalized by
20
+ * the binding.
21
+ *
22
+ * `CONSTRAINT_TYPE_*` values identify the concrete constraint exposed by this
23
+ * binding. This deliberately distinguishes universal, hinge2, and spring 6-DOF
24
+ * constraints independently of Bullet's internal constraint type hierarchy.
25
+ */
26
+ namespace bullet3d.constraint {
27
+ /**
28
+ * Universal and hinge2 constraint parameters
29
+ */
30
+ interface anchor_axes_params {
31
+ /**
32
+ * world-space anchor
33
+ */
34
+ anchor: Vector3;
35
+ /**
36
+ * first non-zero world-space axis
37
+ */
38
+ axis1: Vector3;
39
+ /**
40
+ * second non-zero world-space axis, orthogonal to `axis1`
41
+ */
42
+ axis2: Vector3;
43
+ /**
44
+ * whether connected bodies can collide; defaults to `false`
45
+ */
46
+ collide_connected?: boolean;
47
+ }
48
+ type btTypedConstraint = Opaque<"btTypedConstraint">;
49
+ /**
50
+ * The frame-B fields are required for a two-body constraint.
51
+ */
52
+ interface cone_twist_params {
53
+ /**
54
+ * local body-A frame position
55
+ */
56
+ frame_a_position: Vector3;
57
+ /**
58
+ * local body-A frame rotation
59
+ */
60
+ frame_a_rotation: Quaternion;
61
+ /**
62
+ * local body-B frame position
63
+ */
64
+ frame_b_position?: Vector3;
65
+ /**
66
+ * local body-B frame rotation
67
+ */
68
+ frame_b_rotation?: Quaternion;
69
+ /**
70
+ * whether to constrain angular motion only
71
+ */
72
+ angular_only?: boolean;
73
+ /**
74
+ * whether connected bodies can collide; defaults to `false`
75
+ */
76
+ collide_connected?: boolean;
77
+ }
78
+ /**
79
+ * The frame-B fields are required for a two-body constraint.
80
+ */
81
+ interface generic_6dof_params {
82
+ /**
83
+ * local body-A frame position
84
+ */
85
+ frame_a_position: Vector3;
86
+ /**
87
+ * local body-A frame rotation
88
+ */
89
+ frame_a_rotation: Quaternion;
90
+ /**
91
+ * local body-B frame position
92
+ */
93
+ frame_b_position?: Vector3;
94
+ /**
95
+ * local body-B frame rotation
96
+ */
97
+ frame_b_rotation?: Quaternion;
98
+ /**
99
+ * whether connected bodies can collide; defaults to `false`
100
+ */
101
+ collide_connected?: boolean;
102
+ }
103
+ /**
104
+ * Generic spring 6-DOF constraint parameters
105
+ */
106
+ interface generic_6dof_spring_params {
107
+ /**
108
+ * local body-A frame position
109
+ */
110
+ frame_a_position: Vector3;
111
+ /**
112
+ * local body-A frame rotation
113
+ */
114
+ frame_a_rotation: Quaternion;
115
+ /**
116
+ * local body-B frame position
117
+ */
118
+ frame_b_position: Vector3;
119
+ /**
120
+ * local body-B frame rotation
121
+ */
122
+ frame_b_rotation: Quaternion;
123
+ /**
124
+ * whether connected bodies can collide; defaults to `false`
125
+ */
126
+ collide_connected?: boolean;
127
+ }
128
+ /**
129
+ * The frame-B fields are required for a two-body constraint.
130
+ */
131
+ interface hinge_params {
132
+ /**
133
+ * local body-A frame position
134
+ */
135
+ frame_a_position: Vector3;
136
+ /**
137
+ * local body-A frame rotation
138
+ */
139
+ frame_a_rotation: Quaternion;
140
+ /**
141
+ * local body-B frame position
142
+ */
143
+ frame_b_position?: Vector3;
144
+ /**
145
+ * local body-B frame rotation
146
+ */
147
+ frame_b_rotation?: Quaternion;
148
+ /**
149
+ * whether angular calculations reference frame A
150
+ */
151
+ use_reference_frame_a?: boolean;
152
+ /**
153
+ * whether to constrain angular motion only
154
+ */
155
+ angular_only?: boolean;
156
+ /**
157
+ * whether connected bodies can collide; defaults to `false`
158
+ */
159
+ collide_connected?: boolean;
160
+ }
161
+ /**
162
+ * `pivot_b` is required for a two-body constraint. For a one-body constraint,
163
+ * it is an optional world-space anchor.
164
+ */
165
+ interface point_to_point_params {
166
+ /**
167
+ * local body-A pivot
168
+ */
169
+ pivot_a: Vector3;
170
+ /**
171
+ * local body-B pivot or world-space anchor
172
+ */
173
+ pivot_b?: Vector3;
174
+ /**
175
+ * whether connected bodies can collide; defaults to `false`
176
+ */
177
+ collide_connected?: boolean;
178
+ }
179
+ /**
180
+ * The frame-B fields are required for a two-body constraint.
181
+ */
182
+ interface slider_params {
183
+ /**
184
+ * local body-A frame position
185
+ */
186
+ frame_a_position: Vector3;
187
+ /**
188
+ * local body-A frame rotation
189
+ */
190
+ frame_a_rotation: Quaternion;
191
+ /**
192
+ * local body-B frame position
193
+ */
194
+ frame_b_position?: Vector3;
195
+ /**
196
+ * local body-B frame rotation
197
+ */
198
+ frame_b_rotation?: Quaternion;
199
+ /**
200
+ * whether linear calculations reference frame A
201
+ */
202
+ use_linear_reference_frame_a?: boolean;
203
+ /**
204
+ * whether connected bodies can collide; defaults to `false`
205
+ */
206
+ collide_connected?: boolean;
207
+ }
208
+ type CONSTRAINT_TYPE = typeof bullet3d.constraint.CONSTRAINT_TYPE_CONE_TWIST | typeof bullet3d.constraint.CONSTRAINT_TYPE_GENERIC_6DOF | typeof bullet3d.constraint.CONSTRAINT_TYPE_GENERIC_6DOF_SPRING | typeof bullet3d.constraint.CONSTRAINT_TYPE_HINGE | typeof bullet3d.constraint.CONSTRAINT_TYPE_HINGE2 | typeof bullet3d.constraint.CONSTRAINT_TYPE_POINT_TO_POINT | typeof bullet3d.constraint.CONSTRAINT_TYPE_SLIDER | typeof bullet3d.constraint.CONSTRAINT_TYPE_UNIVERSAL;
209
+ /**
210
+ * Cone-twist constraint type
211
+ */
212
+ const CONSTRAINT_TYPE_CONE_TWIST: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_CONE_TWIST" };
213
+ /**
214
+ * Generic 6-DOF constraint type
215
+ */
216
+ const CONSTRAINT_TYPE_GENERIC_6DOF: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_GENERIC_6DOF" };
217
+ /**
218
+ * Generic spring 6-DOF constraint type
219
+ */
220
+ const CONSTRAINT_TYPE_GENERIC_6DOF_SPRING: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_GENERIC_6DOF_SPRING" };
221
+ /**
222
+ * Hinge constraint type
223
+ */
224
+ const CONSTRAINT_TYPE_HINGE: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_HINGE" };
225
+ /**
226
+ * Hinge2 constraint type
227
+ */
228
+ const CONSTRAINT_TYPE_HINGE2: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_HINGE2" };
229
+ /**
230
+ * Point-to-point constraint type
231
+ */
232
+ const CONSTRAINT_TYPE_POINT_TO_POINT: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_POINT_TO_POINT" };
233
+ /**
234
+ * Slider constraint type
235
+ */
236
+ const CONSTRAINT_TYPE_SLIDER: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_SLIDER" };
237
+ /**
238
+ * Universal constraint type
239
+ */
240
+ const CONSTRAINT_TYPE_UNIVERSAL: number & { readonly __brand: "bullet3d.constraint.CONSTRAINT_TYPE_UNIVERSAL" };
241
+ /**
242
+ * The world is derived from `body_a`.
243
+ *
244
+ * @param body_a - first body
245
+ * @param body_b - second body or world
246
+ * @param params - local frames and options
247
+ * @returns cone-twist constraint
248
+ */
249
+ function create_cone_twist(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody"> | undefined, params: bullet3d.constraint.cone_twist_params): bullet3d.constraint.btTypedConstraint;
250
+ /**
251
+ * The params table requires local frame A and, for a two-body constraint,
252
+ * local frame B. It optionally accepts `collide_connected`. The world is
253
+ * derived from `body_a`. The active 6-DOF solver ignores its legacy
254
+ * linear-reference-frame selector, so that field is rejected rather than
255
+ * silently accepted.
256
+ *
257
+ * @param body_a - first body
258
+ * @param body_b - second body or world
259
+ * @param params - local frames and options
260
+ * @returns generic 6-DOF constraint
261
+ */
262
+ function create_generic_6dof(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody"> | undefined, params: bullet3d.constraint.generic_6dof_params): bullet3d.constraint.btTypedConstraint;
263
+ /**
264
+ * Both bodies and both local frames are required. The params table optionally
265
+ * accepts `collide_connected`. The world is derived from `body_a`. The active
266
+ * spring 6-DOF solver ignores its legacy linear-reference-frame selector, so
267
+ * that field is rejected rather than silently accepted.
268
+ *
269
+ * @param body_a - first body
270
+ * @param body_b - second body
271
+ * @param params - local frames and options
272
+ * @returns spring 6-DOF constraint
273
+ * @example
274
+ * ```ts
275
+ * // Create a spring that moves along its first linear axis:
276
+ * export default defineScript({
277
+ * init() {
278
+ * const body_a = bullet3d.get_rigid_body("/body_a#collisionobject");
279
+ * const body_b = bullet3d.get_rigid_body("/body_b#collisionobject");
280
+ * let spring: bullet3d.constraint.btTypedConstraint | undefined;
281
+ * if (body_a !== undefined && body_b !== undefined) {
282
+ * spring = bullet3d.constraint.create_generic_6dof_spring(body_a, body_b, {
283
+ * frame_a_position: vmath.vector3(),
284
+ * frame_a_rotation: vmath.quat(),
285
+ * frame_b_position: vmath.vector3(),
286
+ * frame_b_rotation: vmath.quat(),
287
+ * });
288
+ * bullet3d.constraint.set_limit(spring, 1, -1, 1);
289
+ * bullet3d.constraint.enable_spring(spring, 1, true);
290
+ * bullet3d.constraint.set_spring_stiffness(spring, 1, 20);
291
+ * bullet3d.constraint.set_spring_damping(spring, 1, 0.5);
292
+ * bullet3d.constraint.set_spring_equilibrium_point(spring, 1, 0);
293
+ * }
294
+ * return { spring };
295
+ * },
296
+ *
297
+ * final(self) {
298
+ * if (self.spring !== undefined && bullet3d.constraint.is_valid(self.spring)) {
299
+ * bullet3d.constraint.destroy(self.spring);
300
+ * }
301
+ * },
302
+ * });
303
+ * ```
304
+ */
305
+ function create_generic_6dof_spring(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody">, params: bullet3d.constraint.generic_6dof_spring_params): bullet3d.constraint.btTypedConstraint;
306
+ /**
307
+ * The world is derived from `body_a`.
308
+ *
309
+ * @param body_a - first body
310
+ * @param body_b - second body or world
311
+ * @param params - local frames and options
312
+ * @returns hinge constraint
313
+ * @example
314
+ * ```ts
315
+ * // Create a motorized hinge with a 90-degree range:
316
+ * export default defineScript({
317
+ * init() {
318
+ * const body_a = bullet3d.get_rigid_body("/door#collisionobject");
319
+ * const body_b = bullet3d.get_rigid_body("/frame#collisionobject");
320
+ * let hinge: bullet3d.constraint.btTypedConstraint | undefined;
321
+ * if (body_a !== undefined) {
322
+ * hinge = bullet3d.constraint.create_hinge(body_a, body_b, {
323
+ * frame_a_position: vmath.vector3(-0.5, 0, 0),
324
+ * frame_a_rotation: vmath.quat(),
325
+ * frame_b_position: vmath.vector3(0.5, 0, 0),
326
+ * frame_b_rotation: vmath.quat(),
327
+ * });
328
+ * bullet3d.constraint.set_hinge_limits(hinge, -math.pi / 4, math.pi / 4);
329
+ * bullet3d.constraint.set_hinge_motor(hinge, true, 1.5, 2.5);
330
+ * }
331
+ * return { hinge };
332
+ * },
333
+ *
334
+ * final(self) {
335
+ * if (self.hinge !== undefined && bullet3d.constraint.is_valid(self.hinge)) {
336
+ * bullet3d.constraint.destroy(self.hinge);
337
+ * }
338
+ * },
339
+ * });
340
+ * ```
341
+ */
342
+ function create_hinge(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody"> | undefined, params: bullet3d.constraint.hinge_params): bullet3d.constraint.btTypedConstraint;
343
+ /**
344
+ * Both bodies are required. Its initial linear suspension travel is one Defold
345
+ * unit in either direction. The world is derived from `body_a`.
346
+ *
347
+ * @param body_a - first body
348
+ * @param body_b - second body
349
+ * @param params - anchor, axes, and options
350
+ * @returns hinge2 constraint
351
+ */
352
+ function create_hinge2(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody">, params: bullet3d.constraint.anchor_axes_params): bullet3d.constraint.btTypedConstraint;
353
+ /**
354
+ * The world is derived from `body_a`; both bodies must belong to that same world.
355
+ *
356
+ * @param body_a - first body
357
+ * @param body_b - second body or world
358
+ * @param params - pivots and options
359
+ * @returns point-to-point constraint
360
+ * @example
361
+ * ```ts
362
+ * // Join two bodies at matching local pivots and explicitly destroy the
363
+ * // constraint when the script is finalized:
364
+ * export default defineScript({
365
+ * init() {
366
+ * const body_a = bullet3d.get_rigid_body("/body_a#collisionobject");
367
+ * const body_b = bullet3d.get_rigid_body("/body_b#collisionobject");
368
+ * let constraint: bullet3d.constraint.btTypedConstraint | undefined;
369
+ * if (body_a !== undefined) {
370
+ * constraint = bullet3d.constraint.create_point_to_point(body_a, body_b, {
371
+ * pivot_a: vmath.vector3(0.5, 0, 0),
372
+ * pivot_b: vmath.vector3(-0.5, 0, 0),
373
+ * });
374
+ * }
375
+ * return { constraint };
376
+ * },
377
+ *
378
+ * final(self) {
379
+ * if (self.constraint !== undefined && bullet3d.constraint.is_valid(self.constraint)) {
380
+ * bullet3d.constraint.destroy(self.constraint);
381
+ * }
382
+ * },
383
+ * });
384
+ * ```
385
+ */
386
+ function create_point_to_point(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody"> | undefined, params: bullet3d.constraint.point_to_point_params): bullet3d.constraint.btTypedConstraint;
387
+ /**
388
+ * The world is derived from `body_a`.
389
+ *
390
+ * @param body_a - first body
391
+ * @param body_b - second body or world
392
+ * @param params - local frames and options
393
+ * @returns slider constraint
394
+ */
395
+ function create_slider(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody"> | undefined, params: bullet3d.constraint.slider_params): bullet3d.constraint.btTypedConstraint;
396
+ /**
397
+ * Both bodies are required. The world is derived from `body_a`.
398
+ *
399
+ * @param body_a - first body
400
+ * @param body_b - second body
401
+ * @param params - anchor, axes, and options
402
+ * @returns universal constraint
403
+ */
404
+ function create_universal(body_a: Opaque<"btRigidBody">, body_b: Opaque<"btRigidBody">, params: bullet3d.constraint.anchor_axes_params): bullet3d.constraint.btTypedConstraint;
405
+ /**
406
+ * Destroy a constraint
407
+ *
408
+ * @param constraint - constraint
409
+ */
410
+ function destroy(constraint: bullet3d.constraint.btTypedConstraint): void;
411
+ /**
412
+ * Enable or disable the cone-twist motor
413
+ *
414
+ * @param constraint - cone-twist constraint
415
+ * @param enabled - motor state
416
+ */
417
+ function enable_cone_twist_motor(constraint: bullet3d.constraint.btTypedConstraint, enabled: boolean): void;
418
+ /**
419
+ * Enable or disable a spring axis
420
+ *
421
+ * @param constraint - spring 6-DOF or hinge2 constraint
422
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
423
+ * @param enabled - spring state
424
+ */
425
+ function enable_spring(constraint: bullet3d.constraint.btTypedConstraint, axis: number, enabled: boolean): void;
426
+ /**
427
+ * Get a current 6-DOF angle
428
+ *
429
+ * @param constraint - 6-DOF-derived constraint
430
+ * @param axis - one-based angular-axis index from 1 to 3. **⚠️ 1-based; passed to Defold unchanged.**
431
+ * @returns current angle in radians
432
+ */
433
+ function get_6dof_angle(constraint: bullet3d.constraint.btTypedConstraint, axis: number): number;
434
+ /**
435
+ * Get a current 6-DOF angular axis
436
+ *
437
+ * @param constraint - 6-DOF-derived constraint
438
+ * @param axis - one-based angular-axis index from 1 to 3. **⚠️ 1-based; passed to Defold unchanged.**
439
+ * @returns world-space unit axis
440
+ */
441
+ function get_6dof_axis(constraint: bullet3d.constraint.btTypedConstraint, axis: number): Vector3;
442
+ /**
443
+ * Axes 1-3 are linear and axes 4-6 are angular. Generic 6-DOF, generic spring
444
+ * 6-DOF, and universal constraints support bounce only on angular axes; hinge2
445
+ * supports it on every axis. Linear target velocity uses Defold units per
446
+ * second and angular target velocity uses radians per second. `max_force` is a
447
+ * force for linear axes and a torque in Defold squared units for angular axes.
448
+ *
449
+ * @param constraint - 6-DOF-derived constraint
450
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
451
+ */
452
+ function get_6dof_motor(constraint: bullet3d.constraint.btTypedConstraint, axis: number): LuaMultiReturn<[boolean, number, number, number]>;
453
+ /**
454
+ * Get a current 6-DOF linear position
455
+ *
456
+ * @param constraint - 6-DOF-derived constraint
457
+ * @param axis - one-based linear-axis index from 1 to 3. **⚠️ 1-based; passed to Defold unchanged.**
458
+ * @returns relative position in Defold units
459
+ */
460
+ function get_6dof_position(constraint: bullet3d.constraint.btTypedConstraint, axis: number): number;
461
+ /**
462
+ * Get universal or hinge2 anchors
463
+ *
464
+ * @param constraint - universal or hinge2 constraint
465
+ */
466
+ function get_anchors(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[Vector3, Vector3]>;
467
+ /**
468
+ * Get universal or hinge2 angles
469
+ *
470
+ * @param constraint - universal or hinge2 constraint
471
+ */
472
+ function get_angles(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[number, number]>;
473
+ /**
474
+ * Get universal or hinge2 axes
475
+ *
476
+ * @param constraint - universal or hinge2 constraint
477
+ */
478
+ function get_axes(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[Vector3, Vector3]>;
479
+ /**
480
+ * Get the first linked body
481
+ *
482
+ * @param constraint - constraint
483
+ * @returns first body
484
+ */
485
+ function get_body_a(constraint: bullet3d.constraint.btTypedConstraint): Opaque<"btRigidBody">;
486
+ /**
487
+ * Get the second linked body
488
+ *
489
+ * @param constraint - constraint
490
+ * @returns second body, or nil for a world constraint
491
+ */
492
+ function get_body_b(constraint: bullet3d.constraint.btTypedConstraint): Opaque<"btRigidBody"> | undefined;
493
+ /**
494
+ * Get whether connected bodies can collide
495
+ *
496
+ * @param constraint - constraint
497
+ * @returns whether connected bodies can collide
498
+ */
499
+ function get_collide_connected(constraint: bullet3d.constraint.btTypedConstraint): boolean;
500
+ /**
501
+ * Get cone-twist angular spans
502
+ *
503
+ * @param constraint - cone-twist constraint
504
+ */
505
+ function get_cone_twist_limits(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[number, number, number]>;
506
+ /**
507
+ * Supported constraint types are hinge, cone-twist, generic 6-DOF, generic
508
+ * spring 6-DOF, slider, universal, and hinge2. Point-to-point constraints use
509
+ * `get_pivots` instead.
510
+ * Returns position and rotation. For one-body generic 6-DOF and slider
511
+ * constraints this is the user-body frame, despite Bullet storing it as its
512
+ * native frame B.
513
+ *
514
+ * @param constraint - framed constraint
515
+ */
516
+ function get_frame_a(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[Vector3, Quaternion]>;
517
+ /**
518
+ * Supports the same constraint types as `get_frame_a`. For a one-body
519
+ * constraint, this is the frame attached to the fixed world body.
520
+ *
521
+ * @param constraint - framed constraint
522
+ */
523
+ function get_frame_b(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[Vector3, Quaternion]>;
524
+ /**
525
+ * Get the current hinge angle
526
+ *
527
+ * @param constraint - hinge constraint
528
+ * @returns angle in radians
529
+ */
530
+ function get_hinge_angle(constraint: bullet3d.constraint.btTypedConstraint): number;
531
+ /**
532
+ * Get hinge angular limits
533
+ *
534
+ * @param constraint - hinge constraint
535
+ */
536
+ function get_hinge_limits(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[number, number]>;
537
+ /**
538
+ * Get hinge motor settings
539
+ *
540
+ * @param constraint - hinge constraint
541
+ */
542
+ function get_hinge_motor(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[boolean, number, number]>;
543
+ /**
544
+ * Axes 1-3 return linear limits in Defold units. Axes 4-6 return angular
545
+ * limits in radians.
546
+ *
547
+ * @param constraint - 6-DOF-derived constraint
548
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
549
+ */
550
+ function get_limit(constraint: bullet3d.constraint.btTypedConstraint, axis: number): LuaMultiReturn<[number, number]>;
551
+ /**
552
+ * Get point-to-point pivots
553
+ *
554
+ * @param constraint - point-to-point constraint
555
+ */
556
+ function get_pivots(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[Vector3, Vector3]>;
557
+ /**
558
+ * Get slider limits
559
+ *
560
+ * @param constraint - slider constraint
561
+ */
562
+ function get_slider_limits(constraint: bullet3d.constraint.btTypedConstraint): LuaMultiReturn<[number, number, number, number]>;
563
+ /**
564
+ * The linear motor uses Defold units per second and maximum force. The angular
565
+ * motor uses radians per second and maximum torque in Defold squared units.
566
+ *
567
+ * @param constraint - slider constraint
568
+ * @param motor - `linear` or `angular`
569
+ */
570
+ function get_slider_motor(constraint: bullet3d.constraint.btTypedConstraint, motor: string): LuaMultiReturn<[boolean, number, number]>;
571
+ /**
572
+ * Get the current slider position
573
+ *
574
+ * @param constraint - slider constraint
575
+ * @returns current linear position in Defold units
576
+ */
577
+ function get_slider_position(constraint: bullet3d.constraint.btTypedConstraint): number;
578
+ /**
579
+ * Get the current cone-twist twist angle
580
+ *
581
+ * @param constraint - cone-twist constraint
582
+ * @returns twist angle in radians
583
+ */
584
+ function get_twist_angle(constraint: bullet3d.constraint.btTypedConstraint): number;
585
+ /**
586
+ * Get the constraint type
587
+ *
588
+ * @param constraint - constraint
589
+ * @returns constraint type
590
+ */
591
+ function get_type(constraint: bullet3d.constraint.btTypedConstraint): bullet3d.constraint.CONSTRAINT_TYPE;
592
+ /**
593
+ * Returns a stable lowercase diagnostic name such as `"hinge"` or
594
+ * `"generic_6dof_spring"`.
595
+ *
596
+ * @param constraint - constraint
597
+ * @returns constraint type name
598
+ */
599
+ function get_type_name(constraint: bullet3d.constraint.btTypedConstraint): string;
600
+ /**
601
+ * Get the slider linear reference-frame choice
602
+ *
603
+ * @param constraint - slider constraint
604
+ * @returns true when linear calculations reference frame A
605
+ */
606
+ function get_use_linear_reference_frame_a(constraint: bullet3d.constraint.btTypedConstraint): boolean;
607
+ /**
608
+ * Get the owning world
609
+ *
610
+ * @param constraint - constraint
611
+ * @returns owning world
612
+ */
613
+ function get_world(constraint: bullet3d.constraint.btTypedConstraint): bullet3d.btDiscreteDynamicsWorld;
614
+ /**
615
+ * Test whether a constraint is active in its world
616
+ *
617
+ * @param constraint - constraint
618
+ * @returns false while a linked body is disabled
619
+ */
620
+ function is_active(constraint: bullet3d.constraint.btTypedConstraint): boolean;
621
+ /**
622
+ * Test angular-only mode
623
+ *
624
+ * @param constraint - hinge or cone-twist constraint
625
+ * @returns angular-only state
626
+ */
627
+ function is_angular_only(constraint: bullet3d.constraint.btTypedConstraint): boolean;
628
+ /**
629
+ * Both a ranged and a locked axis are considered limited; a free axis is not.
630
+ *
631
+ * @param constraint - 6-DOF-derived constraint
632
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
633
+ * @returns limit state
634
+ */
635
+ function is_limited(constraint: bullet3d.constraint.btTypedConstraint, axis: number): boolean;
636
+ /**
637
+ * Test whether a cone-twist is past its swing limit
638
+ *
639
+ * @param constraint - cone-twist constraint
640
+ * @returns swing-limit state
641
+ */
642
+ function is_past_swing_limit(constraint: bullet3d.constraint.btTypedConstraint): boolean;
643
+ /**
644
+ * Test whether a constraint handle is valid
645
+ *
646
+ * @param constraint - constraint handle
647
+ * @returns true while the native constraint exists
648
+ */
649
+ function is_valid(constraint: bullet3d.constraint.btTypedConstraint): boolean;
650
+ /**
651
+ * Linear and angular values use the units described by `get_6dof_motor`.
652
+ *
653
+ * @param constraint - 6-DOF-derived constraint
654
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
655
+ * @param enabled - motor state
656
+ * @param target_velocity - linear or angular target velocity
657
+ * @param max_force - non-negative maximum motor force for linear axes or torque for angular axes
658
+ * @param bounce - optional bounce from 0 to 1; defaults to `0`
659
+ */
660
+ function set_6dof_motor(constraint: bullet3d.constraint.btTypedConstraint, axis: number, enabled: boolean, target_velocity: number, max_force: number, bounce?: number): void;
661
+ /**
662
+ * Set angular-only mode
663
+ *
664
+ * @param constraint - hinge or cone-twist constraint
665
+ * @param angular_only - angular-only state
666
+ */
667
+ function set_angular_only(constraint: bullet3d.constraint.btTypedConstraint, angular_only: boolean): void;
668
+ /**
669
+ * Set cone-twist angular spans
670
+ *
671
+ * @param constraint - cone-twist constraint
672
+ * @param swing_span_1 - non-negative first swing span in radians
673
+ * @param swing_span_2 - non-negative second swing span in radians
674
+ * @param twist_span - non-negative twist span in radians
675
+ * @param softness - optional softness from 0 to 1; defaults to `1`
676
+ * @param bias - optional bias from 0 to 1; defaults to `0.3`
677
+ * @param relaxation - optional relaxation from 0 to 1; defaults to `1`
678
+ */
679
+ function set_cone_twist_limits(constraint: bullet3d.constraint.btTypedConstraint, swing_span_1: number, swing_span_2: number, twist_span: number, softness?: number, bias?: number, relaxation?: number): void;
680
+ /**
681
+ * By default, `target` is the desired rotation of body A relative to body B.
682
+ * With `constraint_space` set, it is the desired rotation of frame A relative
683
+ * to frame B in constraint space.
684
+ *
685
+ * @param constraint - cone-twist constraint
686
+ * @param target - finite, non-zero target orientation; normalized by the binding
687
+ * @param constraint_space - optional target-is-in-constraint-space flag; defaults to `false`
688
+ */
689
+ function set_cone_twist_motor_target(constraint: bullet3d.constraint.btTypedConstraint, target: Quaternion, constraint_space?: boolean): void;
690
+ /**
691
+ * Frame mutation is supported for hinge, generic 6-DOF, generic spring 6-DOF,
692
+ * and slider constraints. Cone-twist, universal, and hinge2 frames are
693
+ * read-only through this API.
694
+ *
695
+ * @param constraint - mutable framed constraint
696
+ * @param position - finite local position
697
+ * @param rotation - finite, non-zero local rotation; normalized by the binding
698
+ */
699
+ function set_frame_a(constraint: bullet3d.constraint.btTypedConstraint, position: Vector3, rotation: Quaternion): void;
700
+ /**
701
+ * Supports the same constraint types as `set_frame_a`. For a one-body
702
+ * constraint, this changes the frame attached to the fixed world body.
703
+ *
704
+ * @param constraint - mutable framed constraint
705
+ * @param position - finite local position or world frame position
706
+ * @param rotation - finite, non-zero local or world frame rotation; normalized by the binding
707
+ */
708
+ function set_frame_b(constraint: bullet3d.constraint.btTypedConstraint, position: Vector3, rotation: Quaternion): void;
709
+ /**
710
+ * This function only supports hinges attached to the world. For a two-body
711
+ * hinge, change both local frames with `set_frame_a` and `set_frame_b`.
712
+ *
713
+ * @param constraint - one-body hinge constraint
714
+ * @param axis - non-zero axis in body-A space
715
+ */
716
+ function set_hinge_axis(constraint: bullet3d.constraint.btTypedConstraint, axis: Vector3): void;
717
+ /**
718
+ * Set hinge angular limits
719
+ *
720
+ * @param constraint - hinge constraint
721
+ * @param lower - lower angle in radians
722
+ * @param upper - upper angle in radians
723
+ * @param bias - optional limit bias from 0 to 1; defaults to `0.3`
724
+ * @param relaxation - optional relaxation from 0 to 1; defaults to `1`
725
+ */
726
+ function set_hinge_limits(constraint: bullet3d.constraint.btTypedConstraint, lower: number, upper: number, bias?: number, relaxation?: number): void;
727
+ /**
728
+ * Set hinge motor settings
729
+ *
730
+ * @param constraint - hinge constraint
731
+ * @param enabled - motor state
732
+ * @param target_velocity - angular target velocity in radians per second
733
+ * @param max_impulse - non-negative maximum angular motor impulse in Defold squared units
734
+ */
735
+ function set_hinge_motor(constraint: bullet3d.constraint.btTypedConstraint, enabled: boolean, target_velocity: number, max_impulse: number): void;
736
+ /**
737
+ * Set a hinge motor angle target
738
+ *
739
+ * @param constraint - hinge constraint
740
+ * @param target_angle - target angle in radians
741
+ * @param time_step - positive step duration in seconds
742
+ */
743
+ function set_hinge_motor_target(constraint: bullet3d.constraint.btTypedConstraint, target_angle: number, time_step: number): void;
744
+ /**
745
+ * Axes 1-3 use Defold units and axes 4-6 use radians. A lower value less than
746
+ * the upper value creates a limited range, equal values lock the axis, and a
747
+ * lower value greater than the upper value makes the axis free.
748
+ *
749
+ * @param constraint - 6-DOF-derived constraint
750
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
751
+ * @param lower - lower limit
752
+ * @param upper - upper limit
753
+ */
754
+ function set_limit(constraint: bullet3d.constraint.btTypedConstraint, axis: number, lower: number, upper: number): void;
755
+ /**
756
+ * Set point-to-point pivots
757
+ *
758
+ * @param constraint - point-to-point constraint
759
+ * @param pivot_a - local body-A pivot
760
+ * @param pivot_b - local body-B pivot or world anchor
761
+ */
762
+ function set_pivots(constraint: bullet3d.constraint.btTypedConstraint, pivot_a: Vector3, pivot_b: Vector3): void;
763
+ /**
764
+ * Each lower/upper pair follows Bullet's limit convention: lower less than
765
+ * upper creates a limited range, equal values lock that axis, and lower greater
766
+ * than upper makes it free. Bullet normalizes the angular limits.
767
+ *
768
+ * @param constraint - slider constraint
769
+ * @param lower_linear - lower linear limit in Defold units
770
+ * @param upper_linear - upper linear limit in Defold units
771
+ * @param lower_angular - lower angular limit in radians
772
+ * @param upper_angular - upper angular limit in radians
773
+ */
774
+ function set_slider_limits(constraint: bullet3d.constraint.btTypedConstraint, lower_linear: number, upper_linear: number, lower_angular: number, upper_angular: number): void;
775
+ /**
776
+ * Linear and angular values use the units described by `get_slider_motor`.
777
+ *
778
+ * @param constraint - slider constraint
779
+ * @param motor - `linear` or `angular`
780
+ * @param enabled - motor state
781
+ * @param target_velocity - linear or angular target velocity
782
+ * @param max_force - non-negative maximum linear force or angular torque
783
+ */
784
+ function set_slider_motor(constraint: bullet3d.constraint.btTypedConstraint, motor: string, enabled: boolean, target_velocity: number, max_force: number): void;
785
+ /**
786
+ * Generic spring 6-DOF constraints use a scale-independent damping factor from
787
+ * 0 to 1, where 1 means no damping. Hinge2 constraints use a damping coefficient
788
+ * where 0 means no damping and any non-negative value is accepted. Hinge2
789
+ * angular damping is automatically converted using `physics.scale` squared.
790
+ *
791
+ * @param constraint - spring 6-DOF or hinge2 constraint
792
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
793
+ * @param damping - damping value in the range required by the constraint type
794
+ */
795
+ function set_spring_damping(constraint: bullet3d.constraint.btTypedConstraint, axis: number, damping: number): void;
796
+ /**
797
+ * With no axis, captures all current transforms. With an axis and no value,
798
+ * captures that axis. Linear values use Defold units and angular values use
799
+ * radians.
800
+ *
801
+ * @param constraint - spring 6-DOF or hinge2 constraint
802
+ * @param axis - optional one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
803
+ * @param value - optional explicit equilibrium value
804
+ */
805
+ function set_spring_equilibrium_point(constraint: bullet3d.constraint.btTypedConstraint, axis?: number, value?: number): void;
806
+ /**
807
+ * Linear stiffness values are independent of `physics.scale`. Angular
808
+ * stiffness values are automatically converted using `physics.scale` squared.
809
+ *
810
+ * @param constraint - spring 6-DOF or hinge2 constraint
811
+ * @param axis - one-based axis from 1 to 6. **⚠️ 1-based; passed to Defold unchanged.**
812
+ * @param stiffness - non-negative stiffness
813
+ */
814
+ function set_spring_stiffness(constraint: bullet3d.constraint.btTypedConstraint, axis: number, stiffness: number): void;
815
+ }
816
+ }
817
+
818
+ export {};