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