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,233 +1,871 @@
1
- declare module "xray16" {
2
- /**
3
- * Frame rectangle.
4
- * Describing x1, y1 top left start point and x2, y2 bottom right end point.
5
- *
6
- * @source C++ class Frect
7
- * @customConstructor Frect
8
- * @group xr_math
9
- */
10
- export class Frect extends EngineBinding {
11
- public lt: vector2;
12
- public rb: vector2;
13
-
14
- public x1: f32;
15
- public x2: f32;
16
- public y1: f32;
17
- public y2: f32;
18
-
19
- public set(x1: f32, y1: f32, x2: f32, y2: f32): Frect;
20
- }
21
-
22
- /**
23
- * @source C++ class Fbox
24
- * @customConstructor Fbox
25
- * @group xr_math
26
- */
27
- export class Fbox {
28
- public max: vector;
29
- public min: vector;
30
-
31
- public constructor();
32
- }
33
-
34
- /**
35
- * @source C++ class rotation
36
- * @customConstructor rotation
37
- * @group xr_math
38
- */
39
- export class rotation {
40
- public yaw: f32;
41
- public pitch: f32;
42
- }
43
-
44
- /**
45
- * @source C++ class vector2
46
- * @customConstructor vector2
47
- * @group xr_math
48
- */
49
- export class vector2 {
50
- public x: f32;
51
- public y: f32;
52
-
53
- public set(x: f32, y: f32): vector2;
54
-
55
- public set(vector: vector2): vector2;
56
- }
57
-
58
- /**
59
- * @source C++ class XR_vector
60
- * @customConstructor vector
61
- * @group xr_math
62
- */
63
- export class vector {
64
- public x: f32;
65
- public y: f32;
66
- public z: f32;
67
-
68
- public abs(vector: Readonly<vector>): vector;
69
-
70
- public add(val: f32): vector;
71
-
72
- public add(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
73
-
74
- public add(vector: Readonly<vector>): vector;
75
-
76
- public add(vector: Readonly<vector>, val: f32): vector;
77
-
78
- public align(): vector;
79
-
80
- public average(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
81
-
82
- public average(vector: Readonly<vector>): vector;
83
-
84
- public clamp(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
85
-
86
- public clamp(vector: Readonly<vector>): vector;
87
-
88
- public crossproduct(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
89
-
90
- public distance_to(vector: Readonly<vector>): f32;
91
-
92
- public distance_to_sqr(vector: Readonly<vector>): f32;
93
-
94
- public distance_to_xz(vector: Readonly<vector>): f32;
95
-
96
- public div(val: f32): vector;
97
-
98
- public div(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
99
-
100
- public div(vector: Readonly<vector>): vector;
101
-
102
- public div(vector: Readonly<vector>, val: f32): vector;
103
-
104
- public dotproduct(vector: Readonly<vector>): f32;
105
-
106
- public getH(): f32;
107
-
108
- public getP(): f32;
109
-
110
- public inertion(vector: Readonly<vector>, val: f32): vector;
111
-
112
- public invert(): vector;
113
-
114
- public invert(vector: Readonly<vector>): vector;
115
-
116
- public lerp(vector1: Readonly<vector>, vector2: Readonly<vector>, val: f32): vector;
117
-
118
- public mad(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
119
-
120
- public mad(vector1: Readonly<vector>, vector2: Readonly<vector>, val: f32): vector;
121
-
122
- public mad(vector1: Readonly<vector>, vector2: Readonly<vector>, vector3: Readonly<vector>): vector;
123
-
124
- public mad(vector: Readonly<vector>, val: f32): vector;
125
-
126
- /**
127
- * @returns 3d vector magnitude value `sqrt(x*x + y*y + z*z)`
128
- */
129
- public magnitude(): f32;
130
-
131
- public max(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
132
-
133
- public max(vector: Readonly<vector>): vector;
134
-
135
- public min(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
136
-
137
- public min(vector: Readonly<vector>): vector;
138
-
139
- public mul(val: f32): vector;
140
-
141
- public mul(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
142
-
143
- public mul(vector: Readonly<vector>): vector;
144
-
145
- public mul(vector: Readonly<vector>, val: f32): vector;
146
-
147
- public normalize(): vector;
148
-
149
- public normalize(vector: Readonly<vector>): vector;
150
-
151
- public normalize_safe(): vector;
152
-
153
- public normalize_safe(vector: Readonly<vector>): vector;
154
-
155
- public reflect(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
156
-
157
- public set(vector: Readonly<vector>): vector;
158
-
159
- public set(x: f32, y: f32, z: f32): vector;
160
-
161
- public setHP(val1: f32, val2: f32): vector;
162
-
163
- public set_length(val: f32): vector;
164
-
165
- public similar(vector: Readonly<vector>, val: f32): boolean;
166
-
167
- public slide(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
168
-
169
- public sub(val: f32): vector;
170
-
171
- public sub(vector1: Readonly<vector>, vector2: Readonly<vector>): vector;
172
-
173
- public sub(vector: Readonly<vector>): vector;
174
-
175
- public sub(vector: Readonly<vector>, val: f32): vector;
176
- }
177
-
178
- /**
179
- * @source C++ class RPoint
180
- * @customConstructor RPoint
181
- * @group xr_math
182
- */
183
- export class RPoint {
184
- public A: vector;
185
- public P: vector;
186
-
187
- public constructor();
188
- }
189
-
190
- /**
191
- * @source C++ class matrix
192
- * @customConstructor matrix
193
- * @group xr_math
194
- */
195
- export class matrix {
196
- public _14_: f32;
197
- public _24_: f32;
198
- public _34_: f32;
199
- public _44_: f32;
200
- public c: vector;
201
- public i: vector;
202
- public j: vector;
203
- public k: vector;
204
-
205
- public constructor();
206
-
207
- public mk_xform(x: unknown /* _quaternion<float> */, vector: vector): matrix;
208
-
209
- public set(matix: matrix): matrix;
210
-
211
- public set(vector1: vector, vector2: vector, vector3: vector, vector4: vector): matrix;
212
-
213
- public div(matix: matrix, number: f32): matrix;
214
-
215
- public div(number: f32): matrix;
216
-
217
- public identity(): matrix;
218
-
219
- public setHPB(number1: f32, number2: f32, number3: f32): matrix;
220
-
221
- public setXYZ(x: f32, y: f32, z: f32): matrix;
222
-
223
- public getHPB(matrix: matrix, number1: f32, number2: f32, number3: f32): matrix;
224
-
225
- public mul(matix1: matrix, matix2: matrix): matrix;
226
-
227
- public mul(matix: matrix, number: f32): matrix;
228
-
229
- public mul(number: f32): matrix;
230
-
231
- public setXYZi(number1: f32, number2: f32, number3: f32): matrix;
232
- }
233
- }
1
+ declare module "xray16" {
2
+ /**
3
+ * Rectangle with top-left and bottom-right points.
4
+ *
5
+ * @source C++ class Frect
6
+ * @customConstructor Frect
7
+ * @group xr_math
8
+ *
9
+ * @remarks
10
+ * Used by UI bindings for window and texture rectangles. `set()` mutates this rectangle.
11
+ */
12
+ export class Frect extends EngineBinding {
13
+ /**
14
+ * Top-left corner.
15
+ */
16
+ public lt: vector2;
17
+
18
+ /**
19
+ * Bottom-right corner.
20
+ */
21
+ public rb: vector2;
22
+
23
+ /**
24
+ * Left edge.
25
+ */
26
+ public x1: f32;
27
+
28
+ /**
29
+ * Right edge.
30
+ */
31
+ public x2: f32;
32
+
33
+ /**
34
+ * Top edge.
35
+ */
36
+ public y1: f32;
37
+
38
+ /**
39
+ * Bottom edge.
40
+ */
41
+ public y2: f32;
42
+
43
+ /**
44
+ * Create an empty rectangle.
45
+ */
46
+ public constructor();
47
+
48
+ /**
49
+ * Set rectangle edges.
50
+ *
51
+ * @param x1 - Left edge.
52
+ * @param y1 - Top edge.
53
+ * @param x2 - Right edge.
54
+ * @param y2 - Bottom edge.
55
+ * @returns This rectangle.
56
+ */
57
+ public set(x1: f32, y1: f32, x2: f32, y2: f32): Frect;
58
+ }
59
+
60
+ /**
61
+ * Axis-aligned 3D box.
62
+ *
63
+ * @source C++ class Fbox
64
+ * @customConstructor Fbox
65
+ * @group xr_math
66
+ *
67
+ * @remarks
68
+ * Bounds are stored as mutable `min` and `max` vectors.
69
+ */
70
+ export class Fbox {
71
+ /**
72
+ * Maximum corner.
73
+ */
74
+ public max: vector;
75
+
76
+ /**
77
+ * Minimum corner.
78
+ */
79
+ public min: vector;
80
+
81
+ /**
82
+ * Create an empty box.
83
+ */
84
+ public constructor();
85
+ }
86
+
87
+ /**
88
+ * Heading/pitch rotation pair.
89
+ *
90
+ * @source C++ class rotation
91
+ * @customConstructor rotation
92
+ * @group xr_math
93
+ */
94
+ export class rotation {
95
+ /**
96
+ * Horizontal angle.
97
+ */
98
+ public yaw: f32;
99
+
100
+ /**
101
+ * Vertical angle.
102
+ */
103
+ public pitch: f32;
104
+ }
105
+
106
+ /**
107
+ * Mutable 2D float vector.
108
+ *
109
+ * @source C++ class vector2
110
+ * @customConstructor vector2
111
+ * @group xr_math
112
+ *
113
+ * @remarks
114
+ * `set()` mutates the receiver and returns it for chaining.
115
+ */
116
+ export class vector2 {
117
+ /**
118
+ * X component.
119
+ */
120
+ public x: f32;
121
+
122
+ /**
123
+ * Y component.
124
+ */
125
+ public y: f32;
126
+
127
+ /**
128
+ * Create a zero vector.
129
+ */
130
+ public constructor();
131
+
132
+ /**
133
+ * Set components.
134
+ *
135
+ * @param x - X component.
136
+ * @param y - Y component.
137
+ * @returns This vector.
138
+ */
139
+ public set(x: f32, y: f32): vector2;
140
+
141
+ /**
142
+ * Copy another vector.
143
+ *
144
+ * @param vector - Source vector.
145
+ * @returns This vector.
146
+ */
147
+ public set(vector: vector2): vector2;
148
+ }
149
+
150
+ /**
151
+ * Mutable 3D float vector.
152
+ *
153
+ * Most operations mutate the receiver and return it for chaining.
154
+ *
155
+ * @source C++ class XR_vector
156
+ * @customConstructor vector
157
+ * @group xr_math
158
+ *
159
+ * @remarks
160
+ * Use `set()` first when you need a known value; script-created native vectors expose their fields directly.
161
+ */
162
+ export class vector {
163
+ /**
164
+ * X component.
165
+ */
166
+ public x: f32;
167
+
168
+ /**
169
+ * Y component.
170
+ */
171
+ public y: f32;
172
+
173
+ /**
174
+ * Z component.
175
+ */
176
+ public z: f32;
177
+
178
+ /**
179
+ * Create a zero vector.
180
+ */
181
+ public constructor();
182
+
183
+ /**
184
+ * Set this vector to absolute component values of another vector.
185
+ *
186
+ * @param vector - Source vector.
187
+ * @returns This vector.
188
+ */
189
+ public abs(vector: Readonly<vector>): vector;
190
+
191
+ /**
192
+ * Add a scalar to every component.
193
+ *
194
+ * @param value - Scalar value.
195
+ * @returns This vector.
196
+ */
197
+ public add(value: f32): vector;
198
+
199
+ /**
200
+ * Set this vector to `left + right`.
201
+ *
202
+ * @param left - Left vector.
203
+ * @param right - Right vector.
204
+ * @returns This vector.
205
+ */
206
+ public add(left: Readonly<vector>, right: Readonly<vector>): vector;
207
+
208
+ /**
209
+ * Add another vector.
210
+ *
211
+ * @param vector - Vector to add.
212
+ * @returns This vector.
213
+ */
214
+ public add(vector: Readonly<vector>): vector;
215
+
216
+ /**
217
+ * Set this vector to `vector + value`.
218
+ *
219
+ * @param vector - Source vector.
220
+ * @param value - Scalar value.
221
+ * @returns This vector.
222
+ */
223
+ public add(vector: Readonly<vector>, value: f32): vector;
224
+
225
+ /**
226
+ * Snap components to the engine alignment grid.
227
+ *
228
+ * @returns This vector.
229
+ */
230
+ public align(): vector;
231
+
232
+ /**
233
+ * Set this vector to the midpoint between two vectors.
234
+ *
235
+ * @param left - First vector.
236
+ * @param right - Second vector.
237
+ * @returns This vector.
238
+ */
239
+ public average(left: Readonly<vector>, right: Readonly<vector>): vector;
240
+
241
+ /**
242
+ * Move this vector halfway toward another vector.
243
+ *
244
+ * @param vector - Other vector.
245
+ * @returns This vector.
246
+ */
247
+ public average(vector: Readonly<vector>): vector;
248
+
249
+ /**
250
+ * Clamp this vector between two bounds.
251
+ *
252
+ * @param min - Minimum components.
253
+ * @param max - Maximum components.
254
+ * @returns This vector.
255
+ */
256
+ public clamp(min: Readonly<vector>, max: Readonly<vector>): vector;
257
+
258
+ /**
259
+ * Clamp this vector to symmetric component bounds.
260
+ *
261
+ * @param vector - Bound vector.
262
+ * @returns This vector.
263
+ */
264
+ public clamp(vector: Readonly<vector>): vector;
265
+
266
+ /**
267
+ * Set this vector to a cross product.
268
+ *
269
+ * @param left - Left vector.
270
+ * @param right - Right vector.
271
+ * @returns This vector.
272
+ */
273
+ public crossproduct(left: Readonly<vector>, right: Readonly<vector>): vector;
274
+
275
+ /**
276
+ * Get 3D distance to another vector.
277
+ *
278
+ * @param vector - Target vector.
279
+ * @returns Distance.
280
+ */
281
+ public distance_to(vector: Readonly<vector>): f32;
282
+
283
+ /**
284
+ * Get squared 3D distance to another vector.
285
+ *
286
+ * @param vector - Target vector.
287
+ * @returns Squared distance.
288
+ */
289
+ public distance_to_sqr(vector: Readonly<vector>): f32;
290
+
291
+ /**
292
+ * Get distance to another vector on the XZ plane.
293
+ *
294
+ * @param vector - Target vector.
295
+ * @returns XZ-plane distance.
296
+ */
297
+ public distance_to_xz(vector: Readonly<vector>): f32;
298
+
299
+ /**
300
+ * Divide every component by a scalar.
301
+ *
302
+ * @remarks
303
+ * The binding performs raw division. Pass a non-zero divisor.
304
+ *
305
+ * @param value - Scalar divisor.
306
+ * @returns This vector.
307
+ */
308
+ public div(value: f32): vector;
309
+
310
+ /**
311
+ * Set this vector to component-wise `left / right`.
312
+ *
313
+ * @remarks
314
+ * The binding performs raw component division. Divisor components must be non-zero.
315
+ *
316
+ * @param left - Left vector.
317
+ * @param right - Right vector.
318
+ * @returns This vector.
319
+ */
320
+ public div(left: Readonly<vector>, right: Readonly<vector>): vector;
321
+
322
+ /**
323
+ * Divide this vector component-wise by another vector.
324
+ *
325
+ * @remarks
326
+ * The binding performs raw component division. Divisor components must be non-zero.
327
+ *
328
+ * @param vector - Divisor vector.
329
+ * @returns This vector.
330
+ */
331
+ public div(vector: Readonly<vector>): vector;
332
+
333
+ /**
334
+ * Set this vector to `vector / value`.
335
+ *
336
+ * @remarks
337
+ * The binding performs raw division. Pass a non-zero divisor.
338
+ *
339
+ * @param vector - Source vector.
340
+ * @param value - Scalar divisor.
341
+ * @returns This vector.
342
+ */
343
+ public div(vector: Readonly<vector>, value: f32): vector;
344
+
345
+ /**
346
+ * Get dot product with another vector.
347
+ *
348
+ * @param vector - Other vector.
349
+ * @returns Dot product.
350
+ */
351
+ public dotproduct(vector: Readonly<vector>): f32;
352
+
353
+ /**
354
+ * Get heading angle for this direction vector.
355
+ *
356
+ * @remarks
357
+ * Intended for direction vectors. For arbitrary points, the result is just the angle of that vector from origin.
358
+ *
359
+ * @returns Heading angle in radians.
360
+ */
361
+ public getH(): f32;
362
+
363
+ /**
364
+ * Get pitch angle for this direction vector.
365
+ *
366
+ * @remarks
367
+ * Intended for direction vectors. For arbitrary points, the result is just the angle of that vector from origin.
368
+ *
369
+ * @returns Pitch angle in radians.
370
+ */
371
+ public getP(): f32;
372
+
373
+ /**
374
+ * Smooth this vector toward another vector.
375
+ *
376
+ * @param vector - Target vector.
377
+ * @param value - Blend factor.
378
+ * @returns This vector.
379
+ */
380
+ public inertion(vector: Readonly<vector>, value: f32): vector;
381
+
382
+ /**
383
+ * Negate this vector.
384
+ *
385
+ * @returns This vector.
386
+ */
387
+ public invert(): vector;
388
+
389
+ /**
390
+ * Set this vector to negated source vector.
391
+ *
392
+ * @param vector - Source vector.
393
+ * @returns This vector.
394
+ */
395
+ public invert(vector: Readonly<vector>): vector;
396
+
397
+ /**
398
+ * Linearly interpolate between two vectors.
399
+ *
400
+ * @param from - Start vector.
401
+ * @param to - End vector.
402
+ * @param factor - Interpolation factor.
403
+ * @returns This vector.
404
+ */
405
+ public lerp(from: Readonly<vector>, to: Readonly<vector>, factor: f32): vector;
406
+
407
+ /**
408
+ * Add two vectors and store the result.
409
+ *
410
+ * @param left - Left vector.
411
+ * @param right - Right vector.
412
+ * @returns This vector.
413
+ */
414
+ public mad(left: Readonly<vector>, right: Readonly<vector>): vector;
415
+
416
+ /**
417
+ * Add a scaled vector and store the result.
418
+ *
419
+ * @param base - Base vector.
420
+ * @param direction - Direction vector.
421
+ * @param scale - Direction scale.
422
+ * @returns This vector.
423
+ */
424
+ public mad(base: Readonly<vector>, direction: Readonly<vector>, scale: f32): vector;
425
+
426
+ /**
427
+ * Add two vectors component-wise and scale by a third vector.
428
+ *
429
+ * @param base - Base vector.
430
+ * @param left - First multiplier vector.
431
+ * @param right - Second multiplier vector.
432
+ * @returns This vector.
433
+ */
434
+ public mad(base: Readonly<vector>, left: Readonly<vector>, right: Readonly<vector>): vector;
435
+
436
+ /**
437
+ * Add a scaled vector to this vector.
438
+ *
439
+ * @param vector - Vector to add.
440
+ * @param scale - Vector scale.
441
+ * @returns This vector.
442
+ */
443
+ public mad(vector: Readonly<vector>, scale: f32): vector;
444
+
445
+ /**
446
+ * Get vector length.
447
+ *
448
+ * @returns 3D vector magnitude.
449
+ */
450
+ public magnitude(): f32;
451
+
452
+ /**
453
+ * Set this vector to component-wise maximum of two vectors.
454
+ *
455
+ * @param left - First vector.
456
+ * @param right - Second vector.
457
+ * @returns This vector.
458
+ */
459
+ public max(left: Readonly<vector>, right: Readonly<vector>): vector;
460
+
461
+ /**
462
+ * Clamp this vector upward by another vector.
463
+ *
464
+ * @param vector - Minimum components.
465
+ * @returns This vector.
466
+ */
467
+ public max(vector: Readonly<vector>): vector;
468
+
469
+ /**
470
+ * Set this vector to component-wise minimum of two vectors.
471
+ *
472
+ * @param left - First vector.
473
+ * @param right - Second vector.
474
+ * @returns This vector.
475
+ */
476
+ public min(left: Readonly<vector>, right: Readonly<vector>): vector;
477
+
478
+ /**
479
+ * Clamp this vector downward by another vector.
480
+ *
481
+ * @param vector - Maximum components.
482
+ * @returns This vector.
483
+ */
484
+ public min(vector: Readonly<vector>): vector;
485
+
486
+ /**
487
+ * Multiply every component by a scalar.
488
+ *
489
+ * @param value - Scalar multiplier.
490
+ * @returns This vector.
491
+ */
492
+ public mul(value: f32): vector;
493
+
494
+ /**
495
+ * Set this vector to component-wise `left * right`.
496
+ *
497
+ * @param left - Left vector.
498
+ * @param right - Right vector.
499
+ * @returns This vector.
500
+ */
501
+ public mul(left: Readonly<vector>, right: Readonly<vector>): vector;
502
+
503
+ /**
504
+ * Multiply this vector component-wise by another vector.
505
+ *
506
+ * @param vector - Multiplier vector.
507
+ * @returns This vector.
508
+ */
509
+ public mul(vector: Readonly<vector>): vector;
510
+
511
+ /**
512
+ * Set this vector to `vector * value`.
513
+ *
514
+ * @param vector - Source vector.
515
+ * @param value - Scalar multiplier.
516
+ * @returns This vector.
517
+ */
518
+ public mul(vector: Readonly<vector>, value: f32): vector;
519
+
520
+ /**
521
+ * Normalize this vector safely.
522
+ *
523
+ * @remarks
524
+ * The script binding routes `normalize()` through the same safe native path as `normalize_safe()`.
525
+ *
526
+ * @returns This vector.
527
+ */
528
+ public normalize(): vector;
529
+
530
+ /**
531
+ * Set this vector to normalized source vector safely.
532
+ *
533
+ * @remarks
534
+ * The script binding routes `normalize(vector)` through the same safe native path as `normalize_safe(vector)`.
535
+ *
536
+ * @param vector - Source vector.
537
+ * @returns This vector.
538
+ */
539
+ public normalize(vector: Readonly<vector>): vector;
540
+
541
+ /**
542
+ * Normalize this vector safely.
543
+ *
544
+ * @returns This vector.
545
+ */
546
+ public normalize_safe(): vector;
547
+
548
+ /**
549
+ * Set this vector to normalized source vector safely.
550
+ *
551
+ * @param vector - Source vector.
552
+ * @returns This vector.
553
+ */
554
+ public normalize_safe(vector: Readonly<vector>): vector;
555
+
556
+ /**
557
+ * Reflect a direction vector around a normal.
558
+ *
559
+ * @param direction - Incoming direction.
560
+ * @param normal - Surface normal.
561
+ * @returns This vector.
562
+ */
563
+ public reflect(direction: Readonly<vector>, normal: Readonly<vector>): vector;
564
+
565
+ /**
566
+ * Copy another vector.
567
+ *
568
+ * @param vector - Source vector.
569
+ * @returns This vector.
570
+ */
571
+ public set(vector: Readonly<vector>): vector;
572
+
573
+ /**
574
+ * Set components.
575
+ *
576
+ * @param x - X component.
577
+ * @param y - Y component.
578
+ * @param z - Z component.
579
+ * @returns This vector.
580
+ */
581
+ public set(x: f32, y: f32, z: f32): vector;
582
+
583
+ /**
584
+ * Set direction from heading and pitch.
585
+ *
586
+ * @param heading - Heading angle in radians.
587
+ * @param pitch - Pitch angle in radians.
588
+ * @returns This vector.
589
+ */
590
+ public setHP(heading: f32, pitch: f32): vector;
591
+
592
+ /**
593
+ * Change vector length while keeping direction.
594
+ *
595
+ * @remarks
596
+ * Use on a vector that already has a meaningful direction.
597
+ *
598
+ * @param value - New length.
599
+ * @returns This vector.
600
+ */
601
+ public set_length(value: f32): vector;
602
+
603
+ /**
604
+ * Compare vectors with tolerance.
605
+ *
606
+ * @param vector - Vector to compare.
607
+ * @param epsilon - Allowed component difference.
608
+ * @returns Whether vectors are similar.
609
+ */
610
+ public similar(vector: Readonly<vector>, epsilon: f32): boolean;
611
+
612
+ /**
613
+ * Slide a direction along a surface normal.
614
+ *
615
+ * @param direction - Direction vector.
616
+ * @param normal - Surface normal.
617
+ * @returns This vector.
618
+ */
619
+ public slide(direction: Readonly<vector>, normal: Readonly<vector>): vector;
620
+
621
+ /**
622
+ * Subtract a scalar from every component.
623
+ *
624
+ * @param value - Scalar value.
625
+ * @returns This vector.
626
+ */
627
+ public sub(value: f32): vector;
628
+
629
+ /**
630
+ * Set this vector to `left - right`.
631
+ *
632
+ * @param left - Left vector.
633
+ * @param right - Right vector.
634
+ * @returns This vector.
635
+ */
636
+ public sub(left: Readonly<vector>, right: Readonly<vector>): vector;
637
+
638
+ /**
639
+ * Subtract another vector.
640
+ *
641
+ * @param vector - Vector to subtract.
642
+ * @returns This vector.
643
+ */
644
+ public sub(vector: Readonly<vector>): vector;
645
+
646
+ /**
647
+ * Set this vector to `vector - value`.
648
+ *
649
+ * @param vector - Source vector.
650
+ * @param value - Scalar value.
651
+ * @returns This vector.
652
+ */
653
+ public sub(vector: Readonly<vector>, value: f32): vector;
654
+ }
655
+
656
+ /**
657
+ * Patrol graph point with position and angle vectors.
658
+ *
659
+ * @source C++ class RPoint
660
+ * @customConstructor RPoint
661
+ * @group xr_math
662
+ *
663
+ * @remarks
664
+ * `P` stores position, `A` stores orientation data used by patrol graph points.
665
+ */
666
+ export class RPoint {
667
+ /**
668
+ * Angle vector.
669
+ */
670
+ public A: vector;
671
+
672
+ /**
673
+ * Position vector.
674
+ */
675
+ public P: vector;
676
+
677
+ /**
678
+ * Create an empty patrol point.
679
+ */
680
+ public constructor();
681
+ }
682
+
683
+ /**
684
+ * Mutable 4x4 transform matrix.
685
+ *
686
+ * Basis vectors are exposed as `i`, `j`, `k`; translation is exposed as `c`.
687
+ *
688
+ * @source C++ class matrix
689
+ * @customConstructor matrix
690
+ * @group xr_math
691
+ *
692
+ * @remarks
693
+ * Script-exposed mutators return this matrix for chaining. Call `identity()` or `set()` before composing transforms
694
+ * when you need a known starting value.
695
+ */
696
+ export class matrix {
697
+ /**
698
+ * First row fourth component.
699
+ */
700
+ public _14_: f32;
701
+
702
+ /**
703
+ * Second row fourth component.
704
+ */
705
+ public _24_: f32;
706
+
707
+ /**
708
+ * Third row fourth component.
709
+ */
710
+ public _34_: f32;
711
+
712
+ /**
713
+ * Fourth row fourth component.
714
+ */
715
+ public _44_: f32;
716
+
717
+ /**
718
+ * Translation vector.
719
+ */
720
+ public c: vector;
721
+
722
+ /**
723
+ * X basis vector.
724
+ */
725
+ public i: vector;
726
+
727
+ /**
728
+ * Y basis vector.
729
+ */
730
+ public j: vector;
731
+
732
+ /**
733
+ * Z basis vector.
734
+ */
735
+ public k: vector;
736
+
737
+ /**
738
+ * Create an empty matrix.
739
+ */
740
+ public constructor();
741
+
742
+ /**
743
+ * Build transform from quaternion and translation.
744
+ *
745
+ * @param rotation - Quaternion value.
746
+ * @param position - Translation vector.
747
+ * @returns This matrix.
748
+ */
749
+ public mk_xform(rotation: unknown /* _quaternion<float> */, position: vector): matrix;
750
+
751
+ /**
752
+ * Copy another matrix.
753
+ *
754
+ * @param value - Source matrix.
755
+ * @returns This matrix.
756
+ */
757
+ public set(value: matrix): matrix;
758
+
759
+ /**
760
+ * Set basis and translation vectors.
761
+ *
762
+ * @param i - X basis vector.
763
+ * @param j - Y basis vector.
764
+ * @param k - Z basis vector.
765
+ * @param c - Translation vector.
766
+ * @returns This matrix.
767
+ */
768
+ public set(i: vector, j: vector, k: vector, c: vector): matrix;
769
+
770
+ /**
771
+ * Set this matrix to `value / divisor`.
772
+ *
773
+ * @remarks
774
+ * The binding performs raw scalar division. Pass a non-zero divisor.
775
+ *
776
+ * @param value - Source matrix.
777
+ * @param divisor - Scalar divisor.
778
+ * @returns This matrix.
779
+ */
780
+ public div(value: matrix, divisor: f32): matrix;
781
+
782
+ /**
783
+ * Divide this matrix by a scalar.
784
+ *
785
+ * @remarks
786
+ * The binding performs raw scalar division. Pass a non-zero divisor.
787
+ *
788
+ * @param divisor - Scalar divisor.
789
+ * @returns This matrix.
790
+ */
791
+ public div(divisor: f32): matrix;
792
+
793
+ /**
794
+ * Set this matrix to identity.
795
+ *
796
+ * @returns This matrix.
797
+ */
798
+ public identity(): matrix;
799
+
800
+ /**
801
+ * Set rotation from heading, pitch, and bank angles.
802
+ *
803
+ * @param heading - Heading angle in radians.
804
+ * @param pitch - Pitch angle in radians.
805
+ * @param bank - Bank angle in radians.
806
+ * @returns This matrix.
807
+ */
808
+ public setHPB(heading: f32, pitch: f32, bank: f32): matrix;
809
+
810
+ /**
811
+ * Set rotation from XYZ Euler angles.
812
+ *
813
+ * @param x - X rotation in radians.
814
+ * @param y - Y rotation in radians.
815
+ * @param z - Z rotation in radians.
816
+ * @returns This matrix.
817
+ */
818
+ public setXYZ(x: f32, y: f32, z: f32): matrix;
819
+
820
+ /**
821
+ * Get heading, pitch, and bank from this matrix.
822
+ *
823
+ * @remarks
824
+ * Native Lua uses pointer-style output parameters for `heading`, `pitch`, and `bank`; the declaration keeps the
825
+ * legacy shape for compatibility.
826
+ *
827
+ * @param value - Placeholder kept for existing declaration compatibility.
828
+ * @param heading - Heading output placeholder.
829
+ * @param pitch - Pitch output placeholder.
830
+ * @param bank - Bank output placeholder.
831
+ * @returns This matrix.
832
+ */
833
+ public getHPB(value: matrix, heading: f32, pitch: f32, bank: f32): matrix;
834
+
835
+ /**
836
+ * Set this matrix to `left * right`.
837
+ *
838
+ * @param left - Left matrix.
839
+ * @param right - Right matrix.
840
+ * @returns This matrix.
841
+ */
842
+ public mul(left: matrix, right: matrix): matrix;
843
+
844
+ /**
845
+ * Set this matrix to `value * multiplier`.
846
+ *
847
+ * @param value - Source matrix.
848
+ * @param multiplier - Scalar multiplier.
849
+ * @returns This matrix.
850
+ */
851
+ public mul(value: matrix, multiplier: f32): matrix;
852
+
853
+ /**
854
+ * Multiply this matrix by a scalar.
855
+ *
856
+ * @param multiplier - Scalar multiplier.
857
+ * @returns This matrix.
858
+ */
859
+ public mul(multiplier: f32): matrix;
860
+
861
+ /**
862
+ * Set inverse XYZ rotation from Euler angles.
863
+ *
864
+ * @param x - X rotation in radians.
865
+ * @param y - Y rotation in radians.
866
+ * @param z - Z rotation in radians.
867
+ * @returns This matrix.
868
+ */
869
+ public setXYZi(x: f32, y: f32, z: f32): matrix;
870
+ }
871
+ }