@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,134 +1,130 @@
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 { Transform3D, Vector3 } from '../value-types/index.ts';
6
+ import type { Transform3D, Vector3 } from './index.ts';
7
7
 
8
8
  /**
9
9
  * Represents a normalized plane equation. {@link normal} is the normal of the plane (a, b, c normalized), and {@link d} is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
10
10
  * **Note:** In a boolean context, a plane will evaluate to `false` if all its components equal `0`. Otherwise, a plane will always evaluate to `true`.
11
11
  */
12
- export class Plane extends GodotVar {
13
- /**
14
- * The X component of the plane's {@link normal} vector.
15
- */
16
- get x(): number { return _get(this, 14941) as number; }
17
- set x(v: number) { _set(this, 14941, v); }
18
-
19
- /**
20
- * The Y component of the plane's {@link normal} vector.
21
- */
22
- get y(): number { return _get(this, 14952) as number; }
23
- set y(v: number) { _set(this, 14952, v); }
24
-
25
- /**
26
- * The Z component of the plane's {@link normal} vector.
27
- */
28
- get z(): number { return _get(this, 14956) as number; }
29
- set z(v: number) { _set(this, 14956, v); }
30
-
31
- /**
32
- * The distance from the origin to the plane, expressed in terms of {@link normal} (according to its direction and magnitude). Actual absolute distance from the origin to the plane can be calculated as `abs(d) / normal.length()` (if {@link normal} has zero length then this {@link Plane} does not represent a valid plane).
33
- * In the scalar equation of the plane `ax + by + cz = d`, this is {@link code skip-lint}d, while the `(a, b, c)` coordinates are represented by the {@link normal} property.
34
- */
35
- get d(): number { return _get(this, 2641) as number; }
36
- set d(v: number) { _set(this, 2641, v); }
37
-
38
- /**
39
- * The normal of the plane, typically a unit vector. Shouldn't be a zero vector as {@link Plane} with such {@link normal} does not represent a valid plane.
40
- * In the scalar equation of the plane `ax + by + cz = d`, this is the vector `(a, b, c)`, where {@link code skip-lint}d is the {@link d} property.
41
- */
42
- get normal(): Vector3 { return _get(this, 9094) as Vector3; }
43
- set normal(v: Vector3) { _set(this, 9094, v); }
44
-
45
- constructor();
46
- constructor(from: Plane);
47
- constructor(normal: Vector3);
48
- constructor(normal: Vector3, d: number);
49
- constructor(normal: Vector3, point: Vector3);
50
- constructor(point1: Vector3, point2: Vector3, point3: Vector3);
51
- constructor(a: number, b: number, c: number, d: number);
52
- constructor(...args: any[]) { super(14, ...args); }
53
-
54
- /**
55
- * Returns a copy of the plane, with normalized {@link normal} (so it's a unit vector). Returns `Plane(0, 0, 0, 0)` if {@link normal} can't be normalized (it has zero length).
56
- */
57
- normalized(): Plane { return _C(this, 9103) as Plane; }
58
-
59
- /**
60
- * Returns the center of the plane.
61
- */
62
- getCenter(): Vector3 { return _C(this, 4121) as Vector3; }
63
-
64
- /**
65
- * Returns `true` if this plane and `toPlane` are approximately equal, by running {@link isEqualApprox} on each component.
66
- */
67
- isEqualApprox(toPlane: Plane): boolean { return _C(this, 7938, toPlane) as boolean; }
68
-
69
- /**
70
- * Returns `true` if this plane is finite, by calling {@link isFinite} on each component.
71
- */
72
- isFinite(): boolean { return _C(this, 7951) as boolean; }
73
-
74
- /**
75
- * Returns `true` if `point` is located above the plane.
76
- */
77
- isPointOver(point: Vector3): boolean { return _C(this, 8188, point) as boolean; }
78
-
79
- /**
80
- * Returns the shortest distance from the plane to the position `point`. If the point is above the plane, the distance will be positive. If below, the distance will be negative.
81
- */
82
- distanceTo(point: Vector3): number { return _C(this, 2850, point) as number; }
83
-
84
- /**
85
- * Returns `true` if `point` is inside the plane. Comparison uses a custom minimum `tolerance` threshold.
86
- */
87
- hasPoint(point: Vector3, tolerance?: number /* = 1e-05 */): boolean { return _C(this, 7430, point, tolerance) as boolean; }
88
-
89
- /**
90
- * Returns the orthogonal projection of `point` into a point in the plane.
91
- */
92
- project(point: Vector3): Vector3 { return _C(this, 9589, point) as Vector3; }
93
-
94
- /**
95
- * Returns the intersection point of the three planes `b`, `c` and this plane. If no intersection is found, `null` is returned.
96
- */
97
- intersect3(b: Plane, c: Plane): Variant { return _C(this, 7698, b, c) as Variant; }
98
-
99
- /**
100
- * Returns the intersection point of a ray consisting of the position `from` and the direction normal `dir` with this plane. If no intersection is found, `null` is returned.
101
- */
102
- intersectsRay(from: Vector3, dir: Vector3): Variant { return _C(this, 7709, from, dir) as Variant; }
103
-
104
- /**
105
- * Returns the intersection point of a segment from position `from` to position `to` with this plane. If no intersection is found, `null` is returned.
106
- */
107
- intersectsSegment(from: Vector3, to: Vector3): Variant { return _C(this, 7710, from, to) as Variant; }
108
-
109
- equals(other: Variant | Plane): boolean { return _C(this, -1, other) as boolean; }
110
-
111
- notEquals(other: Variant | Plane): boolean { return _C(this, -2, other) as boolean; }
112
-
113
- /**
114
- * Returns the negative value of the {@link Plane}. This is the same as writing `Plane(-p.normal, -p.d)`. This operation flips the direction of the normal vector and also flips the distance value, resulting in a Plane that is in the same place, but facing the opposite direction.
115
- */
116
- neg(): Plane { return _C(this, -11, undefined) as Plane; }
117
-
118
- /**
119
- * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
120
- */
121
- pos(): Plane { return _C(this, -12, undefined) as Plane; }
122
-
123
- not(): boolean { return _C(this, -24, undefined) as boolean; }
124
-
125
- /**
126
- * Inversely transforms (multiplies) the {@link Plane} by the given {@link Transform3D} transformation matrix.
127
- * `plane * transform` is equivalent to `transform.affine_inverse() * plane`. See {@link Transform3D.affineInverse}.
128
- */
129
- mul(other: Transform3D): Plane { return _C(this, -9, other) as Plane; }
130
-
131
- contains(other: GodotDictionary | GodotArray): boolean { return _C(this, -25, other) as boolean; }
132
-
133
- static readonly name = _R(14, Plane);
134
- }
12
+ export type Plane = [x: number, y: number, z: number, d: number];
13
+
14
+ /**
15
+ * Returns a copy of the plane, with normalized {@link normal} (so it's a unit vector). Returns `Plane(0, 0, 0, 0)` if {@link normal} can't be normalized (it has zero length).
16
+ */
17
+ export function normalized(self: Plane): Plane { return _V(14, 9103, self) as Plane; }
18
+
19
+ /**
20
+ * Returns the center of the plane.
21
+ */
22
+ export function getCenter(self: Plane): Vector3 { return _V(14, 4121, self) as Vector3; }
23
+
24
+ /**
25
+ * Returns `true` if this plane and `toPlane` are approximately equal, by running {@link isEqualApprox} on each component.
26
+ */
27
+ export function isEqualApprox(self: Plane, toPlane: Plane): boolean { return _V(14, 7938, self, toPlane) as boolean; }
28
+
29
+ /**
30
+ * Returns `true` if this plane is finite, by calling {@link isFinite} on each component.
31
+ */
32
+ export function isFinite(self: Plane): boolean { return _V(14, 7951, self) as boolean; }
33
+
34
+ /**
35
+ * Returns `true` if `point` is located above the plane.
36
+ */
37
+ export function isPointOver(self: Plane, point: Vector3): boolean { return _V(14, 8188, self, point) as boolean; }
38
+
39
+ /**
40
+ * Returns the shortest distance from the plane to the position `point`. If the point is above the plane, the distance will be positive. If below, the distance will be negative.
41
+ */
42
+ export function distanceTo(self: Plane, point: Vector3): number { return _V(14, 2850, self, point) as number; }
43
+
44
+ /**
45
+ * Returns `true` if `point` is inside the plane. Comparison uses a custom minimum `tolerance` threshold.
46
+ */
47
+ export function hasPoint(self: Plane, point: Vector3, tolerance?: number /* = 1e-05 */): boolean { return _V(14, 7430, self, point, tolerance) as boolean; }
48
+
49
+ /**
50
+ * Returns the orthogonal projection of `point` into a point in the plane.
51
+ */
52
+ export function project(self: Plane, point: Vector3): Vector3 { return _V(14, 9589, self, point) as Vector3; }
53
+
54
+ /**
55
+ * Returns the intersection point of the three planes `b`, `c` and this plane. If no intersection is found, `null` is returned.
56
+ */
57
+ export function intersect3(self: Plane, b: Plane, c: Plane): Variant { return _V(14, 7698, self, b, c) as Variant; }
58
+
59
+ /**
60
+ * Returns the intersection point of a ray consisting of the position `from` and the direction normal `dir` with this plane. If no intersection is found, `null` is returned.
61
+ */
62
+ export function intersectsRay(self: Plane, from: Vector3, dir: Vector3): Variant { return _V(14, 7709, self, from, dir) as Variant; }
63
+
64
+ /**
65
+ * Returns the intersection point of a segment from position `from` to position `to` with this plane. If no intersection is found, `null` is returned.
66
+ */
67
+ export function intersectsSegment(self: Plane, from: Vector3, to: Vector3): Variant { return _V(14, 7710, self, from, to) as Variant; }
68
+
69
+ export function equals(a: Plane, b: Variant | Plane): boolean { return _V(14, -1, a, b) as boolean; }
70
+
71
+ export function notEquals(a: Plane, b: Variant | Plane): boolean { return _V(14, -2, a, b) as boolean; }
72
+
73
+ /**
74
+ * Returns the negative value of the {@link Plane}. This is the same as writing `Plane(-p.normal, -p.d)`. This operation flips the direction of the normal vector and also flips the distance value, resulting in a Plane that is in the same place, but facing the opposite direction.
75
+ */
76
+ export function neg(self: Plane): Plane { return _V(14, -11, self, undefined) as Plane; }
77
+
78
+ /**
79
+ * Returns the same value as if the `+` was not there. Unary `+` does nothing, but sometimes it can make your code more readable.
80
+ */
81
+ export function pos(self: Plane): Plane { return _V(14, -12, self, undefined) as Plane; }
82
+
83
+ export function not(self: Plane): boolean { return _V(14, -24, self, undefined) as boolean; }
84
+
85
+ /**
86
+ * Inversely transforms (multiplies) the {@link Plane} by the given {@link Transform3D} transformation matrix.
87
+ * `plane * transform` is equivalent to `transform.affine_inverse() * plane`. See {@link Transform3D.affineInverse}.
88
+ */
89
+ export function mul(a: Plane, b: Transform3D): Plane { return _V(14, -9, a, b) as Plane; }
90
+
91
+ export function contains(a: Plane, b: GodotDictionary | GodotArray): boolean { return _V(14, -25, a, b) as boolean; }
92
+
93
+ /**
94
+ * Constructs a default-initialized {@link Plane} with all components set to `0`.
95
+ */
96
+ export function create(): Plane { return _V(14, -4096, 0) as Plane; }
97
+
98
+ /**
99
+ * Constructs a {@link Plane} as a copy of the given {@link Plane}.
100
+ */
101
+ export function fromPlane(from: Plane): Plane { return _V(14, -4096, 1, from) as Plane; }
102
+
103
+ /**
104
+ * Creates a plane from the normal vector. The plane will intersect the origin.
105
+ * The `normal` of the plane must be a unit vector.
106
+ */
107
+ export function fromNormal(normal: Vector3): Plane { return _V(14, -4096, 2, normal) as Plane; }
108
+
109
+ /**
110
+ * Creates a plane from the normal vector and the plane's distance from the origin.
111
+ * The `normal` of the plane must be a unit vector.
112
+ */
113
+ export function fromNormalD(normal: Vector3, d: number): Plane { return _V(14, -4096, 3, normal, d) as Plane; }
114
+
115
+ /**
116
+ * Creates a plane from the normal vector and a point on the plane.
117
+ * The `normal` of the plane must be a unit vector.
118
+ */
119
+ export function fromNormalPoint(normal: Vector3, point: Vector3): Plane { return _V(14, -4096, 4, normal, point) as Plane; }
120
+
121
+ /**
122
+ * Creates a plane from the three points, given in clockwise order.
123
+ */
124
+ export function fromPoint1Point2Point3(point1: Vector3, point2: Vector3, point3: Vector3): Plane { return _V(14, -4096, 5, point1, point2, point3) as Plane; }
125
+
126
+ /**
127
+ * Creates a plane from the four parameters. The three components of the resulting plane's {@link normal} are `a`, `b` and `c`, and the plane has a distance of `d` from the origin.
128
+ */
129
+ export function fromABCD(a: number, b: number, c: number, d: number): Plane { return _V(14, -4096, 6, a, b, c, d) as Plane; }
130
+
@@ -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 { 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 { Plane, Transform3D, Vector2, Vector4 } from '../value-types/index.ts';
6
+ import type { AABB, Plane, Rect2, Transform3D, Vector2, Vector4 } from './index.ts';
7
7
 
8
8
  /**
9
9
  * A 4×4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four {@link Vector4} columns.
@@ -11,127 +11,179 @@ import type { Plane, Transform3D, Vector2, Vector4 } from '../value-types/index.
11
11
  * Used internally as {@link Camera3D}'s projection matrix.
12
12
  * **Note:** In a boolean context, a projection will evaluate to `false` if it's equal to {@link IDENTITY}. Otherwise, a projection will always evaluate to `true`.
13
13
  */
14
- export class Projection extends GodotVar {
15
- /**
16
- * The projection matrix's X vector (column 0). Equivalent to array index `0`.
17
- */
18
- get x(): Vector4 { return _get(this, 14941) as Vector4; }
19
- set x(v: Vector4) { _set(this, 14941, v); }
20
-
21
- /**
22
- * The projection matrix's Y vector (column 1). Equivalent to array index `1`.
23
- */
24
- get y(): Vector4 { return _get(this, 14952) as Vector4; }
25
- set y(v: Vector4) { _set(this, 14952, v); }
26
-
27
- /**
28
- * The projection matrix's Z vector (column 2). Equivalent to array index `2`.
29
- */
30
- get z(): Vector4 { return _get(this, 14956) as Vector4; }
31
- set z(v: Vector4) { _set(this, 14956, v); }
32
-
33
- /**
34
- * The projection matrix's W vector (column 3). Equivalent to array index `3`.
35
- */
36
- get w(): Vector4 { return _get(this, 14833) as Vector4; }
37
- set w(v: Vector4) { _set(this, 14833, v); }
38
-
39
- constructor();
40
- constructor(from: Projection);
41
- constructor(from: Transform3D);
42
- constructor(xAxis: Vector4, yAxis: Vector4, zAxis: Vector4, wAxis: Vector4);
43
- constructor(...args: any[]) { super(19, ...args); }
44
-
45
- /**
46
- * Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area.
47
- * The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications.
48
- */
49
- determinant(): number { return _C(this, 2773) as number; }
50
-
51
- /**
52
- * Returns a {@link Projection} with the near clipping distance adjusted to be `newZnear`.
53
- * **Note:** The original {@link Projection} must be a perspective projection.
54
- */
55
- perspectiveZnearAdjusted(newZnear: number): Projection { return _C(this, 9398, newZnear) as Projection; }
56
-
57
- /**
58
- * Returns the clipping plane of this {@link Projection} whose index is given by `plane`.
59
- * `plane` should be equal to one of {@link PLANE_NEAR}, {@link PLANE_FAR}, {@link PLANE_LEFT}, {@link PLANE_TOP}, {@link PLANE_RIGHT}, or {@link PLANE_BOTTOM}.
60
- */
61
- getProjectionPlane(plane: number): Plane { return _C(this, 6046, plane) as Plane; }
62
-
63
- /**
64
- * Returns a copy of this {@link Projection} with the signs of the values of the Y column flipped.
65
- */
66
- flippedY(): Projection { return _C(this, 3334) as Projection; }
67
-
68
- /**
69
- * Returns a {@link Projection} with the X and Y values from the given {@link Vector2} added to the first and second values of the final column respectively.
70
- */
71
- jitterOffseted(offset: Vector2): Projection { return _C(this, 8472, offset) as Projection; }
72
-
73
- /**
74
- * Returns the distance for this {@link Projection} beyond which positions are clipped.
75
- */
76
- getZFar(): number { return _C(this, 7179) as number; }
77
-
78
- /**
79
- * Returns the distance for this {@link Projection} before which positions are clipped.
80
- */
81
- getZNear(): number { return _C(this, 7181) as number; }
82
-
83
- /**
84
- * Returns the X:Y aspect ratio of this {@link Projection}'s viewport.
85
- */
86
- getAspect(): number { return _C(this, 3800) as number; }
87
-
88
- /**
89
- * Returns the horizontal field of view of the projection (in degrees).
90
- */
91
- getFov(): number { return _C(this, 4865) as number; }
92
-
93
- /**
94
- * Returns `true` if this {@link Projection} performs an orthogonal projection.
95
- */
96
- isOrthogonal(): boolean { return _C(this, 8157) as boolean; }
97
-
98
- /**
99
- * Returns the dimensions of the viewport plane that this {@link Projection} projects positions onto, divided by two.
100
- */
101
- getViewportHalfExtents(): Vector2 { return _C(this, 7082) as Vector2; }
102
-
103
- /**
104
- * Returns the dimensions of the far clipping plane of the projection, divided by two.
105
- */
106
- getFarPlaneHalfExtents(): Vector2 { return _C(this, 4759) as Vector2; }
107
-
108
- /**
109
- * Returns a {@link Projection} that performs the inverse of this {@link Projection}'s projective transformation.
110
- */
111
- inverse(): Projection { return _C(this, 7714) as Projection; }
112
-
113
- /**
114
- * Returns `forPixelWidth` divided by the viewport's width measured in meters on the near plane, after this {@link Projection} is applied.
115
- */
116
- getPixelsPerMeter(forPixelWidth: number): number { return _C(this, 5915, forPixelWidth) as number; }
117
-
118
- /**
119
- * Returns the factor by which the visible level of detail is scaled by this {@link Projection}.
120
- */
121
- getLodMultiplier(): number { return _C(this, 5411) as number; }
122
-
123
- equals(other: Variant | Projection): boolean { return _C(this, -1, other) as boolean; }
124
-
125
- notEquals(other: Variant | Projection): boolean { return _C(this, -2, other) as boolean; }
126
-
127
- not(): boolean { return _C(this, -24, undefined) as boolean; }
128
-
129
- /**
130
- * Projects (multiplies) the given {@link Vector4} by this {@link Projection} matrix.
131
- */
132
- mul(other: Vector4 | Projection): Vector4 { return _C(this, -9, other) as Vector4; }
133
-
134
- contains(other: GodotDictionary | GodotArray): boolean { return _C(this, -25, other) as boolean; }
135
-
136
- static readonly name = _R(19, Projection);
137
- }
14
+ export type Projection = [x: Vector4, y: Vector4, z: Vector4, w: Vector4];
15
+
16
+ /**
17
+ * Creates a new {@link Projection} that projects positions from a depth range of `-1` to `1` to one that ranges from `0` to `1`, and flips the projected positions vertically, according to `flipY`.
18
+ */
19
+ export function createDepthCorrection(flipY: boolean): Projection { return _V(19, 2521, undefined, flipY) as Projection; }
20
+
21
+ /**
22
+ * Creates a new {@link Projection} that projects positions into the given {@link Rect2}.
23
+ */
24
+ export function createLightAtlasRect(rect: Rect2): Projection { return _V(19, 2547, undefined, rect) as Projection; }
25
+
26
+ /**
27
+ * Creates a new {@link Projection} that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping planes.
28
+ * `flipFov` determines whether the projection's field of view is flipped over its diagonal.
29
+ */
30
+ export function createPerspective(fovy: number, aspect: number, zNear: number, zFar: number, flipFov?: boolean /* = false */): Projection { return _V(19, 2561, undefined, fovy, aspect, zNear, zFar, flipFov) as Projection; }
31
+
32
+ /**
33
+ * Creates a new {@link Projection} that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on.
34
+ * `eye` creates the projection for the left eye when set to 1, or the right eye when set to 2.
35
+ * `flipFov` determines whether the projection's field of view is flipped over its diagonal.
36
+ */
37
+ export function createPerspectiveHmd(fovy: number, aspect: number, zNear: number, zFar: number, flipFov: boolean, eye: number, intraocularDist: number, convergenceDist: number): Projection { return _V(19, 2562, undefined, fovy, aspect, zNear, zFar, flipFov, eye, intraocularDist, convergenceDist) as Projection; }
38
+
39
+ /**
40
+ * Creates a new {@link Projection} for projecting positions onto a head-mounted display with the given X:Y aspect ratio, distance between eyes, display width, distance to lens, oversampling factor, and depth clipping planes.
41
+ * `eye` creates the projection for the left eye when set to 1, or the right eye when set to 2.
42
+ */
43
+ export function createForHmd(eye: number, aspect: number, intraocularDist: number, displayWidth: number, displayToLens: number, oversample: number, zNear: number, zFar: number): Projection { return _V(19, 2527, undefined, eye, aspect, intraocularDist, displayWidth, displayToLens, oversample, zNear, zFar) as Projection; }
44
+
45
+ /**
46
+ * Creates a new {@link Projection} that projects positions using an orthogonal projection with the given clipping planes.
47
+ */
48
+ export function createOrthogonal(left: number, right: number, bottom: number, top: number, zNear: number, zFar: number): Projection { return _V(19, 2557, undefined, left, right, bottom, top, zNear, zFar) as Projection; }
49
+
50
+ /**
51
+ * Creates a new {@link Projection} that projects positions using an orthogonal projection with the given size, X:Y aspect ratio, and clipping planes.
52
+ * `flipFov` determines whether the projection's field of view is flipped over its diagonal.
53
+ */
54
+ export function createOrthogonalAspect(size: number, aspect: number, zNear: number, zFar: number, flipFov?: boolean /* = false */): Projection { return _V(19, 2558, undefined, size, aspect, zNear, zFar, flipFov) as Projection; }
55
+
56
+ /**
57
+ * Creates a new {@link Projection} that projects positions in a frustum with the given clipping planes.
58
+ */
59
+ export function createFrustum(left: number, right: number, bottom: number, top: number, zNear: number, zFar: number): Projection { return _V(19, 2539, undefined, left, right, bottom, top, zNear, zFar) as Projection; }
60
+
61
+ /**
62
+ * Creates a new {@link Projection} that projects positions in a frustum with the given size, X:Y aspect ratio, offset, and clipping planes.
63
+ * `flipFov` determines whether the projection's field of view is flipped over its diagonal.
64
+ */
65
+ export function createFrustumAspect(size: number, aspect: number, offset: Vector2, zNear: number, zFar: number, flipFov?: boolean /* = false */): Projection { return _V(19, 2540, undefined, size, aspect, offset, zNear, zFar, flipFov) as Projection; }
66
+
67
+ /**
68
+ * Creates a new {@link Projection} that scales a given projection to fit around a given {@link AABB} in projection space.
69
+ */
70
+ export function createFitAabb(aabb: AABB): Projection { return _V(19, 2524, undefined, aabb) as Projection; }
71
+
72
+ /**
73
+ * Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area.
74
+ * The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications.
75
+ */
76
+ export function determinant(self: Projection): number { return _V(19, 2773, self) as number; }
77
+
78
+ /**
79
+ * Returns a {@link Projection} with the near clipping distance adjusted to be `newZnear`.
80
+ * **Note:** The original {@link Projection} must be a perspective projection.
81
+ */
82
+ export function perspectiveZnearAdjusted(self: Projection, newZnear: number): Projection { return _V(19, 9398, self, newZnear) as Projection; }
83
+
84
+ /**
85
+ * Returns the clipping plane of this {@link Projection} whose index is given by `plane`.
86
+ * `plane` should be equal to one of {@link PLANE_NEAR}, {@link PLANE_FAR}, {@link PLANE_LEFT}, {@link PLANE_TOP}, {@link PLANE_RIGHT}, or {@link PLANE_BOTTOM}.
87
+ */
88
+ export function getProjectionPlane(self: Projection, plane: number): Plane { return _V(19, 6046, self, plane) as Plane; }
89
+
90
+ /**
91
+ * Returns a copy of this {@link Projection} with the signs of the values of the Y column flipped.
92
+ */
93
+ export function flippedY(self: Projection): Projection { return _V(19, 3334, self) as Projection; }
94
+
95
+ /**
96
+ * Returns a {@link Projection} with the X and Y values from the given {@link Vector2} added to the first and second values of the final column respectively.
97
+ */
98
+ export function jitterOffseted(self: Projection, offset: Vector2): Projection { return _V(19, 8472, self, offset) as Projection; }
99
+
100
+ /**
101
+ * Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio.
102
+ * **Note:** Unlike most methods of {@link Projection}, `aspect` is expected to be 1 divided by the X:Y aspect ratio.
103
+ */
104
+ export function getFovy(fovx: number, aspect: number): number { return _V(19, 4870, undefined, fovx, aspect) as number; }
105
+
106
+ /**
107
+ * Returns the distance for this {@link Projection} beyond which positions are clipped.
108
+ */
109
+ export function getZFar(self: Projection): number { return _V(19, 7179, self) as number; }
110
+
111
+ /**
112
+ * Returns the distance for this {@link Projection} before which positions are clipped.
113
+ */
114
+ export function getZNear(self: Projection): number { return _V(19, 7181, self) as number; }
115
+
116
+ /**
117
+ * Returns the X:Y aspect ratio of this {@link Projection}'s viewport.
118
+ */
119
+ export function getAspect(self: Projection): number { return _V(19, 3800, self) as number; }
120
+
121
+ /**
122
+ * Returns the horizontal field of view of the projection (in degrees).
123
+ */
124
+ export function getFov(self: Projection): number { return _V(19, 4865, self) as number; }
125
+
126
+ /**
127
+ * Returns `true` if this {@link Projection} performs an orthogonal projection.
128
+ */
129
+ export function isOrthogonal(self: Projection): boolean { return _V(19, 8157, self) as boolean; }
130
+
131
+ /**
132
+ * Returns the dimensions of the viewport plane that this {@link Projection} projects positions onto, divided by two.
133
+ */
134
+ export function getViewportHalfExtents(self: Projection): Vector2 { return _V(19, 7082, self) as Vector2; }
135
+
136
+ /**
137
+ * Returns the dimensions of the far clipping plane of the projection, divided by two.
138
+ */
139
+ export function getFarPlaneHalfExtents(self: Projection): Vector2 { return _V(19, 4759, self) as Vector2; }
140
+
141
+ /**
142
+ * Returns a {@link Projection} that performs the inverse of this {@link Projection}'s projective transformation.
143
+ */
144
+ export function inverse(self: Projection): Projection { return _V(19, 7714, self) as Projection; }
145
+
146
+ /**
147
+ * Returns `forPixelWidth` divided by the viewport's width measured in meters on the near plane, after this {@link Projection} is applied.
148
+ */
149
+ export function getPixelsPerMeter(self: Projection, forPixelWidth: number): number { return _V(19, 5915, self, forPixelWidth) as number; }
150
+
151
+ /**
152
+ * Returns the factor by which the visible level of detail is scaled by this {@link Projection}.
153
+ */
154
+ export function getLodMultiplier(self: Projection): number { return _V(19, 5411, self) as number; }
155
+
156
+ export function equals(a: Projection, b: Variant | Projection): boolean { return _V(19, -1, a, b) as boolean; }
157
+
158
+ export function notEquals(a: Projection, b: Variant | Projection): boolean { return _V(19, -2, a, b) as boolean; }
159
+
160
+ export function not(self: Projection): boolean { return _V(19, -24, self, undefined) as boolean; }
161
+
162
+ /**
163
+ * Projects (multiplies) the given {@link Vector4} by this {@link Projection} matrix.
164
+ */
165
+ export function mul(a: Projection, b: Vector4 | Projection): Vector4 { return _V(19, -9, a, b) as Vector4; }
166
+
167
+ export function contains(a: Projection, b: GodotDictionary | GodotArray): boolean { return _V(19, -25, a, b) as boolean; }
168
+
169
+ /**
170
+ * Constructs a default-initialized {@link Projection} identical to {@link IDENTITY}.
171
+ * **Note:** In C#, this constructs a {@link Projection} identical to {@link ZERO}.
172
+ */
173
+ export function create(): Projection { return _V(19, -4096, 0) as Projection; }
174
+
175
+ /**
176
+ * Constructs a {@link Projection} as a copy of the given {@link Projection}.
177
+ */
178
+ export function fromProjection(from: Projection): Projection { return _V(19, -4096, 1, from) as Projection; }
179
+
180
+ /**
181
+ * Constructs a Projection as a copy of the given {@link Transform3D}.
182
+ */
183
+ export function fromTransform3D(from: Transform3D): Projection { return _V(19, -4096, 2, from) as Projection; }
184
+
185
+ /**
186
+ * Constructs a Projection from four {@link Vector4} values (matrix columns).
187
+ */
188
+ export function fromXAxisYAxisZAxisWAxis(xAxis: Vector4, yAxis: Vector4, zAxis: Vector4, wAxis: Vector4): Projection { return _V(19, -4096, 3, xAxis, yAxis, zAxis, wAxis) as Projection; }
189
+