@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,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 {
|
|
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 '
|
|
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
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
+
|