@ringozz/godot 4.7.2-583 → 4.7.2-592

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 (49) hide show
  1. package/README.md +19 -1
  2. package/gen/classes/ArrayOccluder3D.ts +1 -1
  3. package/gen/classes/CPUParticles2D.ts +3 -3
  4. package/gen/classes/CPUParticles3D.ts +3 -3
  5. package/gen/classes/CSGPolygon3D.ts +1 -1
  6. package/gen/classes/CollisionPolygon2D.ts +1 -1
  7. package/gen/classes/CollisionPolygon3D.ts +1 -1
  8. package/gen/classes/ColorPalette.ts +1 -1
  9. package/gen/classes/ConcavePolygonShape2D.ts +1 -1
  10. package/gen/classes/ConcavePolygonShape3D.ts +1 -1
  11. package/gen/classes/ConvexPolygonShape2D.ts +1 -1
  12. package/gen/classes/ConvexPolygonShape3D.ts +1 -1
  13. package/gen/classes/FontVariation.ts +1 -1
  14. package/gen/classes/Gradient.ts +1 -1
  15. package/gen/classes/Line2D.ts +1 -1
  16. package/gen/classes/MultiMesh.ts +4 -4
  17. package/gen/classes/NavigationMesh.ts +1 -1
  18. package/gen/classes/NavigationObstacle2D.ts +1 -1
  19. package/gen/classes/NavigationObstacle3D.ts +1 -1
  20. package/gen/classes/NavigationPathQueryResult2D.ts +1 -1
  21. package/gen/classes/NavigationPathQueryResult3D.ts +1 -1
  22. package/gen/classes/NavigationPolygon.ts +1 -1
  23. package/gen/classes/OccluderPolygon2D.ts +1 -1
  24. package/gen/classes/Polygon2D.ts +3 -3
  25. package/gen/classes/PolygonOccluder3D.ts +1 -1
  26. package/gen/classes/Window.ts +1 -1
  27. package/gen/index.ts +0 -3
  28. package/gen/utility-functions.ts +114 -114
  29. package/gen/value-types/AABB.ts +267 -277
  30. package/gen/value-types/Basis.ts +313 -264
  31. package/gen/value-types/Color.ts +398 -268
  32. package/gen/value-types/Plane.ts +121 -125
  33. package/gen/value-types/Projection.ts +178 -126
  34. package/gen/value-types/Quaternion.ts +180 -179
  35. package/gen/value-types/Rect2.ts +169 -171
  36. package/gen/value-types/Rect2i.ts +148 -150
  37. package/gen/value-types/Transform2D.ts +192 -194
  38. package/gen/value-types/Transform3D.ts +133 -126
  39. package/gen/value-types/Vector2.ts +370 -354
  40. package/gen/value-types/Vector2i.ts +192 -191
  41. package/gen/value-types/Vector3.ts +354 -354
  42. package/gen/value-types/Vector3i.ts +187 -192
  43. package/gen/value-types/Vector4.ts +263 -274
  44. package/gen/value-types/Vector4i.ts +187 -198
  45. package/gen/value-types/index.ts +16 -16
  46. package/package.json +20 -4
  47. package/src/debug.ts +30 -27
  48. package/src/index.ts +0 -2
  49. package/src/runtime.ts +16 -7
@@ -1,9 +1,9 @@
1
1
  // Auto-generated from extension_api.json - DO NOT EDIT
2
2
  // Generated by dev/codegen.ts
3
3
 
4
- import { GodotVar, _C, _R, _get, _set } from '../../src/runtime.ts';
4
+ import { _V } from '../../src/runtime.ts';
5
5
  import type { GodotArray, GodotDictionary, PackedVector4Array, Variant } from '../heap-types/index.ts';
6
- import type { Projection, Vector4i } from '../value-types/index.ts';
6
+ import type { Projection, Vector4i } from './index.ts';
7
7
 
8
8
  /**
9
9
  * A 4-element structure that can be used to represent 4D coordinates or any other quadruplet of numeric values.
@@ -11,275 +11,264 @@ import type { Projection, Vector4i } from '../value-types/index.ts';
11
11
  * See {@link Vector4i} for its integer counterpart.
12
12
  * **Note:** In a boolean context, a Vector4 will evaluate to `false` if it's equal to `Vector4(0, 0, 0, 0)`. Otherwise, a Vector4 will always evaluate to `true`.
13
13
  */
14
- export class Vector4 extends GodotVar {
15
- /**
16
- * The vector's X component. Also accessible by using the index position `[0]`.
17
- */
18
- get x(): number { return _get(this, 14941) as number; }
19
- set x(v: number) { _set(this, 14941, v); }
20
-
21
- /**
22
- * The vector's Y component. Also accessible by using the index position `[1]`.
23
- */
24
- get y(): number { return _get(this, 14952) as number; }
25
- set y(v: number) { _set(this, 14952, v); }
26
-
27
- /**
28
- * The vector's Z component. Also accessible by using the index position `[2]`.
29
- */
30
- get z(): number { return _get(this, 14956) as number; }
31
- set z(v: number) { _set(this, 14956, v); }
32
-
33
- /**
34
- * The vector's W component. Also accessible by using the index position `[3]`.
35
- */
36
- get w(): number { return _get(this, 14833) as number; }
37
- set w(v: number) { _set(this, 14833, v); }
38
-
39
- constructor();
40
- constructor(from: Vector4);
41
- constructor(from: Vector4i);
42
- constructor(x: number, y: number, z: number, w: number);
43
- constructor(...args: any[]) { super(12, ...args); }
44
-
45
- /**
46
- * Returns the axis of the vector's lowest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_W}.
47
- */
48
- minAxisIndex(): number { return _C(this, 8911) as number; }
49
-
50
- /**
51
- * Returns the axis of the vector's highest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_X}.
52
- */
53
- maxAxisIndex(): number { return _C(this, 8806) as number; }
54
-
55
- /**
56
- * Returns the length (magnitude) of this vector.
57
- */
58
- length(): number { return _C(this, 8546) as number; }
59
-
60
- /**
61
- * Returns the squared length (squared magnitude) of this vector.
62
- * This method runs faster than {@link length}, so prefer it if you need to compare vectors or need the squared distance for some formula.
63
- */
64
- lengthSquared(): number { return _C(this, 8547) as number; }
65
-
66
- /**
67
- * Returns a new vector with all components in absolute values (i.e. positive).
68
- */
69
- abs(): Vector4 { return _C(this, 1053) as Vector4; }
70
-
71
- /**
72
- * Returns a new vector with each component set to `1.0` if it's positive, `-1.0` if it's negative, and `0.0` if it's zero. The result is identical to calling {@link sign} on each component.
73
- */
74
- sign(): Vector4 { return _C(this, 13597) as Vector4; }
75
-
76
- /**
77
- * Returns a new vector with all components rounded down (towards negative infinity).
78
- */
79
- floor(): Vector4 { return _C(this, 3335) as Vector4; }
80
-
81
- /**
82
- * Returns a new vector with all components rounded up (towards positive infinity).
83
- */
84
- ceil(): Vector4 { return _C(this, 2156) as Vector4; }
85
-
86
- /**
87
- * Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
88
- */
89
- round(): Vector4 { return _C(this, 10166) as Vector4; }
90
-
91
- /**
92
- * Returns the result of the linear interpolation between this vector and `to` by amount `weight`. `weight` is on the range of `0.0` to `1.0`, representing the amount of interpolation.
93
- */
94
- lerp(to: Vector4, weight: number): Vector4 { return _C(this, 8548, to, weight) as Vector4; }
95
-
96
- /**
97
- * Performs a cubic interpolation between this vector and `b` using `preA` and `postB` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation.
98
- */
99
- cubicInterpolate(b: Vector4, preA: Vector4, postB: Vector4, weight: number): Vector4 { return _C(this, 2590, b, preA, postB, weight) as Vector4; }
100
-
101
- /**
102
- * Performs a cubic interpolation between this vector and `b` using `preA` and `postB` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation.
103
- * It can perform smoother interpolation than {@link cubicInterpolate} by the time values.
104
- */
105
- cubicInterpolateInTime(b: Vector4, preA: Vector4, postB: Vector4, weight: number, bT: number, preAT: number, postBT: number): Vector4 { return _C(this, 2593, b, preA, postB, weight, bT, preAT, postBT) as Vector4; }
106
-
107
- /**
108
- * Returns a vector composed of the {@link fposmod} of this vector's components and `mod`.
109
- */
110
- posmod(mod: number): Vector4 { return _C(this, 9518, mod) as Vector4; }
111
-
112
- /**
113
- * Returns a vector composed of the {@link fposmod} of this vector's components and `modv`'s components.
114
- */
115
- posmodv(modv: Vector4): Vector4 { return _C(this, 9519, modv) as Vector4; }
116
-
117
- /**
118
- * Returns a new vector with each component snapped to the nearest multiple of the corresponding component in `step`. This can also be used to round the components to an arbitrary number of decimals.
119
- */
120
- snapped(step: Vector4): Vector4 { return _C(this, 13674, step) as Vector4; }
121
-
122
- /**
123
- * Returns a new vector with each component snapped to the nearest multiple of `step`. This can also be used to round the components to an arbitrary number of decimals.
124
- */
125
- snappedf(step: number): Vector4 { return _C(this, 13675, step) as Vector4; }
126
-
127
- /**
128
- * Returns a new vector with all components clamped between the components of `min` and `max`, by running {@link clamp} on each component.
129
- */
130
- clamp(min: Vector4, max: Vector4): Vector4 { return _C(this, 2202, min, max) as Vector4; }
131
-
132
- /**
133
- * Returns a new vector with all components clamped between `min` and `max`, by running {@link clamp} on each component.
134
- */
135
- clampf(min: number, max: number): Vector4 { return _C(this, 2205, min, max) as Vector4; }
136
-
137
- /**
138
- * Returns the result of scaling the vector to unit length. Equivalent to `v / v.length()`. Returns `(0, 0, 0, 0)` if `v.length() == 0`. See also {@link isNormalized}.
139
- * **Note:** This function may return incorrect values if the input vector length is near zero.
140
- */
141
- normalized(): Vector4 { return _C(this, 9103) as Vector4; }
142
-
143
- /**
144
- * Returns `true` if the vector is normalized, i.e. its length is approximately equal to 1.
145
- */
146
- isNormalized(): boolean { return _C(this, 8138) as boolean; }
147
-
148
- /**
149
- * Returns the normalized vector pointing from this vector to `to`. This is equivalent to using `(b - a).normalized()`.
150
- */
151
- directionTo(to: Vector4): Vector4 { return _C(this, 2792, to) as Vector4; }
152
-
153
- /**
154
- * Returns the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
155
- */
156
- distanceTo(to: Vector4): number { return _C(this, 2850, to) as number; }
157
-
158
- /**
159
- * Returns the squared [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
160
- * This method runs faster than {@link distanceTo}, so prefer it if you need to compare vectors or need the squared distance for some formula.
161
- */
162
- distanceSquaredTo(to: Vector4): number { return _C(this, 2849, to) as number; }
163
-
164
- /**
165
- * Returns the dot product of this vector and `with`.
166
- */
167
- dot(_with: Vector4): number { return _C(this, 2871, _with) as number; }
168
-
169
- /**
170
- * Returns the inverse of the vector. This is the same as `Vector4(1.0 / v.x, 1.0 / v.y, 1.0 / v.z, 1.0 / v.w)`.
171
- */
172
- inverse(): Vector4 { return _C(this, 7714) as Vector4; }
173
-
174
- /**
175
- * Returns `true` if this vector and `to` are approximately equal, by running {@link isEqualApprox} on each component.
176
- */
177
- isEqualApprox(to: Vector4): boolean { return _C(this, 7938, to) as boolean; }
178
-
179
- /**
180
- * Returns `true` if this vector's values are approximately zero, by running {@link isZeroApprox} on each component.
181
- * This method is faster than using {@link isEqualApprox} with one value as a zero vector.
182
- */
183
- isZeroApprox(): boolean { return _C(this, 8459) as boolean; }
184
-
185
- /**
186
- * Returns `true` if this vector is finite, by calling {@link isFinite} on each component.
187
- */
188
- isFinite(): boolean { return _C(this, 7951) as boolean; }
189
-
190
- /**
191
- * Returns the component-wise minimum of this and `with`, equivalent to `Vector4(minf(x, with.x), minf(y, with.y), minf(z, with.z), minf(w, with.w))`.
192
- */
193
- min(_with: Vector4): Vector4 { return _C(this, 8910, _with) as Vector4; }
194
-
195
- /**
196
- * Returns the component-wise minimum of this and `with`, equivalent to `Vector4(minf(x, with), minf(y, with), minf(z, with), minf(w, with))`.
197
- */
198
- minf(_with: number): Vector4 { return _C(this, 8921, _with) as Vector4; }
199
-
200
- /**
201
- * Returns the component-wise maximum of this and `with`, equivalent to `Vector4(maxf(x, with.x), maxf(y, with.y), maxf(z, with.z), maxf(w, with.w))`.
202
- */
203
- max(_with: Vector4): Vector4 { return _C(this, 8804, _with) as Vector4; }
204
-
205
- /**
206
- * Returns the component-wise maximum of this and `with`, equivalent to `Vector4(maxf(x, with), maxf(y, with), maxf(z, with), maxf(w, with))`.
207
- */
208
- maxf(_with: number): Vector4 { return _C(this, 8839, _with) as Vector4; }
209
-
210
- equals(other: Variant | Vector4): boolean { return _C(this, -1, other) as boolean; }
211
-
212
- notEquals(other: Variant | Vector4): boolean { return _C(this, -2, other) as boolean; }
213
-
214
- /**
215
- * Returns the negative value of the {@link Vector4}. This is the same as writing `Vector4(-v.x, -v.y, -v.z, -v.w)`. This operation flips the direction of the vector while keeping the same magnitude. With floats, the number zero can be either positive or negative.
216
- */
217
- neg(): Vector4 { return _C(this, -11, undefined) as Vector4; }
218
-
219
- /**
220
- * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
221
- */
222
- pos(): Vector4 { return _C(this, -12, undefined) as Vector4; }
223
-
224
- not(): boolean { return _C(this, -24, undefined) as boolean; }
225
-
226
- /**
227
- * Multiplies each component of the {@link Vector4} by the given {@link int}.
228
- */
229
- mul(other: number | Vector4 | Projection): Vector4 { return _C(this, -9, other) as Vector4; }
230
-
231
- /**
232
- * Divides each component of the {@link Vector4} by the given {@link int}.
233
- */
234
- div(other: number | Vector4): Vector4 { return _C(this, -10, other) as Vector4; }
235
-
236
- /**
237
- * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is less than the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
238
- * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
239
- */
240
- lessThan(other: Vector4): boolean { return _C(this, -3, other) as boolean; }
241
-
242
- /**
243
- * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is less than or equal to the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
244
- * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
245
- */
246
- lessThanOrEqual(other: Vector4): boolean { return _C(this, -4, other) as boolean; }
247
-
248
- /**
249
- * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is greater than the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
250
- * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
251
- */
252
- greaterThan(other: Vector4): boolean { return _C(this, -5, other) as boolean; }
253
-
254
- /**
255
- * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is greater than or equal to the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
256
- * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
257
- */
258
- greaterThanOrEqual(other: Vector4): boolean { return _C(this, -6, other) as boolean; }
259
-
260
- /**
261
- * Adds each component of the {@link Vector4} by the components of the given {@link Vector4}.
262
- *
263
- * ```text
264
- *
265
- * print(Vector4(10, 20, 30, 40) + Vector4(3, 4, 5, 6)) # Prints (13.0, 24.0, 35.0, 46.0)
266
- *
267
- * ```
268
- */
269
- add(other: Vector4): Vector4 { return _C(this, -7, other) as Vector4; }
270
-
271
- /**
272
- * Subtracts each component of the {@link Vector4} by the components of the given {@link Vector4}.
273
- *
274
- * ```text
275
- *
276
- * print(Vector4(10, 20, 30, 40) - Vector4(3, 4, 5, 6)) # Prints (7.0, 16.0, 25.0, 34.0)
277
- *
278
- * ```
279
- */
280
- sub(other: Vector4): Vector4 { return _C(this, -8, other) as Vector4; }
281
-
282
- contains(other: GodotDictionary | GodotArray | PackedVector4Array): boolean { return _C(this, -25, other) as boolean; }
283
-
284
- static readonly name = _R(12, Vector4);
285
- }
14
+ export type Vector4 = [x: number, y: number, z: number, w: number];
15
+
16
+ /**
17
+ * Returns the axis of the vector's lowest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_W}.
18
+ */
19
+ export function minAxisIndex(self: Vector4): number { return _V(12, 8911, self) as number; }
20
+
21
+ /**
22
+ * Returns the axis of the vector's highest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_X}.
23
+ */
24
+ export function maxAxisIndex(self: Vector4): number { return _V(12, 8806, self) as number; }
25
+
26
+ /**
27
+ * Returns the length (magnitude) of this vector.
28
+ */
29
+ export function length(self: Vector4): number { return _V(12, 8546, self) as number; }
30
+
31
+ /**
32
+ * Returns the squared length (squared magnitude) of this vector.
33
+ * This method runs faster than {@link length}, so prefer it if you need to compare vectors or need the squared distance for some formula.
34
+ */
35
+ export function lengthSquared(self: Vector4): number { return _V(12, 8547, self) as number; }
36
+
37
+ /**
38
+ * Returns a new vector with all components in absolute values (i.e. positive).
39
+ */
40
+ export function abs(self: Vector4): Vector4 { return _V(12, 1053, self) as Vector4; }
41
+
42
+ /**
43
+ * Returns a new vector with each component set to `1.0` if it's positive, `-1.0` if it's negative, and `0.0` if it's zero. The result is identical to calling {@link sign} on each component.
44
+ */
45
+ export function sign(self: Vector4): Vector4 { return _V(12, 13597, self) as Vector4; }
46
+
47
+ /**
48
+ * Returns a new vector with all components rounded down (towards negative infinity).
49
+ */
50
+ export function floor(self: Vector4): Vector4 { return _V(12, 3335, self) as Vector4; }
51
+
52
+ /**
53
+ * Returns a new vector with all components rounded up (towards positive infinity).
54
+ */
55
+ export function ceil(self: Vector4): Vector4 { return _V(12, 2156, self) as Vector4; }
56
+
57
+ /**
58
+ * Returns a new vector with all components rounded to the nearest integer, with halfway cases rounded away from zero.
59
+ */
60
+ export function round(self: Vector4): Vector4 { return _V(12, 10166, self) as Vector4; }
61
+
62
+ /**
63
+ * Returns the result of the linear interpolation between this vector and `to` by amount `weight`. `weight` is on the range of `0.0` to `1.0`, representing the amount of interpolation.
64
+ */
65
+ export function lerp(self: Vector4, to: Vector4, weight: number): Vector4 { return _V(12, 8548, self, to, weight) as Vector4; }
66
+
67
+ /**
68
+ * Performs a cubic interpolation between this vector and `b` using `preA` and `postB` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation.
69
+ */
70
+ export function cubicInterpolate(self: Vector4, b: Vector4, preA: Vector4, postB: Vector4, weight: number): Vector4 { return _V(12, 2590, self, b, preA, postB, weight) as Vector4; }
71
+
72
+ /**
73
+ * Performs a cubic interpolation between this vector and `b` using `preA` and `postB` as handles, and returns the result at position `weight`. `weight` is on the range of 0.0 to 1.0, representing the amount of interpolation.
74
+ * It can perform smoother interpolation than {@link cubicInterpolate} by the time values.
75
+ */
76
+ export function cubicInterpolateInTime(self: Vector4, b: Vector4, preA: Vector4, postB: Vector4, weight: number, bT: number, preAT: number, postBT: number): Vector4 { return _V(12, 2593, self, b, preA, postB, weight, bT, preAT, postBT) as Vector4; }
77
+
78
+ /**
79
+ * Returns a vector composed of the {@link fposmod} of this vector's components and `mod`.
80
+ */
81
+ export function posmod(self: Vector4, mod: number): Vector4 { return _V(12, 9518, self, mod) as Vector4; }
82
+
83
+ /**
84
+ * Returns a vector composed of the {@link fposmod} of this vector's components and `modv`'s components.
85
+ */
86
+ export function posmodv(self: Vector4, modv: Vector4): Vector4 { return _V(12, 9519, self, modv) as Vector4; }
87
+
88
+ /**
89
+ * Returns a new vector with each component snapped to the nearest multiple of the corresponding component in `step`. This can also be used to round the components to an arbitrary number of decimals.
90
+ */
91
+ export function snapped(self: Vector4, step: Vector4): Vector4 { return _V(12, 13674, self, step) as Vector4; }
92
+
93
+ /**
94
+ * Returns a new vector with each component snapped to the nearest multiple of `step`. This can also be used to round the components to an arbitrary number of decimals.
95
+ */
96
+ export function snappedf(self: Vector4, step: number): Vector4 { return _V(12, 13675, self, step) as Vector4; }
97
+
98
+ /**
99
+ * Returns a new vector with all components clamped between the components of `min` and `max`, by running {@link clamp} on each component.
100
+ */
101
+ export function clamp(self: Vector4, min: Vector4, max: Vector4): Vector4 { return _V(12, 2202, self, min, max) as Vector4; }
102
+
103
+ /**
104
+ * Returns a new vector with all components clamped between `min` and `max`, by running {@link clamp} on each component.
105
+ */
106
+ export function clampf(self: Vector4, min: number, max: number): Vector4 { return _V(12, 2205, self, min, max) as Vector4; }
107
+
108
+ /**
109
+ * Returns the result of scaling the vector to unit length. Equivalent to `v / v.length()`. Returns `(0, 0, 0, 0)` if `v.length() == 0`. See also {@link isNormalized}.
110
+ * **Note:** This function may return incorrect values if the input vector length is near zero.
111
+ */
112
+ export function normalized(self: Vector4): Vector4 { return _V(12, 9103, self) as Vector4; }
113
+
114
+ /**
115
+ * Returns `true` if the vector is normalized, i.e. its length is approximately equal to 1.
116
+ */
117
+ export function isNormalized(self: Vector4): boolean { return _V(12, 8138, self) as boolean; }
118
+
119
+ /**
120
+ * Returns the normalized vector pointing from this vector to `to`. This is equivalent to using `(b - a).normalized()`.
121
+ */
122
+ export function directionTo(self: Vector4, to: Vector4): Vector4 { return _V(12, 2792, self, to) as Vector4; }
123
+
124
+ /**
125
+ * Returns the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
126
+ */
127
+ export function distanceTo(self: Vector4, to: Vector4): number { return _V(12, 2850, self, to) as number; }
128
+
129
+ /**
130
+ * Returns the squared [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
131
+ * This method runs faster than {@link distanceTo}, so prefer it if you need to compare vectors or need the squared distance for some formula.
132
+ */
133
+ export function distanceSquaredTo(self: Vector4, to: Vector4): number { return _V(12, 2849, self, to) as number; }
134
+
135
+ /**
136
+ * Returns the dot product of this vector and `with`.
137
+ */
138
+ export function dot(self: Vector4, _with: Vector4): number { return _V(12, 2871, self, _with) as number; }
139
+
140
+ /**
141
+ * Returns the inverse of the vector. This is the same as `Vector4(1.0 / v.x, 1.0 / v.y, 1.0 / v.z, 1.0 / v.w)`.
142
+ */
143
+ export function inverse(self: Vector4): Vector4 { return _V(12, 7714, self) as Vector4; }
144
+
145
+ /**
146
+ * Returns `true` if this vector and `to` are approximately equal, by running {@link isEqualApprox} on each component.
147
+ */
148
+ export function isEqualApprox(self: Vector4, to: Vector4): boolean { return _V(12, 7938, self, to) as boolean; }
149
+
150
+ /**
151
+ * Returns `true` if this vector's values are approximately zero, by running {@link isZeroApprox} on each component.
152
+ * This method is faster than using {@link isEqualApprox} with one value as a zero vector.
153
+ */
154
+ export function isZeroApprox(self: Vector4): boolean { return _V(12, 8459, self) as boolean; }
155
+
156
+ /**
157
+ * Returns `true` if this vector is finite, by calling {@link isFinite} on each component.
158
+ */
159
+ export function isFinite(self: Vector4): boolean { return _V(12, 7951, self) as boolean; }
160
+
161
+ /**
162
+ * Returns the component-wise minimum of this and `with`, equivalent to `Vector4(minf(x, with.x), minf(y, with.y), minf(z, with.z), minf(w, with.w))`.
163
+ */
164
+ export function min(self: Vector4, _with: Vector4): Vector4 { return _V(12, 8910, self, _with) as Vector4; }
165
+
166
+ /**
167
+ * Returns the component-wise minimum of this and `with`, equivalent to `Vector4(minf(x, with), minf(y, with), minf(z, with), minf(w, with))`.
168
+ */
169
+ export function minf(self: Vector4, _with: number): Vector4 { return _V(12, 8921, self, _with) as Vector4; }
170
+
171
+ /**
172
+ * Returns the component-wise maximum of this and `with`, equivalent to `Vector4(maxf(x, with.x), maxf(y, with.y), maxf(z, with.z), maxf(w, with.w))`.
173
+ */
174
+ export function max(self: Vector4, _with: Vector4): Vector4 { return _V(12, 8804, self, _with) as Vector4; }
175
+
176
+ /**
177
+ * Returns the component-wise maximum of this and `with`, equivalent to `Vector4(maxf(x, with), maxf(y, with), maxf(z, with), maxf(w, with))`.
178
+ */
179
+ export function maxf(self: Vector4, _with: number): Vector4 { return _V(12, 8839, self, _with) as Vector4; }
180
+
181
+ export function equals(a: Vector4, b: Variant | Vector4): boolean { return _V(12, -1, a, b) as boolean; }
182
+
183
+ export function notEquals(a: Vector4, b: Variant | Vector4): boolean { return _V(12, -2, a, b) as boolean; }
184
+
185
+ /**
186
+ * Returns the negative value of the {@link Vector4}. This is the same as writing `Vector4(-v.x, -v.y, -v.z, -v.w)`. This operation flips the direction of the vector while keeping the same magnitude. With floats, the number zero can be either positive or negative.
187
+ */
188
+ export function neg(self: Vector4): Vector4 { return _V(12, -11, self, undefined) as Vector4; }
189
+
190
+ /**
191
+ * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
192
+ */
193
+ export function pos(self: Vector4): Vector4 { return _V(12, -12, self, undefined) as Vector4; }
194
+
195
+ export function not(self: Vector4): boolean { return _V(12, -24, self, undefined) as boolean; }
196
+
197
+ /**
198
+ * Multiplies each component of the {@link Vector4} by the given {@link int}.
199
+ */
200
+ export function mul(a: Vector4, b: number | Vector4 | Projection): Vector4 { return _V(12, -9, a, b) as Vector4; }
201
+
202
+ /**
203
+ * Divides each component of the {@link Vector4} by the given {@link int}.
204
+ */
205
+ export function div(a: Vector4, b: number | Vector4): Vector4 { return _V(12, -10, a, b) as Vector4; }
206
+
207
+ /**
208
+ * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is less than the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
209
+ * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
210
+ */
211
+ export function lessThan(a: Vector4, b: Vector4): boolean { return _V(12, -3, a, b) as boolean; }
212
+
213
+ /**
214
+ * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is less than or equal to the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
215
+ * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
216
+ */
217
+ export function lessThanOrEqual(a: Vector4, b: Vector4): boolean { return _V(12, -4, a, b) as boolean; }
218
+
219
+ /**
220
+ * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is greater than the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
221
+ * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
222
+ */
223
+ export function greaterThan(a: Vector4, b: Vector4): boolean { return _V(12, -5, a, b) as boolean; }
224
+
225
+ /**
226
+ * Compares two {@link Vector4} vectors by first checking if the X value of the left vector is greater than or equal to the X value of the `right` vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, Z values of the two vectors, and then with the W values. This operator is useful for sorting vectors.
227
+ * **Note:** Vectors with `NAN` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
228
+ */
229
+ export function greaterThanOrEqual(a: Vector4, b: Vector4): boolean { return _V(12, -6, a, b) as boolean; }
230
+
231
+ /**
232
+ * Adds each component of the {@link Vector4} by the components of the given {@link Vector4}.
233
+ *
234
+ * ```text
235
+ *
236
+ * print(Vector4(10, 20, 30, 40) + Vector4(3, 4, 5, 6)) # Prints (13.0, 24.0, 35.0, 46.0)
237
+ *
238
+ * ```
239
+ */
240
+ export function add(a: Vector4, b: Vector4): Vector4 { return _V(12, -7, a, b) as Vector4; }
241
+
242
+ /**
243
+ * Subtracts each component of the {@link Vector4} by the components of the given {@link Vector4}.
244
+ *
245
+ * ```text
246
+ *
247
+ * print(Vector4(10, 20, 30, 40) - Vector4(3, 4, 5, 6)) # Prints (7.0, 16.0, 25.0, 34.0)
248
+ *
249
+ * ```
250
+ */
251
+ export function sub(a: Vector4, b: Vector4): Vector4 { return _V(12, -8, a, b) as Vector4; }
252
+
253
+ export function contains(a: Vector4, b: GodotDictionary | GodotArray | PackedVector4Array): boolean { return _V(12, -25, a, b) as boolean; }
254
+
255
+ /**
256
+ * Constructs a default-initialized {@link Vector4} with all components set to `0`.
257
+ */
258
+ export function create(): Vector4 { return _V(12, -4096, 0) as Vector4; }
259
+
260
+ /**
261
+ * Constructs a {@link Vector4} as a copy of the given {@link Vector4}.
262
+ */
263
+ export function fromVector4(from: Vector4): Vector4 { return _V(12, -4096, 1, from) as Vector4; }
264
+
265
+ /**
266
+ * Constructs a new {@link Vector4} from the given {@link Vector4i}.
267
+ */
268
+ export function fromVector4i(from: Vector4i): Vector4 { return _V(12, -4096, 2, from) as Vector4; }
269
+
270
+ /**
271
+ * Returns a {@link Vector4} with the given components.
272
+ */
273
+ export function fromXYZW(x: number, y: number, z: number, w: number): Vector4 { return _V(12, -4096, 3, x, y, z, w) as Vector4; }
274
+