@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.
- package/README.md +19 -1
- package/gen/classes/ArrayOccluder3D.ts +1 -1
- package/gen/classes/CPUParticles2D.ts +3 -3
- package/gen/classes/CPUParticles3D.ts +3 -3
- package/gen/classes/CSGPolygon3D.ts +1 -1
- package/gen/classes/CollisionPolygon2D.ts +1 -1
- package/gen/classes/CollisionPolygon3D.ts +1 -1
- package/gen/classes/ColorPalette.ts +1 -1
- package/gen/classes/ConcavePolygonShape2D.ts +1 -1
- package/gen/classes/ConcavePolygonShape3D.ts +1 -1
- package/gen/classes/ConvexPolygonShape2D.ts +1 -1
- package/gen/classes/ConvexPolygonShape3D.ts +1 -1
- package/gen/classes/FontVariation.ts +1 -1
- package/gen/classes/Gradient.ts +1 -1
- package/gen/classes/Line2D.ts +1 -1
- package/gen/classes/MultiMesh.ts +4 -4
- package/gen/classes/NavigationMesh.ts +1 -1
- package/gen/classes/NavigationObstacle2D.ts +1 -1
- package/gen/classes/NavigationObstacle3D.ts +1 -1
- package/gen/classes/NavigationPathQueryResult2D.ts +1 -1
- package/gen/classes/NavigationPathQueryResult3D.ts +1 -1
- package/gen/classes/NavigationPolygon.ts +1 -1
- package/gen/classes/OccluderPolygon2D.ts +1 -1
- package/gen/classes/Polygon2D.ts +3 -3
- package/gen/classes/PolygonOccluder3D.ts +1 -1
- package/gen/classes/Window.ts +1 -1
- package/gen/index.ts +0 -3
- package/gen/utility-functions.ts +114 -114
- package/gen/value-types/AABB.ts +267 -277
- package/gen/value-types/Basis.ts +313 -264
- package/gen/value-types/Color.ts +398 -268
- package/gen/value-types/Plane.ts +121 -125
- package/gen/value-types/Projection.ts +178 -126
- package/gen/value-types/Quaternion.ts +180 -179
- package/gen/value-types/Rect2.ts +169 -171
- package/gen/value-types/Rect2i.ts +148 -150
- package/gen/value-types/Transform2D.ts +192 -194
- package/gen/value-types/Transform3D.ts +133 -126
- package/gen/value-types/Vector2.ts +370 -354
- package/gen/value-types/Vector2i.ts +192 -191
- package/gen/value-types/Vector3.ts +354 -354
- package/gen/value-types/Vector3i.ts +187 -192
- package/gen/value-types/Vector4.ts +263 -274
- package/gen/value-types/Vector4i.ts +187 -198
- package/gen/value-types/index.ts +16 -16
- package/package.json +20 -4
- package/src/debug.ts +30 -27
- package/src/index.ts +0 -2
- 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 {
|
|
4
|
+
import { _V } from '../../src/runtime.ts';
|
|
5
5
|
import type { GodotArray, GodotDictionary, Variant } from '../heap-types/index.ts';
|
|
6
|
-
import type { Vector2 } from '
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
+
|