@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,201 +1,202 @@
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, Variant } from '../heap-types/index.ts';
6
- import type { Vector2 } from '../value-types/index.ts';
6
+ import type { Vector2 } from './index.ts';
7
7
 
8
8
  /**
9
9
  * A 2-element structure that can be used to represent 2D grid coordinates or any other pair of integers.
10
10
  * It uses integer coordinates and is therefore preferable to {@link Vector2} when exact precision is required. Note that the values are limited to 32 bits, and unlike {@link Vector2} this cannot be configured with an engine build option. Use {@link int} or {@link PackedInt64Array} if 64-bit values are needed.
11
11
  * **Note:** In a boolean context, a Vector2i will evaluate to `false` if it's equal to `Vector2i(0, 0)`. Otherwise, a Vector2i will always evaluate to `true`.
12
12
  */
13
- export class Vector2i extends GodotVar {
14
- /**
15
- * The vector's X component. Also accessible by using the index position `[0]`.
16
- */
17
- get x(): number { return _get(this, 14941) as number; }
18
- set x(v: number) { _set(this, 14941, v); }
19
-
20
- /**
21
- * The vector's Y component. Also accessible by using the index position `[1]`.
22
- */
23
- get y(): number { return _get(this, 14952) as number; }
24
- set y(v: number) { _set(this, 14952, v); }
25
-
26
- constructor();
27
- constructor(from: Vector2i);
28
- constructor(from: Vector2);
29
- constructor(x: number, y: number);
30
- constructor(...args: any[]) { super(6, ...args); }
31
-
32
- /**
33
- * Returns the aspect ratio of this vector, the ratio of {@link x} to {@link y}.
34
- */
35
- aspect(): number { return _C(this, 1602) as number; }
36
-
37
- /**
38
- * Returns the axis of the vector's highest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_X}.
39
- */
40
- maxAxisIndex(): number { return _C(this, 8806) as number; }
41
-
42
- /**
43
- * Returns the axis of the vector's lowest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_Y}.
44
- */
45
- minAxisIndex(): number { return _C(this, 8911) as number; }
46
-
47
- /**
48
- * Returns the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
49
- */
50
- distanceTo(to: Vector2i): number { return _C(this, 2850, to) as number; }
51
-
52
- /**
53
- * Returns the squared [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
54
- * This method runs faster than {@link distanceTo}, so prefer it if you need to compare vectors or need the squared distance for some formula.
55
- */
56
- distanceSquaredTo(to: Vector2i): number { return _C(this, 2849, to) as number; }
57
-
58
- /**
59
- * Returns the length (magnitude) of this vector.
60
- */
61
- length(): number { return _C(this, 8546) as number; }
62
-
63
- /**
64
- * Returns the squared length (squared magnitude) of this vector.
65
- * This method runs faster than {@link length}, so prefer it if you need to compare vectors or need the squared distance for some formula.
66
- */
67
- lengthSquared(): number { return _C(this, 8547) as number; }
68
-
69
- /**
70
- * Returns a new vector with each component set to `1` if it's positive, `-1` if it's negative, and `0` if it's zero. The result is identical to calling {@link sign} on each component.
71
- */
72
- sign(): Vector2i { return _C(this, 13597) as Vector2i; }
73
-
74
- /**
75
- * Returns a new vector with all components in absolute values (i.e. positive).
76
- */
77
- abs(): Vector2i { return _C(this, 1053) as Vector2i; }
78
-
79
- /**
80
- * Returns a new vector with all components clamped between the components of `min` and `max`, by running {@link clamp} on each component.
81
- */
82
- clamp(min: Vector2i, max: Vector2i): Vector2i { return _C(this, 2202, min, max) as Vector2i; }
83
-
84
- /**
85
- * Returns a new vector with all components clamped between `min` and `max`, by running {@link clamp} on each component.
86
- */
87
- clampi(min: number, max: number): Vector2i { return _C(this, 2206, min, max) as Vector2i; }
88
-
89
- /**
90
- * Returns a new vector with each component snapped to the closest multiple of the corresponding component in `step`.
91
- */
92
- snapped(step: Vector2i): Vector2i { return _C(this, 13674, step) as Vector2i; }
93
-
94
- /**
95
- * Returns a new vector with each component snapped to the closest multiple of `step`.
96
- */
97
- snappedi(step: number): Vector2i { return _C(this, 13676, step) as Vector2i; }
98
-
99
- /**
100
- * Returns the component-wise minimum of this and `with`, equivalent to `Vector2i(mini(x, with.x), mini(y, with.y))`.
101
- */
102
- min(_with: Vector2i): Vector2i { return _C(this, 8910, _with) as Vector2i; }
103
-
104
- /**
105
- * Returns the component-wise minimum of this and `with`, equivalent to `Vector2i(mini(x, with), mini(y, with))`.
106
- */
107
- mini(_with: number): Vector2i { return _C(this, 8922, _with) as Vector2i; }
108
-
109
- /**
110
- * Returns the component-wise maximum of this and `with`, equivalent to `Vector2i(maxi(x, with.x), maxi(y, with.y))`.
111
- */
112
- max(_with: Vector2i): Vector2i { return _C(this, 8804, _with) as Vector2i; }
113
-
114
- /**
115
- * Returns the component-wise maximum of this and `with`, equivalent to `Vector2i(maxi(x, with), maxi(y, with))`.
116
- */
117
- maxi(_with: number): Vector2i { return _C(this, 8840, _with) as Vector2i; }
118
-
119
- equals(other: Variant | Vector2i): boolean { return _C(this, -1, other) as boolean; }
120
-
121
- notEquals(other: Variant | Vector2i): boolean { return _C(this, -2, other) as boolean; }
122
-
123
- /**
124
- * Returns the negative value of the {@link Vector2i}. This is the same as writing `Vector2i(-v.x, -v.y)`. This operation flips the direction of the vector while keeping the same magnitude.
125
- */
126
- neg(): Vector2i { return _C(this, -11, undefined) as Vector2i; }
127
-
128
- /**
129
- * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
130
- */
131
- pos(): Vector2i { return _C(this, -12, undefined) as Vector2i; }
132
-
133
- not(): boolean { return _C(this, -24, undefined) as boolean; }
134
-
135
- /**
136
- * Multiplies each component of the {@link Vector2i} by the given {@link int}.
137
- */
138
- mul(other: number | Vector2i): Vector2i { return _C(this, -9, other) as Vector2i; }
139
-
140
- /**
141
- * Divides each component of the {@link Vector2i} by the given {@link int}.
142
- */
143
- div(other: number | Vector2i): Vector2i { return _C(this, -10, other) as Vector2i; }
144
-
145
- /**
146
- * Gets the remainder of each component of the {@link Vector2i} with the given {@link int}. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using {@link posmod} instead if you want to handle negative numbers.
147
- *
148
- * ```text
149
- *
150
- * print(Vector2i(10, -20) % 7) # Prints (3, -6)
151
- *
152
- * ```
153
- */
154
- mod(other: number | Vector2i): Vector2i { return _C(this, -13, other) as Vector2i; }
155
-
156
- /**
157
- * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
158
- */
159
- lessThan(other: Vector2i): boolean { return _C(this, -3, other) as boolean; }
160
-
161
- /**
162
- * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
163
- */
164
- lessThanOrEqual(other: Vector2i): boolean { return _C(this, -4, other) as boolean; }
165
-
166
- /**
167
- * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
168
- */
169
- greaterThan(other: Vector2i): boolean { return _C(this, -5, other) as boolean; }
170
-
171
- /**
172
- * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
173
- */
174
- greaterThanOrEqual(other: Vector2i): boolean { return _C(this, -6, other) as boolean; }
175
-
176
- /**
177
- * Adds each component of the {@link Vector2i} by the components of the given {@link Vector2i}.
178
- *
179
- * ```text
180
- *
181
- * print(Vector2i(10, 20) + Vector2i(3, 4)) # Prints (13, 24)
182
- *
183
- * ```
184
- */
185
- add(other: Vector2i): Vector2i { return _C(this, -7, other) as Vector2i; }
186
-
187
- /**
188
- * Subtracts each component of the {@link Vector2i} by the components of the given {@link Vector2i}.
189
- *
190
- * ```text
191
- *
192
- * print(Vector2i(10, 20) - Vector2i(3, 4)) # Prints (7, 16)
193
- *
194
- * ```
195
- */
196
- sub(other: Vector2i): Vector2i { return _C(this, -8, other) as Vector2i; }
197
-
198
- contains(other: GodotDictionary | GodotArray): boolean { return _C(this, -25, other) as boolean; }
199
-
200
- static readonly name = _R(6, Vector2i);
201
- }
13
+ export type Vector2i = [x: number, y: number];
14
+
15
+ /**
16
+ * Returns the aspect ratio of this vector, the ratio of {@link x} to {@link y}.
17
+ */
18
+ export function aspect(self: Vector2i): number { return _V(6, 1602, self) as number; }
19
+
20
+ /**
21
+ * Returns the axis of the vector's highest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_X}.
22
+ */
23
+ export function maxAxisIndex(self: Vector2i): number { return _V(6, 8806, self) as number; }
24
+
25
+ /**
26
+ * Returns the axis of the vector's lowest value. See `AXIS_*` constants. If all components are equal, this method returns {@link AXIS_Y}.
27
+ */
28
+ export function minAxisIndex(self: Vector2i): number { return _V(6, 8911, self) as number; }
29
+
30
+ /**
31
+ * Returns the [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
32
+ */
33
+ export function distanceTo(self: Vector2i, to: Vector2i): number { return _V(6, 2850, self, to) as number; }
34
+
35
+ /**
36
+ * Returns the squared [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance) between this vector and `to`.
37
+ * This method runs faster than {@link distanceTo}, so prefer it if you need to compare vectors or need the squared distance for some formula.
38
+ */
39
+ export function distanceSquaredTo(self: Vector2i, to: Vector2i): number { return _V(6, 2849, self, to) as number; }
40
+
41
+ /**
42
+ * Returns the length (magnitude) of this vector.
43
+ */
44
+ export function length(self: Vector2i): number { return _V(6, 8546, self) as number; }
45
+
46
+ /**
47
+ * Returns the squared length (squared magnitude) of this vector.
48
+ * This method runs faster than {@link length}, so prefer it if you need to compare vectors or need the squared distance for some formula.
49
+ */
50
+ export function lengthSquared(self: Vector2i): number { return _V(6, 8547, self) as number; }
51
+
52
+ /**
53
+ * Returns a new vector with each component set to `1` if it's positive, `-1` if it's negative, and `0` if it's zero. The result is identical to calling {@link sign} on each component.
54
+ */
55
+ export function sign(self: Vector2i): Vector2i { return _V(6, 13597, self) as Vector2i; }
56
+
57
+ /**
58
+ * Returns a new vector with all components in absolute values (i.e. positive).
59
+ */
60
+ export function abs(self: Vector2i): Vector2i { return _V(6, 1053, self) as Vector2i; }
61
+
62
+ /**
63
+ * Returns a new vector with all components clamped between the components of `min` and `max`, by running {@link clamp} on each component.
64
+ */
65
+ export function clamp(self: Vector2i, min: Vector2i, max: Vector2i): Vector2i { return _V(6, 2202, self, min, max) as Vector2i; }
66
+
67
+ /**
68
+ * Returns a new vector with all components clamped between `min` and `max`, by running {@link clamp} on each component.
69
+ */
70
+ export function clampi(self: Vector2i, min: number, max: number): Vector2i { return _V(6, 2206, self, min, max) as Vector2i; }
71
+
72
+ /**
73
+ * Returns a new vector with each component snapped to the closest multiple of the corresponding component in `step`.
74
+ */
75
+ export function snapped(self: Vector2i, step: Vector2i): Vector2i { return _V(6, 13674, self, step) as Vector2i; }
76
+
77
+ /**
78
+ * Returns a new vector with each component snapped to the closest multiple of `step`.
79
+ */
80
+ export function snappedi(self: Vector2i, step: number): Vector2i { return _V(6, 13676, self, step) as Vector2i; }
81
+
82
+ /**
83
+ * Returns the component-wise minimum of this and `with`, equivalent to `Vector2i(mini(x, with.x), mini(y, with.y))`.
84
+ */
85
+ export function min(self: Vector2i, _with: Vector2i): Vector2i { return _V(6, 8910, self, _with) as Vector2i; }
86
+
87
+ /**
88
+ * Returns the component-wise minimum of this and `with`, equivalent to `Vector2i(mini(x, with), mini(y, with))`.
89
+ */
90
+ export function mini(self: Vector2i, _with: number): Vector2i { return _V(6, 8922, self, _with) as Vector2i; }
91
+
92
+ /**
93
+ * Returns the component-wise maximum of this and `with`, equivalent to `Vector2i(maxi(x, with.x), maxi(y, with.y))`.
94
+ */
95
+ export function max(self: Vector2i, _with: Vector2i): Vector2i { return _V(6, 8804, self, _with) as Vector2i; }
96
+
97
+ /**
98
+ * Returns the component-wise maximum of this and `with`, equivalent to `Vector2i(maxi(x, with), maxi(y, with))`.
99
+ */
100
+ export function maxi(self: Vector2i, _with: number): Vector2i { return _V(6, 8840, self, _with) as Vector2i; }
101
+
102
+ export function equals(a: Vector2i, b: Variant | Vector2i): boolean { return _V(6, -1, a, b) as boolean; }
103
+
104
+ export function notEquals(a: Vector2i, b: Variant | Vector2i): boolean { return _V(6, -2, a, b) as boolean; }
105
+
106
+ /**
107
+ * Returns the negative value of the {@link Vector2i}. This is the same as writing `Vector2i(-v.x, -v.y)`. This operation flips the direction of the vector while keeping the same magnitude.
108
+ */
109
+ export function neg(self: Vector2i): Vector2i { return _V(6, -11, self, undefined) as Vector2i; }
110
+
111
+ /**
112
+ * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
113
+ */
114
+ export function pos(self: Vector2i): Vector2i { return _V(6, -12, self, undefined) as Vector2i; }
115
+
116
+ export function not(self: Vector2i): boolean { return _V(6, -24, self, undefined) as boolean; }
117
+
118
+ /**
119
+ * Multiplies each component of the {@link Vector2i} by the given {@link int}.
120
+ */
121
+ export function mul(a: Vector2i, b: number | Vector2i): Vector2i { return _V(6, -9, a, b) as Vector2i; }
122
+
123
+ /**
124
+ * Divides each component of the {@link Vector2i} by the given {@link int}.
125
+ */
126
+ export function div(a: Vector2i, b: number | Vector2i): Vector2i { return _V(6, -10, a, b) as Vector2i; }
127
+
128
+ /**
129
+ * Gets the remainder of each component of the {@link Vector2i} with the given {@link int}. This operation uses truncated division, which is often not desired as it does not work well with negative numbers. Consider using {@link posmod} instead if you want to handle negative numbers.
130
+ *
131
+ * ```text
132
+ *
133
+ * print(Vector2i(10, -20) % 7) # Prints (3, -6)
134
+ *
135
+ * ```
136
+ */
137
+ export function mod(a: Vector2i, b: number | Vector2i): Vector2i { return _V(6, -13, a, b) as Vector2i; }
138
+
139
+ /**
140
+ * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
141
+ */
142
+ export function lessThan(a: Vector2i, b: Vector2i): boolean { return _V(6, -3, a, b) as boolean; }
143
+
144
+ /**
145
+ * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
146
+ */
147
+ export function lessThanOrEqual(a: Vector2i, b: Vector2i): boolean { return _V(6, -4, a, b) as boolean; }
148
+
149
+ /**
150
+ * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
151
+ */
152
+ export function greaterThan(a: Vector2i, b: Vector2i): boolean { return _V(6, -5, a, b) as boolean; }
153
+
154
+ /**
155
+ * Compares two {@link Vector2i} 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. This operator is useful for sorting vectors.
156
+ */
157
+ export function greaterThanOrEqual(a: Vector2i, b: Vector2i): boolean { return _V(6, -6, a, b) as boolean; }
158
+
159
+ /**
160
+ * Adds each component of the {@link Vector2i} by the components of the given {@link Vector2i}.
161
+ *
162
+ * ```text
163
+ *
164
+ * print(Vector2i(10, 20) + Vector2i(3, 4)) # Prints (13, 24)
165
+ *
166
+ * ```
167
+ */
168
+ export function add(a: Vector2i, b: Vector2i): Vector2i { return _V(6, -7, a, b) as Vector2i; }
169
+
170
+ /**
171
+ * Subtracts each component of the {@link Vector2i} by the components of the given {@link Vector2i}.
172
+ *
173
+ * ```text
174
+ *
175
+ * print(Vector2i(10, 20) - Vector2i(3, 4)) # Prints (7, 16)
176
+ *
177
+ * ```
178
+ */
179
+ export function sub(a: Vector2i, b: Vector2i): Vector2i { return _V(6, -8, a, b) as Vector2i; }
180
+
181
+ export function contains(a: Vector2i, b: GodotDictionary | GodotArray): boolean { return _V(6, -25, a, b) as boolean; }
182
+
183
+ /**
184
+ * Constructs a default-initialized {@link Vector2i} with all components set to `0`.
185
+ */
186
+ export function create(): Vector2i { return _V(6, -4096, 0) as Vector2i; }
187
+
188
+ /**
189
+ * Constructs a {@link Vector2i} as a copy of the given {@link Vector2i}.
190
+ */
191
+ export function fromVector2i(from: Vector2i): Vector2i { return _V(6, -4096, 1, from) as Vector2i; }
192
+
193
+ /**
194
+ * Constructs a new {@link Vector2i} from the given {@link Vector2} by truncating components' fractional parts (rounding towards zero). For a different behavior consider passing the result of {@link Vector2.ceil}, {@link Vector2.floor} or {@link Vector2.round} to this constructor instead.
195
+ */
196
+ export function fromVector2(from: Vector2): Vector2i { return _V(6, -4096, 2, from) as Vector2i; }
197
+
198
+ /**
199
+ * Constructs a new {@link Vector2i} from the given `x` and `y`.
200
+ */
201
+ export function fromXY(x: number, y: number): Vector2i { return _V(6, -4096, 3, x, y) as Vector2i; }
202
+