xray16 1.3.4 → 1.5.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 (84) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +112 -106
  3. package/package.json +45 -42
  4. package/plugins/built_at_info.d.ts +1 -1
  5. package/plugins/from_cast_utils.d.ts +1 -1
  6. package/plugins/global_declarations_transform.d.ts +1 -1
  7. package/plugins/inject_file_meta.d.ts +1 -1
  8. package/plugins/inject_tracy_zones.d.ts +1 -1
  9. package/plugins/inject_tracy_zones.js +2 -2
  10. package/plugins/strip_lua_logger.d.ts +1 -1
  11. package/plugins/strip_lua_logger.js +1 -1
  12. package/plugins/transform_luabind_class/plugin.d.ts +1 -1
  13. package/plugins/transform_luabind_class/transformation/class_declaration.d.ts +3 -3
  14. package/plugins/transform_luabind_class/transformation/decorators.d.ts +5 -2
  15. package/plugins/transform_luabind_class/transformation/decorators.js +3 -0
  16. package/plugins/transform_luabind_class/transformation/members/accessors.d.ts +1 -1
  17. package/plugins/transform_luabind_class/transformation/members/constructor.d.ts +2 -2
  18. package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -2
  19. package/plugins/transform_luabind_class/transformation/members/fields.d.ts +5 -2
  20. package/plugins/transform_luabind_class/transformation/members/fields.js +5 -2
  21. package/plugins/transform_luabind_class/transformation/members/method.d.ts +6 -3
  22. package/plugins/transform_luabind_class/transformation/members/method.js +4 -1
  23. package/plugins/transform_luabind_class/transformation/new.d.ts +7 -3
  24. package/plugins/transform_luabind_class/transformation/new.js +5 -1
  25. package/plugins/transform_luabind_class/transformation/setup.d.ts +9 -3
  26. package/plugins/transform_luabind_class/transformation/setup.js +22 -6
  27. package/plugins/transform_luabind_class/transformation/super.d.ts +19 -3
  28. package/plugins/transform_luabind_class/transformation/super.js +17 -1
  29. package/plugins/transform_luabind_class/transformation/utils.d.ts +27 -4
  30. package/plugins/transform_luabind_class/transformation/utils.js +25 -2
  31. package/plugins/utils/ast.d.ts +1 -1
  32. package/plugins/utils/diagnostics.d.ts +9 -5
  33. package/plugins/utils/diagnostics.js +5 -1
  34. package/plugins/utils/tracy.d.ts +1 -1
  35. package/types/index.d.ts +55 -55
  36. package/types/xr_ai/xr_action.d.ts +1802 -510
  37. package/types/xr_ai/xr_alife.d.ts +1870 -566
  38. package/types/xr_ai/xr_enemy_evaluation.d.ts +134 -41
  39. package/types/xr_ai/xr_goap.d.ts +1116 -668
  40. package/types/xr_ai/xr_graph.d.ts +135 -47
  41. package/types/xr_ai/xr_memory.d.ts +382 -148
  42. package/types/xr_lib/xr_animation.d.ts +252 -81
  43. package/types/xr_lib/xr_bitwise.d.ts +44 -21
  44. package/types/xr_lib/xr_color.d.ts +142 -40
  45. package/types/xr_lib/xr_debug.d.ts +181 -77
  46. package/types/xr_lib/xr_dialog.d.ts +132 -40
  47. package/types/xr_lib/xr_flags.d.ts +592 -148
  48. package/types/xr_lib/xr_fs.d.ts +539 -148
  49. package/types/xr_lib/xr_game.d.ts +362 -158
  50. package/types/xr_lib/xr_hit.d.ts +125 -41
  51. package/types/xr_lib/xr_ini.d.ts +473 -188
  52. package/types/xr_lib/xr_level.d.ts +795 -225
  53. package/types/xr_lib/xr_luabind.d.ts +90 -59
  54. package/types/xr_lib/xr_map.d.ts +192 -61
  55. package/types/xr_lib/xr_math.d.ts +871 -233
  56. package/types/xr_lib/xr_multiplayer.d.ts +1079 -351
  57. package/types/xr_lib/xr_profile.d.ts +272 -160
  58. package/types/xr_lib/xr_properties.d.ts +610 -166
  59. package/types/xr_lib/xr_relation.d.ts +231 -84
  60. package/types/xr_lib/xr_render.d.ts +167 -69
  61. package/types/xr_lib/xr_save.d.ts +833 -223
  62. package/types/xr_lib/xr_sound.d.ts +515 -151
  63. package/types/xr_lib/xr_stats.ts +49 -20
  64. package/types/xr_lib/xr_task.d.ts +388 -111
  65. package/types/xr_lib/xr_time.d.ts +177 -61
  66. package/types/xr_lib/xr_type.d.ts +75 -75
  67. package/types/xr_object/client/xr_anomaly.d.ts +70 -50
  68. package/types/xr_object/client/xr_artefact.d.ts +153 -98
  69. package/types/xr_object/client/xr_client_object.d.ts +207 -76
  70. package/types/xr_object/client/xr_creature.d.ts +243 -164
  71. package/types/xr_object/client/xr_item.d.ts +370 -264
  72. package/types/xr_object/client/xr_level.d.ts +753 -285
  73. package/types/xr_object/client/xr_physic.d.ts +644 -214
  74. package/types/xr_object/client/xr_zone.d.ts +85 -47
  75. package/types/xr_object/script/xr_script_interface.d.ts +819 -584
  76. package/types/xr_object/script/xr_script_object.d.ts +5728 -1390
  77. package/types/xr_object/script/xr_script_trade.d.ts +51 -26
  78. package/types/xr_object/server/xr_server_object.d.ts +1486 -792
  79. package/types/xr_ui/xr_ui_asset.d.ts +364 -123
  80. package/types/xr_ui/xr_ui_core.d.ts +424 -97
  81. package/types/xr_ui/xr_ui_event.d.ts +1449 -381
  82. package/types/xr_ui/xr_ui_interface.d.ts +2447 -903
  83. package/types/xr_ui/xr_ui_menu.d.ts +385 -142
  84. package/types/xrf_plugin.d.ts +89 -51
@@ -1,214 +1,644 @@
1
- declare module "xray16" {
2
- /**
3
- * @source C++ class physics_element
4
- * @customConstructor physics_element
5
- * @group xr_physic
6
- */
7
- export class physics_element {
8
- public apply_force(a: f32, b: f32, c: f32): void;
9
-
10
- public fix(): void;
11
-
12
- public get_angular_vel(vector: vector): void;
13
-
14
- public get_density(): f32;
15
-
16
- public get_linear_vel(vector: vector): void;
17
-
18
- public get_mass(): f32;
19
-
20
- public get_volume(): f32;
21
-
22
- public global_transform(): matrix;
23
-
24
- public is_breakable(): boolean;
25
-
26
- public is_fixed(): boolean;
27
-
28
- public release_fixed(): void;
29
- }
30
-
31
- /**
32
- * @source C++ class particles_object
33
- * @customConstructor particles_object
34
- * @group xr_physic
35
- */
36
- export class particles_object {
37
- public constructor(name: string);
38
-
39
- public pause_path(value: boolean): void;
40
-
41
- public play_at_pos(vector: vector): void;
42
-
43
- public move_to(vector1: vector, vector2: vector): void;
44
-
45
- public looped(): boolean;
46
-
47
- public load_path(path: string): void;
48
-
49
- public start_path(is_looped: boolean): void;
50
-
51
- public stop(): void;
52
-
53
- public stop_path(): void;
54
-
55
- public stop_deffered(): void;
56
-
57
- public play(): void;
58
-
59
- public playing(): boolean;
60
-
61
- public last_position(): vector;
62
-
63
- public set_direction(direction: vector): void;
64
-
65
- public set_orientation(a: f32, b: f32, c: f32): void;
66
-
67
- public stop_deferred(): void;
68
- }
69
-
70
- /**
71
- * @source C++ class physics_joint
72
- * @customConstructor physics_joint
73
- * @group xr_physic
74
- */
75
- export class physics_joint {
76
- public get_anchor(vector: vector): void;
77
-
78
- public get_axes_number(): u16;
79
-
80
- public get_axis_angle(value: i32): f32;
81
-
82
- public get_axis_dir(value: i32, vector: vector): void;
83
-
84
- public get_bone_id(): u16;
85
-
86
- public get_first_element(): physics_element;
87
-
88
- public get_limits(value1: f32, value2: f32, value3: i32): LuaMultiReturn<[number, number]>;
89
-
90
- public get_max_force_and_velocity(value1: f32, value2: f32, value3: i32): void;
91
-
92
- public get_stcond_element(): physics_element;
93
-
94
- public is_breakable(): boolean;
95
-
96
- public set_anchor_global(value1: f32, value2: f32, value3: f32): void;
97
-
98
- public set_anchor_vs_first_element(value1: f32, value2: f32, value3: f32): void;
99
-
100
- public set_anchor_vs_second_element(value1: f32, value2: f32, value3: f32): void;
101
-
102
- public set_axis_dir_global(value1: f32, value2: f32, value3: f32, value4: i32): void;
103
-
104
- public set_axis_dir_vs_first_element(value1: f32, value2: f32, value3: f32, value4: i32): void;
105
-
106
- public set_axis_dir_vs_second_element(value1: f32, value2: f32, value3: f32, value4: f32): void;
107
-
108
- public set_axis_spring_dumping_factors(value1: f32, value2: f32, value3: i32): void;
109
-
110
- public set_joint_spring_dumping_factors(value1: f32, value2: f32): void;
111
-
112
- public set_limits(value1: f32, value2: f32, value3: i32): void;
113
-
114
- public set_max_force_and_velocity(value1: f32, value2: f32, value3: i32): void;
115
- }
116
-
117
- /**
118
- * @source C++ class physics_shell
119
- * @customConstructor physics_shell
120
- * @group xr_physic
121
- */
122
- export class physics_shell {
123
- private constructor();
124
-
125
- public apply_force(a: f32, b: f32, c: f32): void;
126
-
127
- public block_breaking(): void;
128
-
129
- public get_angular_vel(vector: vector): void;
130
-
131
- public get_element_by_bone_id(id: u16): physics_element;
132
-
133
- public get_element_by_bone_name(bone_name: string): physics_element;
134
-
135
- public get_element_by_order(order: u16): physics_element;
136
-
137
- public get_elements_number(): u16;
138
-
139
- public get_joint_by_bone_id(id: u16): physics_joint;
140
-
141
- public get_joint_by_bone_name(name: string): physics_joint;
142
-
143
- public get_joint_by_order(order: u16): physics_joint;
144
-
145
- public get_joints_number(): u16;
146
-
147
- public get_linear_vel(vector: vector): void;
148
-
149
- public is_breakable(): boolean;
150
-
151
- public is_breaking_blocked(): boolean;
152
-
153
- public unblock_breaking(): void;
154
- }
155
-
156
- /**
157
- * @source C++ class physics_world
158
- * @customConstructor physics_world
159
- * @group xr_physic
160
- */
161
- export class physics_world {
162
- public set_gravity(value: f32): void;
163
-
164
- public gravity(): f32;
165
-
166
- public add_call(/* class CPHCondition*, class CPHAction */): void;
167
- }
168
-
169
- /**
170
- * @source C++ class IKinematicsAnimated
171
- * @customConstructor IKinematicsAnimated
172
- * @group xr_physic
173
- */
174
- export class IKinematicsAnimated {
175
- public PlayCycle(value: string): void;
176
- }
177
-
178
- /**
179
- * @source C++ class CPhysicsShellHolder : public CGameObject, CParticlesPlayer,
180
- * IObjectPhysicsCollision, IPhysicsShellHolder
181
- * @customConstructor CPhysicsShellHolder
182
- * @group xr_physic
183
- */
184
- export class CPhysicsShellHolder extends EngineBinding {
185
- protected constructor();
186
- }
187
-
188
- /**
189
- * @source C++ class holder
190
- * @customConstructor holder
191
- * @group xr_physic
192
- */
193
- export class holder {
194
- public engaged(): boolean;
195
-
196
- public Action(id: u16, flags: u32): void;
197
-
198
- public SetParam(id: i32, value: vector): void;
199
-
200
- /**
201
- * Set holder object enter state.
202
- *
203
- * @param is_enabled - whether holder object can be entered
204
- */
205
- public SetEnterLocked(is_enabled: boolean): void;
206
-
207
- /**
208
- * Set holder object exist state.
209
- *
210
- * @param is_enabled - whether holder object can be exited
211
- */
212
- public SetExitLocked(is_enabled: boolean): void;
213
- }
214
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * One rigid body element inside a physics shell.
4
+ *
5
+ * @source C++ class physics_element
6
+ * @customConstructor physics_element
7
+ * @group xr_physic
8
+ *
9
+ * @remarks
10
+ * Scripts normally receive elements from a `physics_shell`; they are live engine objects, not standalone values. Keep
11
+ * them only while the owning shell and object are alive.
12
+ */
13
+ export class physics_element {
14
+ /**
15
+ * Apply force to the element.
16
+ *
17
+ * @param x - Force x component.
18
+ * @param y - Force y component.
19
+ * @param z - Force z component.
20
+ */
21
+ public apply_force(x: f32, y: f32, z: f32): void;
22
+
23
+ /**
24
+ * Fix the element in place.
25
+ */
26
+ public fix(): void;
27
+
28
+ /**
29
+ * Write current angular velocity into a vector.
30
+ *
31
+ * @remarks
32
+ * The passed vector is overwritten.
33
+ *
34
+ * @param velocity - Output vector.
35
+ */
36
+ public get_angular_vel(velocity: vector): void;
37
+
38
+ /**
39
+ * @returns Element density.
40
+ */
41
+ public get_density(): f32;
42
+
43
+ /**
44
+ * Write current linear velocity into a vector.
45
+ *
46
+ * @remarks
47
+ * The passed vector is overwritten.
48
+ *
49
+ * @param velocity - Output vector.
50
+ */
51
+ public get_linear_vel(velocity: vector): void;
52
+
53
+ /**
54
+ * @returns Element mass.
55
+ */
56
+ public get_mass(): f32;
57
+
58
+ /**
59
+ * @returns Element volume.
60
+ */
61
+ public get_volume(): f32;
62
+
63
+ /**
64
+ * @returns Current global transform.
65
+ */
66
+ public global_transform(): matrix;
67
+
68
+ /**
69
+ * @returns Whether the element can break.
70
+ */
71
+ public is_breakable(): boolean;
72
+
73
+ /**
74
+ * @returns Whether the element is fixed.
75
+ */
76
+ public is_fixed(): boolean;
77
+
78
+ /**
79
+ * Release a fixed element.
80
+ */
81
+ public release_fixed(): void;
82
+ }
83
+
84
+ /**
85
+ * Script-controlled particle system.
86
+ *
87
+ * @source C++ class particles_object
88
+ * @customConstructor particles_object
89
+ * @group xr_physic
90
+ *
91
+ * @remarks
92
+ * Path playback methods require a path loaded with `load_path()` first.
93
+ */
94
+ export class particles_object {
95
+ /**
96
+ * @param name - Particle resource name.
97
+ */
98
+ public constructor(name: string);
99
+
100
+ /**
101
+ * Pause or resume the loaded particle path.
102
+ *
103
+ * @remarks
104
+ * Requires `load_path()` to have created the internal animator.
105
+ *
106
+ * @param is_paused - Whether path playback is paused.
107
+ */
108
+ public pause_path(is_paused: boolean): void;
109
+
110
+ /**
111
+ * Play particles at a world position.
112
+ *
113
+ * @remarks
114
+ * Updates the particle transform and starts non-looped playback.
115
+ *
116
+ * @param position - World position.
117
+ */
118
+ public play_at_pos(position: vector): void;
119
+
120
+ /**
121
+ * Move particles and provide velocity for interpolation.
122
+ *
123
+ * @remarks
124
+ * Use this while an effect is already playing to keep its parent transform current.
125
+ *
126
+ * @param position - New world position.
127
+ * @param velocity - Current movement velocity.
128
+ */
129
+ public move_to(position: vector, velocity: vector): void;
130
+
131
+ /**
132
+ * @returns Whether the particle system is looped.
133
+ */
134
+ public looped(): boolean;
135
+
136
+ /**
137
+ * Load an object animator path for the particle system.
138
+ *
139
+ * @remarks
140
+ * Reuses the current animator when the same path is already loaded.
141
+ *
142
+ * @param path - Path name.
143
+ */
144
+ public load_path(path: string): void;
145
+
146
+ /**
147
+ * Start moving along the loaded path.
148
+ *
149
+ * @remarks
150
+ * Requires `load_path()` first.
151
+ *
152
+ * @param is_looped - Whether path playback loops.
153
+ */
154
+ public start_path(is_looped: boolean): void;
155
+
156
+ /**
157
+ * Stop particles immediately.
158
+ */
159
+ public stop(): void;
160
+
161
+ /**
162
+ * Stop path playback.
163
+ *
164
+ * @remarks
165
+ * Requires `load_path()` first.
166
+ */
167
+ public stop_path(): void;
168
+
169
+ /**
170
+ * Stop particles after existing particles finish.
171
+ */
172
+ public stop_deffered(): void;
173
+
174
+ /**
175
+ * Start particle playback at the current transform.
176
+ */
177
+ public play(): void;
178
+
179
+ /**
180
+ * @returns Whether particles are currently playing.
181
+ */
182
+ public playing(): boolean;
183
+
184
+ /**
185
+ * @returns Last particle position.
186
+ */
187
+ public last_position(): vector;
188
+
189
+ /**
190
+ * Set particle forward direction.
191
+ *
192
+ * @remarks
193
+ * Pass a meaningful direction vector; the engine builds the remaining basis vectors from it.
194
+ *
195
+ * @param direction - New normalized direction.
196
+ */
197
+ public set_direction(direction: vector): void;
198
+
199
+ /**
200
+ * Set particle orientation.
201
+ *
202
+ * @param yaw - Yaw angle.
203
+ * @param pitch - Pitch angle.
204
+ * @param roll - Roll angle.
205
+ */
206
+ public set_orientation(yaw: f32, pitch: f32, roll: f32): void;
207
+
208
+ /**
209
+ * Stop particles after existing particles finish.
210
+ */
211
+ public stop_deferred(): void;
212
+ }
213
+
214
+ /**
215
+ * Joint connecting two physics elements.
216
+ *
217
+ * @source C++ class physics_joint
218
+ * @customConstructor physics_joint
219
+ * @group xr_physic
220
+ *
221
+ * @remarks
222
+ * Joint handles come from a `physics_shell`. Axis methods expect an axis supported by this joint; check
223
+ * `get_axes_number()` before using indexed axis methods. Keep them only while the owning shell and object are alive.
224
+ */
225
+ export class physics_joint {
226
+ /**
227
+ * Write the joint anchor into a vector.
228
+ *
229
+ * @remarks
230
+ * The passed vector is overwritten. Slider joints do not have a defined anchor and trip a native assertion.
231
+ *
232
+ * @param anchor - Output anchor vector.
233
+ */
234
+ public get_anchor(anchor: vector): void;
235
+
236
+ /**
237
+ * @returns Number of controlled axes.
238
+ */
239
+ public get_axes_number(): u16;
240
+
241
+ /**
242
+ * Get current angle for an axis.
243
+ *
244
+ * @remarks
245
+ * Use an axis index lower than `get_axes_number()`.
246
+ *
247
+ * @param axis - Axis index.
248
+ * @returns Axis angle.
249
+ */
250
+ public get_axis_angle(axis: i32): f32;
251
+
252
+ /**
253
+ * Write axis direction into a vector.
254
+ *
255
+ * @remarks
256
+ * The passed vector is overwritten. Ball joints have no axis direction to write.
257
+ *
258
+ * @param axis - Axis index.
259
+ * @param direction - Output direction vector.
260
+ */
261
+ public get_axis_dir(axis: i32, direction: vector): void;
262
+
263
+ /**
264
+ * @returns Bone id associated with this joint.
265
+ */
266
+ public get_bone_id(): u16;
267
+
268
+ /**
269
+ * @returns First connected physics element.
270
+ */
271
+ public get_first_element(): physics_element;
272
+
273
+ /**
274
+ * Get angle limits for an axis.
275
+ *
276
+ * @remarks
277
+ * The first two parameters are Lua output placeholders; use the returned tuple in TypeScript.
278
+ *
279
+ * @param min - Output lower limit placeholder.
280
+ * @param max - Output upper limit placeholder.
281
+ * @param axis - Axis index.
282
+ * @returns Lower and upper limits.
283
+ */
284
+ public get_limits(min: f32, max: f32, axis: i32): LuaMultiReturn<[number, number]>;
285
+
286
+ /**
287
+ * Get force and velocity limits for an axis.
288
+ *
289
+ * @remarks
290
+ * Native Lua writes through the first two parameters. In TypeScript, pass placeholders only for declaration
291
+ * compatibility.
292
+ *
293
+ * @param force - Output force placeholder.
294
+ * @param velocity - Output velocity placeholder.
295
+ * @param axis - Axis index.
296
+ */
297
+ public get_max_force_and_velocity(force: f32, velocity: f32, axis: i32): void;
298
+
299
+ /**
300
+ * @returns Second connected physics element.
301
+ */
302
+ public get_stcond_element(): physics_element;
303
+
304
+ /**
305
+ * @returns Whether the joint can break.
306
+ */
307
+ public is_breakable(): boolean;
308
+
309
+ /**
310
+ * Set anchor in world space.
311
+ *
312
+ * @remarks
313
+ * The coordinates are interpreted in the shell's global frame.
314
+ */
315
+ public set_anchor_global(x: f32, y: f32, z: f32): void;
316
+
317
+ /**
318
+ * Set anchor relative to the first element.
319
+ *
320
+ * @remarks
321
+ * The coordinates are interpreted in the first element's local frame.
322
+ */
323
+ public set_anchor_vs_first_element(x: f32, y: f32, z: f32): void;
324
+
325
+ /**
326
+ * Set anchor relative to the second element.
327
+ *
328
+ * @remarks
329
+ * The coordinates are interpreted in the second element's local frame.
330
+ */
331
+ public set_anchor_vs_second_element(x: f32, y: f32, z: f32): void;
332
+
333
+ /**
334
+ * Set axis direction in world space.
335
+ *
336
+ * @remarks
337
+ * Use an axis index lower than `get_axes_number()`.
338
+ */
339
+ public set_axis_dir_global(x: f32, y: f32, z: f32, axis: i32): void;
340
+
341
+ /**
342
+ * Set axis direction relative to the first element.
343
+ *
344
+ * @remarks
345
+ * Use an axis index lower than `get_axes_number()`.
346
+ */
347
+ public set_axis_dir_vs_first_element(x: f32, y: f32, z: f32, axis: i32): void;
348
+
349
+ /**
350
+ * Set axis direction relative to the second element.
351
+ *
352
+ * @remarks
353
+ * Use an axis index lower than `get_axes_number()`.
354
+ */
355
+ public set_axis_dir_vs_second_element(x: f32, y: f32, z: f32, axis: i32): void;
356
+
357
+ /**
358
+ * Set spring and damping factors for an axis.
359
+ *
360
+ * @remarks
361
+ * Use an axis index lower than `get_axes_number()`.
362
+ */
363
+ public set_axis_spring_dumping_factors(spring: f32, damping: f32, axis: i32): void;
364
+
365
+ /**
366
+ * Set spring and damping factors for the whole joint.
367
+ */
368
+ public set_joint_spring_dumping_factors(spring: f32, damping: f32): void;
369
+
370
+ /**
371
+ * Set angle limits for an axis.
372
+ *
373
+ * @remarks
374
+ * Limits are angles in radians for rotational axes. Use an axis index lower than `get_axes_number()`.
375
+ */
376
+ public set_limits(min: f32, max: f32, axis: i32): void;
377
+
378
+ /**
379
+ * Set force and velocity limits for an axis.
380
+ *
381
+ * @remarks
382
+ * Use an axis index lower than `get_axes_number()`.
383
+ */
384
+ public set_max_force_and_velocity(force: f32, velocity: f32, axis: i32): void;
385
+ }
386
+
387
+ /**
388
+ * Physics shell made of elements and joints.
389
+ *
390
+ * @source C++ class physics_shell
391
+ * @customConstructor physics_shell
392
+ * @group xr_physic
393
+ *
394
+ * @remarks
395
+ * Shells are engine-owned. Store-order lookups require an index lower than the corresponding count method.
396
+ */
397
+ export class physics_shell {
398
+ /**
399
+ * Engine-created physics shell.
400
+ */
401
+ private constructor();
402
+
403
+ /**
404
+ * Apply force to the shell.
405
+ *
406
+ * @param x - Force x component.
407
+ * @param y - Force y component.
408
+ * @param z - Force z component.
409
+ */
410
+ public apply_force(x: f32, y: f32, z: f32): void;
411
+
412
+ /**
413
+ * Prevent shell elements and joints from breaking.
414
+ */
415
+ public block_breaking(): void;
416
+
417
+ /**
418
+ * Write current angular velocity into a vector.
419
+ *
420
+ * @remarks
421
+ * The passed vector is overwritten with the root element's angular velocity.
422
+ *
423
+ * @param velocity - Output vector.
424
+ */
425
+ public get_angular_vel(velocity: vector): void;
426
+
427
+ /**
428
+ * Get an element by model bone id.
429
+ *
430
+ * @remarks
431
+ * Returns the element attached to the bone, if the shell has one for that id. Invalid ids can trip native
432
+ * assertions in debug builds.
433
+ *
434
+ * @param id - Bone id.
435
+ * @returns Matching physics element.
436
+ */
437
+ public get_element_by_bone_id(id: u16): physics_element;
438
+
439
+ /**
440
+ * Get an element by model bone name.
441
+ *
442
+ * @remarks
443
+ * The bone name must exist in the shell's kinematics. Invalid names can trip native assertions in debug builds.
444
+ *
445
+ * @param bone_name - Bone name.
446
+ * @returns Matching physics element.
447
+ */
448
+ public get_element_by_bone_name(bone_name: string): physics_element;
449
+
450
+ /**
451
+ * Get an element by shell storage order.
452
+ *
453
+ * @remarks
454
+ * `order` must be lower than `get_elements_number()`; invalid values trip a native assertion.
455
+ *
456
+ * @param order - Element order.
457
+ * @returns Matching physics element.
458
+ */
459
+ public get_element_by_order(order: u16): physics_element;
460
+
461
+ /**
462
+ * @returns Number of elements in the shell.
463
+ */
464
+ public get_elements_number(): u16;
465
+
466
+ /**
467
+ * Get a joint by model bone id.
468
+ *
469
+ * @remarks
470
+ * Returns the joint attached to the bone, if the shell has one for that id. Invalid ids can trip native assertions
471
+ * in debug builds.
472
+ *
473
+ * @param id - Bone id.
474
+ * @returns Matching physics joint.
475
+ */
476
+ public get_joint_by_bone_id(id: u16): physics_joint;
477
+
478
+ /**
479
+ * Get a joint by model bone name.
480
+ *
481
+ * @remarks
482
+ * The bone name must exist in the shell's kinematics. Invalid names can trip native assertions in debug builds.
483
+ *
484
+ * @param name - Bone name.
485
+ * @returns Matching physics joint.
486
+ */
487
+ public get_joint_by_bone_name(name: string): physics_joint;
488
+
489
+ /**
490
+ * Get a joint by shell storage order.
491
+ *
492
+ * @remarks
493
+ * `order` must be lower than `get_joints_number()`; invalid values trip a native assertion.
494
+ *
495
+ * @param order - Joint order.
496
+ * @returns Matching physics joint.
497
+ */
498
+ public get_joint_by_order(order: u16): physics_joint;
499
+
500
+ /**
501
+ * @returns Number of joints in the shell.
502
+ */
503
+ public get_joints_number(): u16;
504
+
505
+ /**
506
+ * Write current linear velocity into a vector.
507
+ *
508
+ * @remarks
509
+ * The passed vector is overwritten with the root element's linear velocity.
510
+ *
511
+ * @param velocity - Output vector.
512
+ */
513
+ public get_linear_vel(velocity: vector): void;
514
+
515
+ /**
516
+ * @returns Whether the shell can break.
517
+ */
518
+ public is_breakable(): boolean;
519
+
520
+ /**
521
+ * @returns Whether breaking is currently blocked.
522
+ */
523
+ public is_breaking_blocked(): boolean;
524
+
525
+ /**
526
+ * Allow shell elements and joints to break again.
527
+ */
528
+ public unblock_breaking(): void;
529
+ }
530
+
531
+ /**
532
+ * Global physics world controls.
533
+ *
534
+ * @source C++ class physics_world
535
+ * @customConstructor physics_world
536
+ * @group xr_physic
537
+ *
538
+ * @remarks
539
+ * Obtain the live world through `level.physics_world()`. Gravity changes affect the whole level.
540
+ */
541
+ export class physics_world {
542
+ /**
543
+ * Set world gravity.
544
+ *
545
+ * @param value - Gravity value.
546
+ */
547
+ public set_gravity(value: f32): void;
548
+
549
+ /**
550
+ * @returns Current world gravity.
551
+ */
552
+ public gravity(): f32;
553
+
554
+ /**
555
+ * Add a physics condition/action callback pair.
556
+ *
557
+ * @remarks
558
+ * This binding expects native `CPHCondition` and `CPHAction` objects; ordinary scripts rarely call it directly.
559
+ */
560
+ public add_call(/* Class CPHCondition*, class CPHAction */): void;
561
+ }
562
+
563
+ /**
564
+ * Animated model kinematics.
565
+ *
566
+ * @source C++ class IKinematicsAnimated
567
+ * @customConstructor IKinematicsAnimated
568
+ * @group xr_physic
569
+ */
570
+ export class IKinematicsAnimated {
571
+ /**
572
+ * Play an animation cycle by name.
573
+ *
574
+ * @param name - Animation name.
575
+ */
576
+ public PlayCycle(name: string): void;
577
+ }
578
+
579
+ /**
580
+ * Client object that owns a physics shell.
581
+ *
582
+ * @source C++ class CPhysicsShellHolder : public CGameObject, CParticlesPlayer,
583
+ * IObjectPhysicsCollision, IPhysicsShellHolder
584
+ * @customConstructor CPhysicsShellHolder
585
+ * @group xr_physic
586
+ *
587
+ * @remarks
588
+ * This is a native owner of physics shell state. Scripts usually reach it through `game_object.cast_PhysicsShellHolder()`
589
+ * or `game_object.get_physics_shell()`.
590
+ */
591
+ export class CPhysicsShellHolder extends EngineBinding {
592
+ /**
593
+ * Engine-created physics shell holder.
594
+ */
595
+ protected constructor();
596
+ }
597
+
598
+ /**
599
+ * Holder object that the actor can engage with.
600
+ *
601
+ * @source C++ class holder
602
+ * @customConstructor holder
603
+ * @group xr_physic
604
+ *
605
+ * @remarks
606
+ * Returned only for objects that implement holder controls, such as mounted weapons or vehicles.
607
+ */
608
+ export class holder {
609
+ /**
610
+ * @returns Whether the actor is currently attached to the holder.
611
+ */
612
+ public engaged(): boolean;
613
+
614
+ /**
615
+ * Send holder action flags.
616
+ *
617
+ * @param id - Action id.
618
+ * @param flags - Action flags.
619
+ */
620
+ public Action(id: u16, flags: u32): void;
621
+
622
+ /**
623
+ * Set holder vector parameter.
624
+ *
625
+ * @param id - Parameter id.
626
+ * @param value - Parameter value.
627
+ */
628
+ public SetParam(id: i32, value: vector): void;
629
+
630
+ /**
631
+ * Set holder object enter state.
632
+ *
633
+ * @param is_enabled - Whether entering the holder is locked.
634
+ */
635
+ public SetEnterLocked(is_enabled: boolean): void;
636
+
637
+ /**
638
+ * Set holder object exit state.
639
+ *
640
+ * @param is_enabled - Whether exiting the holder is locked.
641
+ */
642
+ public SetExitLocked(is_enabled: boolean): void;
643
+ }
644
+ }