@ringozz/godot 4.7.2-583 → 4.7.2-585
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
package/gen/value-types/AABB.ts
CHANGED
|
@@ -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, Variant } from '../heap-types/index.ts';
|
|
6
|
-
import type { Plane, Transform3D, Vector3 } from '
|
|
6
|
+
import type { Plane, Transform3D, Vector3 } from './index.ts';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The {@link AABB} built-in {@link Variant} type represents an axis-aligned bounding box in a 3D space. It is defined by its {@link position} and {@link size}, which are {@link Vector3}. It is frequently used for fast overlap tests (see {@link intersects}). Although {@link AABB} itself is axis-aligned, it can be combined with {@link Transform3D} to represent a rotated or skewed bounding box.
|
|
@@ -11,278 +11,268 @@ import type { Plane, Transform3D, Vector3 } from '../value-types/index.ts';
|
|
|
11
11
|
* **Note:** Negative values for {@link size} are not supported. With negative size, most {@link AABB} methods do not work correctly. Use {@link abs} to get an equivalent {@link AABB} with a non-negative size.
|
|
12
12
|
* **Note:** In a boolean context, an {@link AABB} evaluates to `false` if both {@link position} and {@link size} are zero (equal to {@link Vector3.ZERO}). Otherwise, it always evaluates 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
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
* Inversely transforms (multiplies) the {@link AABB} by the given {@link Transform3D} transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
|
|
280
|
-
* `aabb * transform` is equivalent to `transform.inverse() * aabb`. See {@link Transform3D.inverse}.
|
|
281
|
-
* For transforming by inverse of an affine transformation (e.g. with scaling) `transform.affine_inverse() * aabb` can be used instead. See {@link Transform3D.affineInverse}.
|
|
282
|
-
*/
|
|
283
|
-
mul(other: Transform3D): AABB { return _C(this, -9, other) as AABB; }
|
|
284
|
-
|
|
285
|
-
contains(other: GodotDictionary | GodotArray): boolean { return _C(this, -25, other) as boolean; }
|
|
286
|
-
|
|
287
|
-
static readonly name = _R(16, AABB);
|
|
288
|
-
}
|
|
14
|
+
export type AABB = [position: Vector3, size: Vector3];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns an {@link AABB} equivalent to this bounding box, with its width, height, and depth modified to be non-negative values.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* ```gdscript
|
|
21
|
+
*
|
|
22
|
+
* var box = AABB(Vector3(5, 0, 5), Vector3(-20, -10, -5))
|
|
23
|
+
* var absolute = box.abs()
|
|
24
|
+
* print(absolute.position) # Prints (-15.0, -10.0, 0.0)
|
|
25
|
+
* print(absolute.size) # Prints (20.0, 10.0, 5.0)
|
|
26
|
+
*
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
*
|
|
31
|
+
* **Note:** It's recommended to use this method when {@link size} is negative, as most other methods in Godot assume that the {@link size}'s components are greater than `0`.
|
|
32
|
+
*/
|
|
33
|
+
export function abs(self: AABB): AABB { return _V(16, 1053, self) as AABB; }
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns the center point of the bounding box. This is the same as `position + (size / 2.0)`.
|
|
37
|
+
*/
|
|
38
|
+
export function getCenter(self: AABB): Vector3 { return _V(16, 4121, self) as Vector3; }
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns the bounding box's volume. This is equivalent to `size.x * size.y * size.z`. See also {@link hasVolume}.
|
|
42
|
+
*/
|
|
43
|
+
export function getVolume(self: AABB): number { return _V(16, 7120, self) as number; }
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns `true` if this bounding box's width, height, and depth are all positive. See also {@link getVolume}.
|
|
47
|
+
*/
|
|
48
|
+
export function hasVolume(self: AABB): boolean { return _V(16, 7485, self) as boolean; }
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns `true` if this bounding box has a surface or a length, that is, at least one component of {@link size} is greater than `0`. Otherwise, returns `false`.
|
|
52
|
+
*/
|
|
53
|
+
export function hasSurface(self: AABB): boolean { return _V(16, 7455, self) as boolean; }
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Returns `true` if the bounding box contains the given `point`. By convention, points exactly on the right, top, and front sides are **not** included.
|
|
57
|
+
* **Note:** This method is not reliable for {@link AABB} with a *negative* {@link size}. Use {@link abs} first to get a valid bounding box.
|
|
58
|
+
*/
|
|
59
|
+
export function hasPoint(self: AABB, point: Vector3): boolean { return _V(16, 7430, self, point) as boolean; }
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns `true` if this bounding box and `aabb` are approximately equal, by calling {@link Vector3.isEqualApprox} on the {@link position} and the {@link size}.
|
|
63
|
+
*/
|
|
64
|
+
export function isEqualApprox(self: AABB, aabb: AABB): boolean { return _V(16, 7938, self, aabb) as boolean; }
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Returns `true` if this bounding box's values are finite, by calling {@link Vector3.isFinite} on the {@link position} and the {@link size}.
|
|
68
|
+
*/
|
|
69
|
+
export function isFinite(self: AABB): boolean { return _V(16, 7951, self) as boolean; }
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns `true` if this bounding box overlaps with the box `with`. The edges of both boxes are *always* excluded.
|
|
73
|
+
*/
|
|
74
|
+
export function intersects(self: AABB, _with: AABB): boolean { return _V(16, 7707, self, _with) as boolean; }
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Returns `true` if this bounding box *completely* encloses the `with` box. The edges of both boxes are included.
|
|
78
|
+
*
|
|
79
|
+
*
|
|
80
|
+
* ```gdscript
|
|
81
|
+
*
|
|
82
|
+
* var a = AABB(Vector3(0, 0, 0), Vector3(4, 4, 4))
|
|
83
|
+
* var b = AABB(Vector3(1, 1, 1), Vector3(3, 3, 3))
|
|
84
|
+
* var c = AABB(Vector3(2, 2, 2), Vector3(8, 8, 8))
|
|
85
|
+
*
|
|
86
|
+
* print(a.encloses(a)) # Prints true
|
|
87
|
+
* print(a.encloses(b)) # Prints true
|
|
88
|
+
* print(a.encloses(c)) # Prints false
|
|
89
|
+
*
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export function encloses(self: AABB, _with: AABB): boolean { return _V(16, 3077, self, _with) as boolean; }
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Returns `true` if this bounding box is on both sides of the given `plane`.
|
|
96
|
+
*/
|
|
97
|
+
export function intersectsPlane(self: AABB, plane: Plane): boolean { return _V(16, 7708, self, plane) as boolean; }
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Returns the intersection between this bounding box and `with`. If the boxes do not intersect, returns an empty {@link AABB}. If the boxes intersect at the edge, returns a flat {@link AABB} with no volume (see {@link hasSurface} and {@link hasVolume}).
|
|
101
|
+
*
|
|
102
|
+
*
|
|
103
|
+
* ```gdscript
|
|
104
|
+
*
|
|
105
|
+
* var box1 = AABB(Vector3(0, 0, 0), Vector3(5, 2, 8))
|
|
106
|
+
* var box2 = AABB(Vector3(2, 0, 2), Vector3(8, 4, 4))
|
|
107
|
+
*
|
|
108
|
+
* var intersection = box1.intersection(box2)
|
|
109
|
+
* print(intersection.position) # Prints (2.0, 0.0, 2.0)
|
|
110
|
+
* print(intersection.size) # Prints (3.0, 2.0, 4.0)
|
|
111
|
+
*
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* **Note:** If you only need to know whether two bounding boxes are intersecting, use {@link intersects}, instead.
|
|
117
|
+
*/
|
|
118
|
+
export function intersection(self: AABB, _with: AABB): AABB { return _V(16, 7705, self, _with) as AABB; }
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Returns an {@link AABB} that encloses both this bounding box and `with` around the edges. See also {@link encloses}.
|
|
122
|
+
*/
|
|
123
|
+
export function merge(self: AABB, _with: AABB): AABB { return _V(16, 8850, self, _with) as AABB; }
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Returns a copy of this bounding box expanded to align the edges with the given `toPoint`, if necessary.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
* ```gdscript
|
|
130
|
+
*
|
|
131
|
+
* var box = AABB(Vector3(0, 0, 0), Vector3(5, 2, 5))
|
|
132
|
+
*
|
|
133
|
+
* box = box.expand(Vector3(10, 0, 0))
|
|
134
|
+
* print(box.position) # Prints (0.0, 0.0, 0.0)
|
|
135
|
+
* print(box.size) # Prints (10.0, 2.0, 5.0)
|
|
136
|
+
*
|
|
137
|
+
* box = box.expand(Vector3(-5, 0, 5))
|
|
138
|
+
* print(box.position) # Prints (-5.0, 0.0, 0.0)
|
|
139
|
+
* print(box.size) # Prints (15.0, 2.0, 5.0)
|
|
140
|
+
*
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
export function expand(self: AABB, toPoint: Vector3): AABB { return _V(16, 3187, self, toPoint) as AABB; }
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Returns a copy of this bounding box extended on all sides by the given amount `by`. A negative amount shrinks the box instead.
|
|
147
|
+
*
|
|
148
|
+
*
|
|
149
|
+
* ```gdscript
|
|
150
|
+
*
|
|
151
|
+
* var a = AABB(Vector3(4, 4, 4), Vector3(8, 8, 8)).grow(4)
|
|
152
|
+
* print(a.position) # Prints (0.0, 0.0, 0.0)
|
|
153
|
+
* print(a.size) # Prints (16.0, 16.0, 16.0)
|
|
154
|
+
*
|
|
155
|
+
* var b = AABB(Vector3(0, 0, 0), Vector3(8, 4, 2)).grow(2)
|
|
156
|
+
* print(b.position) # Prints (-2.0, -2.0, -2.0)
|
|
157
|
+
* print(b.size) # Prints (12.0, 8.0, 6.0)
|
|
158
|
+
*
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export function grow(self: AABB, by: number): AABB { return _V(16, 7304, self, by) as AABB; }
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Returns the vertex's position of this bounding box that's the farthest in the given direction. This point is commonly known as the support point in collision detection algorithms.
|
|
165
|
+
*/
|
|
166
|
+
export function getSupport(self: AABB, direction: Vector3): Vector3 { return _V(16, 6612, self, direction) as Vector3; }
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Returns the longest normalized axis of this bounding box's {@link size}, as a {@link Vector3} ({@link Vector3.RIGHT}, {@link Vector3.UP}, or {@link Vector3.BACK}).
|
|
170
|
+
*
|
|
171
|
+
*
|
|
172
|
+
* ```gdscript
|
|
173
|
+
*
|
|
174
|
+
* var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
|
175
|
+
*
|
|
176
|
+
* print(box.get_longest_axis()) # Prints (0.0, 0.0, 1.0)
|
|
177
|
+
* print(box.get_longest_axis_index()) # Prints 2
|
|
178
|
+
* print(box.get_longest_axis_size()) # Prints 8.0
|
|
179
|
+
*
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
*
|
|
183
|
+
*
|
|
184
|
+
* See also {@link getLongestAxisIndex} and {@link getLongestAxisSize}.
|
|
185
|
+
*/
|
|
186
|
+
export function getLongestAxis(self: AABB): Vector3 { return _V(16, 5413, self) as Vector3; }
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Returns the index to the longest axis of this bounding box's {@link size} (see {@link Vector3.AXIS_X}, {@link Vector3.AXIS_Y}, and {@link Vector3.AXIS_Z}).
|
|
190
|
+
* For an example, see {@link getLongestAxis}.
|
|
191
|
+
*/
|
|
192
|
+
export function getLongestAxisIndex(self: AABB): number { return _V(16, 5414, self) as number; }
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Returns the longest dimension of this bounding box's {@link size}.
|
|
196
|
+
* For an example, see {@link getLongestAxis}.
|
|
197
|
+
*/
|
|
198
|
+
export function getLongestAxisSize(self: AABB): number { return _V(16, 5415, self) as number; }
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Returns the shortest normalized axis of this bounding box's {@link size}, as a {@link Vector3} ({@link Vector3.RIGHT}, {@link Vector3.UP}, or {@link Vector3.BACK}).
|
|
202
|
+
*
|
|
203
|
+
*
|
|
204
|
+
* ```gdscript
|
|
205
|
+
*
|
|
206
|
+
* var box = AABB(Vector3(0, 0, 0), Vector3(2, 4, 8))
|
|
207
|
+
*
|
|
208
|
+
* print(box.get_shortest_axis()) # Prints (1.0, 0.0, 0.0)
|
|
209
|
+
* print(box.get_shortest_axis_index()) # Prints 0
|
|
210
|
+
* print(box.get_shortest_axis_size()) # Prints 2.0
|
|
211
|
+
*
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
*
|
|
215
|
+
*
|
|
216
|
+
* See also {@link getShortestAxisIndex} and {@link getShortestAxisSize}.
|
|
217
|
+
*/
|
|
218
|
+
export function getShortestAxis(self: AABB): Vector3 { return _V(16, 6379, self) as Vector3; }
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Returns the index to the shortest axis of this bounding box's {@link size} (see {@link Vector3.AXIS_X}, {@link Vector3.AXIS_Y}, and {@link Vector3.AXIS_Z}).
|
|
222
|
+
* For an example, see {@link getShortestAxis}.
|
|
223
|
+
*/
|
|
224
|
+
export function getShortestAxisIndex(self: AABB): number { return _V(16, 6380, self) as number; }
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Returns the shortest dimension of this bounding box's {@link size}.
|
|
228
|
+
* For an example, see {@link getShortestAxis}.
|
|
229
|
+
*/
|
|
230
|
+
export function getShortestAxisSize(self: AABB): number { return _V(16, 6381, self) as number; }
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Returns the position of one of the 8 vertices that compose this bounding box. With an `idx` of `0` this is the same as {@link position}, and an `idx` of `7` is the same as {@link end}.
|
|
234
|
+
*/
|
|
235
|
+
export function getEndpoint(self: AABB, idx: number): Vector3 { return _V(16, 4667, self, idx) as Vector3; }
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Returns the first point where this bounding box and the given segment intersect, as a {@link Vector3}. If no intersection occurs, returns `null`.
|
|
239
|
+
* The segment begins at `from` and ends at `to`.
|
|
240
|
+
*/
|
|
241
|
+
export function intersectsSegment(self: AABB, from: Vector3, to: Vector3): Variant { return _V(16, 7710, self, from, to) as Variant; }
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Returns the first point where this bounding box and the given ray intersect, as a {@link Vector3}. If no intersection occurs, returns `null`.
|
|
245
|
+
* The ray begin at `from`, faces `dir` and extends towards infinity.
|
|
246
|
+
*/
|
|
247
|
+
export function intersectsRay(self: AABB, from: Vector3, dir: Vector3): Variant { return _V(16, 7709, self, from, dir) as Variant; }
|
|
248
|
+
|
|
249
|
+
export function equals(a: AABB, b: Variant | AABB): boolean { return _V(16, -1, a, b) as boolean; }
|
|
250
|
+
|
|
251
|
+
export function notEquals(a: AABB, b: Variant | AABB): boolean { return _V(16, -2, a, b) as boolean; }
|
|
252
|
+
|
|
253
|
+
export function not(self: AABB): boolean { return _V(16, -24, self, undefined) as boolean; }
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Inversely transforms (multiplies) the {@link AABB} by the given {@link Transform3D} transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
|
|
257
|
+
* `aabb * transform` is equivalent to `transform.inverse() * aabb`. See {@link Transform3D.inverse}.
|
|
258
|
+
* For transforming by inverse of an affine transformation (e.g. with scaling) `transform.affine_inverse() * aabb` can be used instead. See {@link Transform3D.affineInverse}.
|
|
259
|
+
*/
|
|
260
|
+
export function mul(a: AABB, b: Transform3D): AABB { return _V(16, -9, a, b) as AABB; }
|
|
261
|
+
|
|
262
|
+
export function contains(a: AABB, b: GodotDictionary | GodotArray): boolean { return _V(16, -25, a, b) as boolean; }
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Constructs an {@link AABB} with its {@link position} and {@link size} set to {@link Vector3.ZERO}.
|
|
266
|
+
*/
|
|
267
|
+
export function create(): AABB { return _V(16, -4096, 0) as AABB; }
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Constructs an {@link AABB} as a copy of the given {@link AABB}.
|
|
271
|
+
*/
|
|
272
|
+
export function fromAABB(from: AABB): AABB { return _V(16, -4096, 1, from) as AABB; }
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Constructs an {@link AABB} by `position` and `size`.
|
|
276
|
+
*/
|
|
277
|
+
export function fromPositionSize(position: Vector3, size: Vector3): AABB { return _V(16, -4096, 2, position, size) as AABB; }
|
|
278
|
+
|