@galacean/engine-math 2.0.0-alpha.49 → 2.0.0-alpha.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-math",
3
- "version": "2.0.0-alpha.49",
3
+ "version": "2.0.0-alpha.50",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -50,7 +50,7 @@ export declare class BoundingBox implements IClone<BoundingBox>, ICopy<BoundingB
50
50
  * @param min - The minimum point of the box
51
51
  * @param max - The maximum point of the box
52
52
  */
53
- constructor(min?: Vector3, max?: Vector3);
53
+ constructor(min?: Vector3 | null, max?: Vector3 | null);
54
54
  /**
55
55
  * Get the center point of this bounding box.
56
56
  * @param out - The center point of this bounding box
@@ -25,13 +25,13 @@ export declare class BoundingFrustum implements IClone<BoundingFrustum>, ICopy<B
25
25
  * Constructor of BoundingFrustum.
26
26
  * @param matrix - The view-projection matrix
27
27
  */
28
- constructor(matrix?: Matrix);
28
+ constructor(matrix?: Matrix | null);
29
29
  /**
30
30
  * Get the plane by the given frustum face.
31
31
  * @param face - The frustum face
32
- * @returns The plane get
32
+ * @returns The plane, or null for an invalid face
33
33
  */
34
- getPlane(face: FrustumFace): Plane;
34
+ getPlane(face: FrustumFace): Plane | null;
35
35
  /**
36
36
  * Update all planes from the given matrix.
37
37
  * @param matrix - The given view-projection matrix
@@ -28,7 +28,7 @@ export declare class BoundingSphere implements IClone<BoundingSphere>, ICopy<Bou
28
28
  * @param center - The center point of the sphere
29
29
  * @param radius - The radius of the sphere
30
30
  */
31
- constructor(center?: Vector3, radius?: number);
31
+ constructor(center?: Vector3 | null, radius?: number);
32
32
  /**
33
33
  * Creates a clone of this sphere.
34
34
  * @returns A clone of this sphere
package/types/Color.d.ts CHANGED
@@ -63,7 +63,7 @@ export declare class Color implements IClone<Color>, ICopy<ColorLike, Color> {
63
63
  /** @internal */
64
64
  _a: number;
65
65
  /** @internal */
66
- _onValueChanged: () => void;
66
+ _onValueChanged: (() => void) | null;
67
67
  /**
68
68
  * The red component of the color, 0~1.
69
69
  */
package/types/Matrix.d.ts CHANGED
@@ -92,8 +92,9 @@ export declare class Matrix implements IClone<Matrix>, ICopy<Matrix, Matrix> {
92
92
  * Calculate the inverse of the specified matrix.
93
93
  * @param a - The matrix whose inverse is to be calculated
94
94
  * @param out - The inverse of the specified matrix
95
+ * @returns Null if the matrix is singular; otherwise undefined
95
96
  */
96
- static invert(a: Matrix, out: Matrix): void;
97
+ static invert(a: Matrix, out: Matrix): void | null;
97
98
  /**
98
99
  * Calculate a right-handed look-at matrix.
99
100
  * @param eye - The position of the viewer's eye
@@ -65,6 +65,7 @@ export declare class Matrix3x3 implements IClone<Matrix3x3>, ICopy<Matrix3x3, Ma
65
65
  * Calculate the inverse of the specified matrix.
66
66
  * @param a - The matrix whose inverse is to be calculated
67
67
  * @param out - The inverse of the specified matrix
68
+ * @returns Null if the matrix is singular; otherwise undefined
68
69
  */
69
70
  static invert(a: Matrix3x3, out: Matrix3x3): void;
70
71
  /**
@@ -73,7 +74,7 @@ export declare class Matrix3x3 implements IClone<Matrix3x3>, ICopy<Matrix3x3, Ma
73
74
  * @param mat4 - The 4x4 matrix
74
75
  * @param out - THe 3x3 normal matrix
75
76
  */
76
- static normalMatrix(mat4: Matrix, out: Matrix3x3): void;
77
+ static normalMatrix(mat4: Matrix, out: Matrix3x3): void | null;
77
78
  /**
78
79
  * The specified matrix rotates around an angle.
79
80
  * @param a - The specified matrix
package/types/Plane.d.ts CHANGED
@@ -28,7 +28,7 @@ export declare class Plane implements IClone<Plane>, ICopy<Plane, Plane> {
28
28
  * @param normal - The normal vector
29
29
  * @param distance - The distance of the plane along its normal to the origin
30
30
  */
31
- constructor(normal?: Vector3, distance?: number);
31
+ constructor(normal?: Vector3 | null, distance?: number);
32
32
  /**
33
33
  * Normalize the normal vector of this plane.
34
34
  * @returns The plane after normalize
@@ -156,7 +156,7 @@ export declare class Quaternion implements IClone<Quaternion>, ICopy<QuaternionL
156
156
  /** @internal */
157
157
  _w: number;
158
158
  /** @internal */
159
- _onValueChanged: () => void;
159
+ _onValueChanged: (() => void) | null;
160
160
  /**
161
161
  * The x component of the quaternion.
162
162
  */
package/types/Ray.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare class Ray implements IClone<Ray>, ICopy<Ray, Ray> {
17
17
  * @param origin - The origin vector
18
18
  * @param direction - The direction vector
19
19
  */
20
- constructor(origin?: Vector3, direction?: Vector3);
20
+ constructor(origin?: Vector3 | null, direction?: Vector3 | null);
21
21
  /**
22
22
  * Check if this ray intersects the specified plane.
23
23
  * @param plane - The specified plane
package/types/Rect.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare class Rect implements IClone<Rect>, ICopy<Rect, Rect> {
10
10
  /** @internal */
11
11
  _height: number;
12
12
  /** @internal */
13
- _onValueChanged: () => void;
13
+ _onValueChanged: (() => void) | null;
14
14
  /**
15
15
  * The x coordinate of the rectangle.
16
16
  */
@@ -110,7 +110,7 @@ export declare class Vector2 implements IClone<Vector2>, ICopy<Vector2Like, Vect
110
110
  /** @internal */
111
111
  _y: number;
112
112
  /** @internal */
113
- _onValueChanged: () => void;
113
+ _onValueChanged: (() => void) | null;
114
114
  /**
115
115
  * The x component of the vector.
116
116
  */
@@ -171,7 +171,7 @@ export declare class Vector3 implements IClone<Vector3>, ICopy<Vector3Like, Vect
171
171
  /** @internal */
172
172
  _z: number;
173
173
  /** @internal */
174
- _onValueChanged: () => void;
174
+ _onValueChanged: (() => void) | null;
175
175
  /**
176
176
  * The x component of the vector.
177
177
  */
@@ -130,7 +130,7 @@ export declare class Vector4 implements IClone<Vector4>, ICopy<Vector4Like, Vect
130
130
  /** @internal */
131
131
  _w: number;
132
132
  /** @internal */
133
- _onValueChanged: () => void;
133
+ _onValueChanged: (() => void) | null;
134
134
  /**
135
135
  * The x component of the vector.
136
136
  */