@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, PackedVector2Array, Variant } from '../heap-types/index.ts';
|
|
6
|
-
import type { Rect2, Vector2 } from '
|
|
6
|
+
import type { Rect2, Vector2 } from './index.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The {@link Transform2D} built-in {@link Variant} type is a 2×3 [matrix](https://en.wikipedia.org/wiki/Matrix_(mathematics)) representing a transformation in 2D space. It contains three {@link Vector2} values: {@link x}, {@link y}, and {@link origin}. Together, they can represent translation, rotation, scale, and skew.
|
|
@@ -12,195 +12,193 @@ import type { Rect2, Vector2 } from '../value-types/index.ts';
|
|
|
12
12
|
* **Note:** Unlike {@link Transform3D}, there is no 2D equivalent to the {@link Basis} type. All mentions of "basis" refer to the {@link x} and {@link y} components of {@link Transform2D}.
|
|
13
13
|
* **Note:** In a boolean context, a Transform2D will evaluate to `false` if it's equal to {@link IDENTITY}. Otherwise, a Transform2D will always evaluate to `true`.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
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
|
-
static readonly name = _R(11, Transform2D);
|
|
206
|
-
}
|
|
15
|
+
export type Transform2D = [x: Vector2, y: Vector2, origin: Vector2];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns the [inverted version of this transform](https://en.wikipedia.org/wiki/Invertible_matrix).
|
|
19
|
+
* **Note:** For this method to return correctly, the transform's basis needs to be *orthonormal* (see {@link orthonormalized}). That means the basis should only represent a rotation. If it does not, use {@link affineInverse} instead.
|
|
20
|
+
*/
|
|
21
|
+
export function inverse(self: Transform2D): Transform2D { return _V(11, 7714, self) as Transform2D; }
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Returns the inverted version of this transform. Unlike {@link inverse}, this method works with almost any basis, including non-uniform ones, but is slower.
|
|
25
|
+
* **Note:** For this method to return correctly, the transform's basis needs to have a determinant that is not exactly `0.0` (see {@link determinant}).
|
|
26
|
+
*/
|
|
27
|
+
export function affineInverse(self: Transform2D): Transform2D { return _V(11, 1354, self) as Transform2D; }
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns this transform's rotation (in radians). This is equivalent to {@link x}'s angle (see {@link Vector2.angle}).
|
|
31
|
+
*/
|
|
32
|
+
export function getRotation(self: Transform2D): number { return _V(11, 6204, self) as number; }
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns this transform's translation. Equivalent to {@link origin}.
|
|
36
|
+
*/
|
|
37
|
+
export function getOrigin(self: Transform2D): Vector2 { return _V(11, 5739, self) as Vector2; }
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns the length of both {@link x} and {@link y}, as a {@link Vector2}. If this transform's basis is not skewed, this value is the scaling factor. It is not affected by rotation.
|
|
41
|
+
*
|
|
42
|
+
*
|
|
43
|
+
* ```gdscript
|
|
44
|
+
*
|
|
45
|
+
* var my_transform = Transform2D(
|
|
46
|
+
* Vector2(2, 0),
|
|
47
|
+
* Vector2(0, 4),
|
|
48
|
+
* Vector2(0, 0)
|
|
49
|
+
* )
|
|
50
|
+
* # Rotating the Transform2D in any way preserves its scale.
|
|
51
|
+
* my_transform = my_transform.rotated(TAU / 2)
|
|
52
|
+
*
|
|
53
|
+
* print(my_transform.get_scale()) # Prints (2.0, 4.0)
|
|
54
|
+
*
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
* **Note:** If the value returned by {@link determinant} is negative, the scale is also negative.
|
|
60
|
+
*/
|
|
61
|
+
export function getScale(self: Transform2D): Vector2 { return _V(11, 6236, self) as Vector2; }
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns this transform's skew (in radians).
|
|
65
|
+
*/
|
|
66
|
+
export function getSkew(self: Transform2D): number { return _V(11, 6411, self) as number; }
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a copy of this transform with its basis orthonormalized. An orthonormal basis is both *orthogonal* (the axes are perpendicular to each other) and *normalized* (the axes have a length of `1.0`), which also means it can only represent a rotation.
|
|
70
|
+
*/
|
|
71
|
+
export function orthonormalized(self: Transform2D): Transform2D { return _V(11, 9230, self) as Transform2D; }
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns a copy of this transform rotated by the given `angle` (in radians).
|
|
75
|
+
* If `angle` is positive, the transform is rotated clockwise.
|
|
76
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding rotation transform `R` from the left, i.e., `R * X`.
|
|
77
|
+
* This can be seen as transforming with respect to the global/parent frame.
|
|
78
|
+
*/
|
|
79
|
+
export function rotated(self: Transform2D, angle: number): Transform2D { return _V(11, 10144, self, angle) as Transform2D; }
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns a copy of the transform rotated by the given `angle` (in radians).
|
|
83
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding rotation transform `R` from the right, i.e., `X * R`.
|
|
84
|
+
* This can be seen as transforming with respect to the local frame.
|
|
85
|
+
*/
|
|
86
|
+
export function rotatedLocal(self: Transform2D, angle: number): Transform2D { return _V(11, 10145, self, angle) as Transform2D; }
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns a copy of the transform scaled by the given `scale` factor.
|
|
90
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding scaling transform `S` from the left, i.e., `S * X`.
|
|
91
|
+
* This can be seen as transforming with respect to the global/parent frame.
|
|
92
|
+
*/
|
|
93
|
+
export function scaled(self: Transform2D, scale: Vector2): Transform2D { return _V(11, 10232, self, scale) as Transform2D; }
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns a copy of the transform scaled by the given `scale` factor.
|
|
97
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding scaling transform `S` from the right, i.e., `X * S`.
|
|
98
|
+
* This can be seen as transforming with respect to the local frame.
|
|
99
|
+
*/
|
|
100
|
+
export function scaledLocal(self: Transform2D, scale: Vector2): Transform2D { return _V(11, 10233, self, scale) as Transform2D; }
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Returns a copy of the transform translated by the given `offset`.
|
|
104
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding translation transform `T` from the left, i.e., `T * X`.
|
|
105
|
+
* This can be seen as transforming with respect to the global/parent frame.
|
|
106
|
+
*/
|
|
107
|
+
export function translated(self: Transform2D, offset: Vector2): Transform2D { return _V(11, 14398, self, offset) as Transform2D; }
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns a copy of the transform translated by the given `offset`.
|
|
111
|
+
* This method is an optimized version of multiplying the given transform `X` with a corresponding translation transform `T` from the right, i.e., `X * T`.
|
|
112
|
+
* This can be seen as transforming with respect to the local frame.
|
|
113
|
+
*/
|
|
114
|
+
export function translatedLocal(self: Transform2D, offset: Vector2): Transform2D { return _V(11, 14399, self, offset) as Transform2D; }
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns the [determinant](https://en.wikipedia.org/wiki/Determinant) of this transform basis's matrix. For advanced math, this number can be used to determine a few attributes:
|
|
118
|
+
* - If the determinant is exactly `0.0`, the basis is not invertible (see {@link inverse}).
|
|
119
|
+
* - If the determinant is a negative number, the basis represents a negative scale.
|
|
120
|
+
* **Note:** If the basis's scale is the same for every axis, its determinant is always that scale by the power of 2.
|
|
121
|
+
*/
|
|
122
|
+
export function determinant(self: Transform2D): number { return _V(11, 2773, self) as number; }
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Returns a copy of the `v` vector, transformed (multiplied) by the transform basis's matrix. Unlike the multiplication operator (`*`), this method ignores the {@link origin}.
|
|
126
|
+
*/
|
|
127
|
+
export function basisXform(self: Transform2D, v: Vector2): Vector2 { return _V(11, 1740, self, v) as Vector2; }
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Returns a copy of the `v` vector, transformed (multiplied) by the inverse transform basis's matrix (see {@link inverse}). This method ignores the {@link origin}.
|
|
131
|
+
* **Note:** This method assumes that this transform's basis is *orthonormal* (see {@link orthonormalized}). If the basis is not orthonormal, `transform.affine_inverse().basis_xform(vector)` should be used instead (see {@link affineInverse}).
|
|
132
|
+
*/
|
|
133
|
+
export function basisXformInv(self: Transform2D, v: Vector2): Vector2 { return _V(11, 1741, self, v) as Vector2; }
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Returns the result of the linear interpolation between this transform and `xform` by the given `weight`.
|
|
137
|
+
* The `weight` should be between `0.0` and `1.0` (inclusive). Values outside this range are allowed and can be used to perform *extrapolation* instead.
|
|
138
|
+
*/
|
|
139
|
+
export function interpolateWith(self: Transform2D, xform: Transform2D, weight: number): Transform2D { return _V(11, 7694, self, xform, weight) as Transform2D; }
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Returns `true` if this transform's basis is conformal. A conformal basis is both *orthogonal* (the axes are perpendicular to each other) and *uniform* (the axes share the same length). This method can be especially useful during physics calculations.
|
|
143
|
+
*/
|
|
144
|
+
export function isConformal(self: Transform2D): boolean { return _V(11, 7854, self) as boolean; }
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Returns `true` if this transform and `xform` are approximately equal, by running {@link isEqualApprox} on each component.
|
|
148
|
+
*/
|
|
149
|
+
export function isEqualApprox(self: Transform2D, xform: Transform2D): boolean { return _V(11, 7938, self, xform) as boolean; }
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Returns `true` if this transform is finite, by calling {@link isFinite} on each component.
|
|
153
|
+
*/
|
|
154
|
+
export function isFinite(self: Transform2D): boolean { return _V(11, 7951, self) as boolean; }
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Returns a copy of the transform rotated such that the rotated X-axis points towards the `target` position, in global space.
|
|
158
|
+
*/
|
|
159
|
+
export function lookingAt(self: Transform2D, target?: Vector2 /* = Vector2(0, 0) */): Transform2D { return _V(11, 8708, self, target) as Transform2D; }
|
|
160
|
+
|
|
161
|
+
export function equals(a: Transform2D, b: Variant | Transform2D): boolean { return _V(11, -1, a, b) as boolean; }
|
|
162
|
+
|
|
163
|
+
export function notEquals(a: Transform2D, b: Variant | Transform2D): boolean { return _V(11, -2, a, b) as boolean; }
|
|
164
|
+
|
|
165
|
+
export function not(self: Transform2D): boolean { return _V(11, -24, self, undefined) as boolean; }
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Multiplies all components of the {@link Transform2D} by the given {@link int}, including the {@link origin}. This affects the transform's scale uniformly.
|
|
169
|
+
*/
|
|
170
|
+
export function mul(a: Transform2D, b: number | Vector2 | Rect2 | Transform2D | PackedVector2Array): Transform2D { return _V(11, -9, a, b) as Transform2D; }
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Divides all components of the {@link Transform2D} by the given {@link int}, including the {@link origin}. This affects the transform's scale uniformly.
|
|
174
|
+
*/
|
|
175
|
+
export function div(a: Transform2D, b: number): Transform2D { return _V(11, -10, a, b) as Transform2D; }
|
|
176
|
+
|
|
177
|
+
export function contains(a: Transform2D, b: GodotDictionary | GodotArray): boolean { return _V(11, -25, a, b) as boolean; }
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Constructs a {@link Transform2D} identical to {@link IDENTITY}.
|
|
181
|
+
* **Note:** In C#, this constructs a {@link Transform2D} with all of its components set to {@link Vector2.ZERO}.
|
|
182
|
+
*/
|
|
183
|
+
export function create(): Transform2D { return _V(11, -4096, 0) as Transform2D; }
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Constructs a {@link Transform2D} as a copy of the given {@link Transform2D}.
|
|
187
|
+
*/
|
|
188
|
+
export function fromTransform2D(from: Transform2D): Transform2D { return _V(11, -4096, 1, from) as Transform2D; }
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Constructs a {@link Transform2D} from a given angle (in radians) and position.
|
|
192
|
+
*/
|
|
193
|
+
export function fromRotationPosition(rotation: number, position: Vector2): Transform2D { return _V(11, -4096, 2, rotation, position) as Transform2D; }
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Constructs a {@link Transform2D} from a given angle (in radians), scale, skew (in radians), and position.
|
|
197
|
+
*/
|
|
198
|
+
export function fromRotationScaleSkewPosition(rotation: number, scale: Vector2, skew: number, position: Vector2): Transform2D { return _V(11, -4096, 3, rotation, scale, skew, position) as Transform2D; }
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Constructs a {@link Transform2D} from 3 {@link Vector2} values representing {@link x}, {@link y}, and the {@link origin} (the three matrix columns).
|
|
202
|
+
*/
|
|
203
|
+
export function fromXAxisYAxisOrigin(xAxis: Vector2, yAxis: Vector2, origin: Vector2): Transform2D { return _V(11, -4096, 4, xAxis, yAxis, origin) as Transform2D; }
|
|
204
|
+
|