@oliversalzburg/js-utils 0.0.18 → 0.0.19-dev.0
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/array.d.ts +39 -0
- package/{lib/array.js → array.js} +12 -13
- package/array.js.map +1 -0
- package/async.d.ts +28 -0
- package/{lib/async.js → async.js} +16 -10
- package/async.js.map +1 -0
- package/async.test.js +28 -0
- package/async.test.js.map +1 -0
- package/core.d.ts +36 -0
- package/core.js +3 -0
- package/core.js.map +1 -0
- package/{lib/dom → dom}/core.d.ts +8 -8
- package/{lib/dom → dom}/core.js +8 -8
- package/{lib/error-serializer.d.ts → error-serializer.d.ts} +5 -5
- package/{lib/error-serializer.js → error-serializer.js} +5 -5
- package/{lib/errors → errors}/AbstractError.d.ts +5 -5
- package/{lib/errors → errors}/AbstractError.js +5 -5
- package/{lib/errors → errors}/InternalError.d.ts +3 -3
- package/{lib/errors → errors}/InternalError.js +3 -3
- package/{lib/errors → errors}/InvalidArgumentError.d.ts +2 -2
- package/{lib/errors → errors}/InvalidArgumentError.js +2 -2
- package/{lib/errors → errors}/InvalidOperationError.d.ts +2 -2
- package/{lib/errors → errors}/InvalidOperationError.js +2 -2
- package/{lib/errors → errors}/NotImplementedError.d.ts +2 -2
- package/{lib/errors → errors}/NotImplementedError.js +2 -2
- package/{lib/errors → errors}/PermissionViolationError.d.ts +2 -2
- package/{lib/errors → errors}/PermissionViolationError.js +2 -2
- package/{lib/errors → errors}/ResourceConflictError.d.ts +2 -2
- package/{lib/errors → errors}/ResourceConflictError.js +2 -2
- package/{lib/errors → errors}/UnknownError.d.ts +2 -2
- package/{lib/errors → errors}/UnknownError.js +2 -2
- package/{lib/graphics → graphics}/canvas-sandbox.d.ts +13 -13
- package/{lib/graphics → graphics}/canvas-sandbox.js +9 -9
- package/{lib/graphics → graphics}/canvas.d.ts +30 -30
- package/{lib/graphics → graphics}/canvas.js +30 -30
- package/{lib/graphics → graphics}/core.d.ts +23 -23
- package/{lib/graphics → graphics}/core.js +23 -24
- package/{lib/graphics → graphics}/core.js.map +1 -1
- package/{lib/graphics → graphics}/render-loop.d.ts +3 -3
- package/{lib/graphics → graphics}/render-loop.js +3 -3
- package/{lib/math → math}/core.d.ts +19 -10
- package/{lib/math → math}/core.js +21 -10
- package/{lib/math → math}/core.js.map +1 -1
- package/{lib/math → math}/euler.d.ts +4 -4
- package/{lib/math → math}/euler.js +4 -4
- package/{lib/math → math}/matrix3.d.ts +34 -34
- package/{lib/math → math}/matrix3.js +34 -34
- package/{lib/math → math}/quaternion.d.ts +25 -25
- package/{lib/math → math}/quaternion.js +25 -25
- package/{lib/math → math}/transformation.d.ts +3 -3
- package/{lib/math → math}/transformation.js +3 -3
- package/{lib/math → math}/vector2.d.ts +40 -40
- package/{lib/math → math}/vector2.js +40 -40
- package/{lib/math → math}/vector3.d.ts +66 -66
- package/{lib/math → math}/vector3.js +66 -66
- package/{lib/math → math}/vector4.d.ts +38 -38
- package/{lib/math → math}/vector4.js +38 -38
- package/{lib/nil.d.ts → nil.d.ts} +11 -9
- package/{lib/nil.js → nil.js} +10 -9
- package/{lib/nil.js.map → nil.js.map} +1 -1
- package/package.json +16 -18
- package/{lib/random.d.ts → random.d.ts} +11 -17
- package/{lib/random.js → random.js} +11 -17
- package/random.js.map +1 -0
- package/{lib/sleep.d.ts → sleep.d.ts} +1 -1
- package/{lib/sleep.js → sleep.js} +1 -1
- package/{lib/string-formatter.d.ts → string-formatter.d.ts} +8 -4
- package/{lib/string-formatter.js → string-formatter.js} +8 -4
- package/string-formatter.js.map +1 -0
- package/string-formatter.test.d.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/LICENSES.md +0 -17
- package/_site/assets/highlight.css +0 -141
- package/_site/assets/main.js +0 -59
- package/_site/assets/navigation.js +0 -1
- package/_site/assets/search.js +0 -1
- package/_site/assets/style.css +0 -1383
- package/_site/classes/AbstractError.html +0 -67
- package/_site/classes/Canvas.html +0 -106
- package/_site/classes/CanvasSandbox.html +0 -91
- package/_site/classes/Euler.html +0 -217
- package/_site/classes/InternalError.html +0 -71
- package/_site/classes/InvalidArgumentError.html +0 -67
- package/_site/classes/InvalidOperationError.html +0 -67
- package/_site/classes/Matrix3.html +0 -167
- package/_site/classes/NotImplementedError.html +0 -66
- package/_site/classes/PermissionViolationError.html +0 -67
- package/_site/classes/Quaternion.html +0 -211
- package/_site/classes/Random.html +0 -90
- package/_site/classes/RenderLoop.html +0 -85
- package/_site/classes/ResourceConflictError.html +0 -66
- package/_site/classes/Transformation.html +0 -52
- package/_site/classes/UnexpectedNilError.html +0 -54
- package/_site/classes/UnknownError.html +0 -70
- package/_site/classes/Vector2.html +0 -159
- package/_site/classes/Vector3.html +0 -214
- package/_site/classes/Vector4.html +0 -156
- package/_site/functions/addVector2.html +0 -44
- package/_site/functions/addVector3.html +0 -44
- package/_site/functions/blend.html +0 -47
- package/_site/functions/blendAdditive.html +0 -47
- package/_site/functions/blendSubtractive.html +0 -47
- package/_site/functions/clamp.html +0 -45
- package/_site/functions/coalesceOnRejection.html +0 -51
- package/_site/functions/cosDeg.html +0 -43
- package/_site/functions/crossVector3.html +0 -44
- package/_site/functions/deg2rad.html +0 -43
- package/_site/functions/difference.html +0 -46
- package/_site/functions/distance.html +0 -46
- package/_site/functions/dotVector3.html +0 -44
- package/_site/functions/errorToJSON.html +0 -43
- package/_site/functions/errorToRecord.html +0 -43
- package/_site/functions/errorToSimpleSerializable.html +0 -43
- package/_site/functions/filterType.html +0 -46
- package/_site/functions/formatString.html +0 -46
- package/_site/functions/formatStringTemplate.html +0 -46
- package/_site/functions/fromRGB.html +0 -46
- package/_site/functions/fromRGBA.html +0 -46
- package/_site/functions/getA.html +0 -43
- package/_site/functions/getB.html +0 -43
- package/_site/functions/getDocumentElementTypeById.html +0 -46
- package/_site/functions/getDocumentElementTypeByIdStrict.html +0 -48
- package/_site/functions/getG.html +0 -43
- package/_site/functions/getR.html +0 -43
- package/_site/functions/intersect.html +0 -47
- package/_site/functions/is.html +0 -46
- package/_site/functions/isError.html +0 -43
- package/_site/functions/isInteger.html +0 -43
- package/_site/functions/isNil.html +0 -44
- package/_site/functions/isqrt.html +0 -43
- package/_site/functions/multiplyVector2.html +0 -44
- package/_site/functions/multiplyVector3.html +0 -44
- package/_site/functions/mustExist.html +0 -45
- package/_site/functions/nextPalette.html +0 -42
- package/_site/functions/prepareAsyncContext.html +0 -46
- package/_site/functions/putPixel32.html +0 -53
- package/_site/functions/putPixel32Add.html +0 -53
- package/_site/functions/putPixel32Sub.html +0 -53
- package/_site/functions/putSubPixel32.html +0 -47
- package/_site/functions/rad2deg.html +0 -43
- package/_site/functions/randomRange.html +0 -45
- package/_site/functions/safeRGBComponent.html +0 -43
- package/_site/functions/seedFromString.html +0 -44
- package/_site/functions/shuffleArray.html +0 -44
- package/_site/functions/sinDeg.html +0 -43
- package/_site/functions/sleep.html +0 -43
- package/_site/functions/somecolor.html +0 -43
- package/_site/functions/subtractVector2.html +0 -44
- package/_site/functions/subtractVector3.html +0 -44
- package/_site/functions/toGrayScale.html +0 -43
- package/_site/functions/unknownToError.html +0 -45
- package/_site/index.html +0 -44
- package/_site/interfaces/CanvasOptions.html +0 -44
- package/_site/interfaces/CanvasSandboxApplication.html +0 -60
- package/_site/interfaces/CanvasSandboxExpectedOptions.html +0 -48
- package/_site/interfaces/CanvasSandboxOptions.html +0 -45
- package/_site/interfaces/RenderLoopOptions.html +0 -46
- package/_site/modules.html +0 -134
- package/_site/types/AnyAsyncFunction.html +0 -41
- package/_site/types/AnyConstructor.html +0 -41
- package/_site/types/AnyFunction.html +0 -41
- package/_site/types/ConstructorOf.html +0 -41
- package/_site/types/FunctionReturning.html +0 -41
- package/_site/types/Maybe.html +0 -41
- package/_site/types/Mixin.html +0 -42
- package/_site/types/Nil.html +0 -42
- package/_site/types/RenderLoopCallback.html +0 -41
- package/_site/types/SerializedError.html +0 -41
- package/_site/variables/CANVAS_SANDBOX_DEFAULT_CSS.html +0 -41
- package/_site/variables/MS_PER_FRAME_60FPS.html +0 -42
- package/_site/variables/PALETTES.html +0 -41
- package/_site/variables/TWO_PI.html +0 -41
- package/_site/variables/random-1.html +0 -41
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/bundle.js +0 -30
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -16
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/spa.css +0 -298
- package/coverage/string-formatter.ts.html +0 -187
- package/coverage/tmp/coverage-4186-1699218521999-0.json +0 -1
- package/coverage/tmp/coverage-4196-1699218521967-0.json +0 -1
- package/docs/assets/favicon.ico +0 -0
- package/lib/array.d.ts +0 -40
- package/lib/array.js.map +0 -1
- package/lib/async.d.ts +0 -27
- package/lib/async.js.map +0 -1
- package/lib/core.d.ts +0 -33
- package/lib/core.js +0 -12
- package/lib/core.js.map +0 -1
- package/lib/random.js.map +0 -1
- package/lib/string-formatter.js.map +0 -1
- package/mkdocs.yml +0 -52
- /package/{lib/error-serializer.test.d.ts → async.test.d.ts} +0 -0
- /package/{lib/dom → dom}/core.js.map +0 -0
- /package/{lib/dom → dom}/index.d.ts +0 -0
- /package/{lib/dom → dom}/index.js +0 -0
- /package/{lib/dom → dom}/index.js.map +0 -0
- /package/{lib/error-serializer.js.map → error-serializer.js.map} +0 -0
- /package/{lib/string-formatter.test.d.ts → error-serializer.test.d.ts} +0 -0
- /package/{lib/error-serializer.test.js → error-serializer.test.js} +0 -0
- /package/{lib/error-serializer.test.js.map → error-serializer.test.js.map} +0 -0
- /package/{lib/errors → errors}/AbstractError.js.map +0 -0
- /package/{lib/errors → errors}/InternalError.js.map +0 -0
- /package/{lib/errors → errors}/InvalidArgumentError.js.map +0 -0
- /package/{lib/errors → errors}/InvalidOperationError.js.map +0 -0
- /package/{lib/errors → errors}/NotImplementedError.js.map +0 -0
- /package/{lib/errors → errors}/PermissionViolationError.js.map +0 -0
- /package/{lib/errors → errors}/ResourceConflictError.js.map +0 -0
- /package/{lib/errors → errors}/UnknownError.js.map +0 -0
- /package/{lib/errors → errors}/index.d.ts +0 -0
- /package/{lib/errors → errors}/index.js +0 -0
- /package/{lib/errors → errors}/index.js.map +0 -0
- /package/{lib/graphics → graphics}/canvas-sandbox.js.map +0 -0
- /package/{lib/graphics → graphics}/canvas.js.map +0 -0
- /package/{lib/graphics → graphics}/index.d.ts +0 -0
- /package/{lib/graphics → graphics}/index.js +0 -0
- /package/{lib/graphics → graphics}/index.js.map +0 -0
- /package/{lib/graphics → graphics}/render-loop.js.map +0 -0
- /package/{lib/index.d.ts → index.d.ts} +0 -0
- /package/{lib/index.js → index.js} +0 -0
- /package/{lib/index.js.map → index.js.map} +0 -0
- /package/{lib/math → math}/euler.js.map +0 -0
- /package/{lib/math → math}/index.d.ts +0 -0
- /package/{lib/math → math}/index.js +0 -0
- /package/{lib/math → math}/index.js.map +0 -0
- /package/{lib/math → math}/matrix3.js.map +0 -0
- /package/{lib/math → math}/quaternion.js.map +0 -0
- /package/{lib/math → math}/transformation.js.map +0 -0
- /package/{lib/math → math}/vector2.js.map +0 -0
- /package/{lib/math → math}/vector3.js.map +0 -0
- /package/{lib/math → math}/vector4.js.map +0 -0
- /package/{lib/sleep.js.map → sleep.js.map} +0 -0
- /package/{lib/string-formatter.test.js → string-formatter.test.js} +0 -0
- /package/{lib/string-formatter.test.js.map → string-formatter.test.js.map} +0 -0
|
@@ -17,9 +17,9 @@ export class Vector3 {
|
|
|
17
17
|
z;
|
|
18
18
|
/**
|
|
19
19
|
* Constructs a new {@linkcode Vector3}.
|
|
20
|
-
* @param x The X component.
|
|
21
|
-
* @param y The Y component.
|
|
22
|
-
* @param z The Z component.
|
|
20
|
+
* @param x - The X component.
|
|
21
|
+
* @param y - The Y component.
|
|
22
|
+
* @param z - The Z component.
|
|
23
23
|
*/
|
|
24
24
|
constructor(x = 0, y = 0, z = 0) {
|
|
25
25
|
this.x = x;
|
|
@@ -28,7 +28,7 @@ export class Vector3 {
|
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Creates a copy of another {@linkcode Vector3}.
|
|
31
|
-
* @param vector The vector to copy.
|
|
31
|
+
* @param vector - The vector to copy.
|
|
32
32
|
* @returns A new vector.
|
|
33
33
|
*/
|
|
34
34
|
static fromVector3(vector) {
|
|
@@ -36,7 +36,7 @@ export class Vector3 {
|
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Sets the vector to new coordinates.
|
|
39
|
-
* @param vector The coordinates to set the vector to.
|
|
39
|
+
* @param vector - The coordinates to set the vector to.
|
|
40
40
|
* @returns This instance.
|
|
41
41
|
*/
|
|
42
42
|
set(vector) {
|
|
@@ -44,9 +44,9 @@ export class Vector3 {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Sets the vector to new coordinates.
|
|
47
|
-
* @param x The new X component for the vector.
|
|
48
|
-
* @param y The new Y component for the vector.
|
|
49
|
-
* @param z The new Z component for the vector.
|
|
47
|
+
* @param x - The new X component for the vector.
|
|
48
|
+
* @param y - The new Y component for the vector.
|
|
49
|
+
* @param z - The new Z component for the vector.
|
|
50
50
|
* @returns This instance.
|
|
51
51
|
*/
|
|
52
52
|
setXYZ(x, y, z) {
|
|
@@ -57,7 +57,7 @@ export class Vector3 {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Adds another vector to this vector.
|
|
60
|
-
* @param vector The vector to add to this vector.
|
|
60
|
+
* @param vector - The vector to add to this vector.
|
|
61
61
|
* @returns This instance.
|
|
62
62
|
*/
|
|
63
63
|
add(vector) {
|
|
@@ -65,9 +65,9 @@ export class Vector3 {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Adds another vector to this vector.
|
|
68
|
-
* @param x The value to add to the X component.
|
|
69
|
-
* @param y The value to add to the Y component.
|
|
70
|
-
* @param z The value to add to the Z component.
|
|
68
|
+
* @param x - The value to add to the X component.
|
|
69
|
+
* @param y - The value to add to the Y component.
|
|
70
|
+
* @param z - The value to add to the Z component.
|
|
71
71
|
* @returns This instance.
|
|
72
72
|
*/
|
|
73
73
|
addXYZ(x, y, z) {
|
|
@@ -78,8 +78,8 @@ export class Vector3 {
|
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Scales another vector and adds it to this vector.
|
|
81
|
-
* @param vector The vector to add to this vector.
|
|
82
|
-
* @param scale The scaling to apply to the input vector.
|
|
81
|
+
* @param vector - The vector to add to this vector.
|
|
82
|
+
* @param scale - The scaling to apply to the input vector.
|
|
83
83
|
* @returns This instance.
|
|
84
84
|
*/
|
|
85
85
|
addMultiply(vector, scale) {
|
|
@@ -87,10 +87,10 @@ export class Vector3 {
|
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Scales another vector and adds it to this vector.
|
|
90
|
-
* @param x The value to add to the X component.
|
|
91
|
-
* @param y The value to add to the Y component.
|
|
92
|
-
* @param z The value to add to the Z component.
|
|
93
|
-
* @param scale The scaling to apply to the input vector.
|
|
90
|
+
* @param x - The value to add to the X component.
|
|
91
|
+
* @param y - The value to add to the Y component.
|
|
92
|
+
* @param z - The value to add to the Z component.
|
|
93
|
+
* @param scale - The scaling to apply to the input vector.
|
|
94
94
|
* @returns This instance.
|
|
95
95
|
*/
|
|
96
96
|
addMultiplyXYZ(x, y, z, scale) {
|
|
@@ -101,7 +101,7 @@ export class Vector3 {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Subtracts another vector from this vector.
|
|
104
|
-
* @param vector The vector to subtract from this vector.
|
|
104
|
+
* @param vector - The vector to subtract from this vector.
|
|
105
105
|
* @returns This instance.
|
|
106
106
|
*/
|
|
107
107
|
subtract(vector) {
|
|
@@ -109,9 +109,9 @@ export class Vector3 {
|
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
111
|
* Subtracts another vector from this vector.
|
|
112
|
-
* @param x The value to subtract from the X component.
|
|
113
|
-
* @param y The value to subtract from the Y component.
|
|
114
|
-
* @param z The value to subtract from the Z component.
|
|
112
|
+
* @param x - The value to subtract from the X component.
|
|
113
|
+
* @param y - The value to subtract from the Y component.
|
|
114
|
+
* @param z - The value to subtract from the Z component.
|
|
115
115
|
* @returns This instance.
|
|
116
116
|
*/
|
|
117
117
|
subtractXYZ(x, y, z) {
|
|
@@ -122,7 +122,7 @@ export class Vector3 {
|
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* Multiplies this vector by another vector.
|
|
125
|
-
* @param vector The vector to multiply with this vector.
|
|
125
|
+
* @param vector - The vector to multiply with this vector.
|
|
126
126
|
* @returns This instance.
|
|
127
127
|
*/
|
|
128
128
|
multiply(vector) {
|
|
@@ -130,9 +130,9 @@ export class Vector3 {
|
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Multiplies this vector by another vector.
|
|
133
|
-
* @param x The value to multiply with the X component.
|
|
134
|
-
* @param y The value to multiply with the Y component.
|
|
135
|
-
* @param z The value to multiply with the Z component.
|
|
133
|
+
* @param x - The value to multiply with the X component.
|
|
134
|
+
* @param y - The value to multiply with the Y component.
|
|
135
|
+
* @param z - The value to multiply with the Z component.
|
|
136
136
|
* @returns This instance.
|
|
137
137
|
*/
|
|
138
138
|
multiplyXYZ(x, y, z) {
|
|
@@ -143,7 +143,7 @@ export class Vector3 {
|
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Multiplies the vector by the given scale.
|
|
146
|
-
* @param scale The scaling to apply to the vector.
|
|
146
|
+
* @param scale - The scaling to apply to the vector.
|
|
147
147
|
* @returns This instance.
|
|
148
148
|
*/
|
|
149
149
|
multiplyScale(scale) {
|
|
@@ -154,7 +154,7 @@ export class Vector3 {
|
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
156
|
* Divides this vector by another vector.
|
|
157
|
-
* @param vector The vector to divide this vector with.
|
|
157
|
+
* @param vector - The vector to divide this vector with.
|
|
158
158
|
* @returns This instance.
|
|
159
159
|
*/
|
|
160
160
|
divide(vector) {
|
|
@@ -162,9 +162,9 @@ export class Vector3 {
|
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Divides this vector by another vector.
|
|
165
|
-
* @param x The value to divide the X component with.
|
|
166
|
-
* @param y The value to divide the Y component with.
|
|
167
|
-
* @param z The value to divide the Z component with.
|
|
165
|
+
* @param x - The value to divide the X component with.
|
|
166
|
+
* @param y - The value to divide the Y component with.
|
|
167
|
+
* @param z - The value to divide the Z component with.
|
|
168
168
|
* @returns This instance.
|
|
169
169
|
*/
|
|
170
170
|
divideXYZ(x, y, z) {
|
|
@@ -175,7 +175,7 @@ export class Vector3 {
|
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Divides the vector by the given scale.
|
|
178
|
-
* @param scale The scaling to apply to the vector.
|
|
178
|
+
* @param scale - The scaling to apply to the vector.
|
|
179
179
|
* @returns This instance.
|
|
180
180
|
*/
|
|
181
181
|
divideScale(scale) {
|
|
@@ -206,8 +206,8 @@ export class Vector3 {
|
|
|
206
206
|
}
|
|
207
207
|
/**
|
|
208
208
|
* Clamps the components of the vector at the given boundary.
|
|
209
|
-
* @param floor The lowest value to allow.
|
|
210
|
-
* @param ceil The largest value to allow.
|
|
209
|
+
* @param floor - The lowest value to allow.
|
|
210
|
+
* @param ceil - The largest value to allow.
|
|
211
211
|
* @returns This instance.
|
|
212
212
|
*/
|
|
213
213
|
clamp(floor, ceil) {
|
|
@@ -254,7 +254,7 @@ export class Vector3 {
|
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
256
|
* Compares two vectors.
|
|
257
|
-
* @param vector The vector to compare this vector to.
|
|
257
|
+
* @param vector - The vector to compare this vector to.
|
|
258
258
|
* @returns `true` if the vectors are idently, `false` otherwise.
|
|
259
259
|
*/
|
|
260
260
|
compare(vector) {
|
|
@@ -262,8 +262,8 @@ export class Vector3 {
|
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* Linearly moves this vector towards a target vector.
|
|
265
|
-
* @param vector The target vector.
|
|
266
|
-
* @param t The location on the scale, from `0` to `1`.
|
|
265
|
+
* @param vector - The target vector.
|
|
266
|
+
* @param t - The location on the scale, from `0` to `1`.
|
|
267
267
|
* @returns This instance.
|
|
268
268
|
*/
|
|
269
269
|
lerp(vector, t) {
|
|
@@ -275,7 +275,7 @@ export class Vector3 {
|
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
277
|
* Rotates the vector by the given rotation matrix.
|
|
278
|
-
* @param matrix The rotation matrix to apply to the vector.
|
|
278
|
+
* @param matrix - The rotation matrix to apply to the vector.
|
|
279
279
|
* @returns This instance.
|
|
280
280
|
*/
|
|
281
281
|
rotate(matrix) {
|
|
@@ -289,7 +289,7 @@ export class Vector3 {
|
|
|
289
289
|
}
|
|
290
290
|
/**
|
|
291
291
|
* Inversely rotates the vector by the given rotation matrix.
|
|
292
|
-
* @param matrix The rotation matrix to apply to the vector.
|
|
292
|
+
* @param matrix - The rotation matrix to apply to the vector.
|
|
293
293
|
* @returns This instance.
|
|
294
294
|
*/
|
|
295
295
|
rotateInverse(matrix) {
|
|
@@ -303,8 +303,8 @@ export class Vector3 {
|
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Rotates the vector by the given rotation matrix around the given center.
|
|
306
|
-
* @param center The center around which to rotate the vector.
|
|
307
|
-
* @param matrix The rotation matrix to apply to the vector.
|
|
306
|
+
* @param center - The center around which to rotate the vector.
|
|
307
|
+
* @param matrix - The rotation matrix to apply to the vector.
|
|
308
308
|
* @returns This instance.
|
|
309
309
|
*/
|
|
310
310
|
rotateAround(center, matrix) {
|
|
@@ -318,8 +318,8 @@ export class Vector3 {
|
|
|
318
318
|
}
|
|
319
319
|
/**
|
|
320
320
|
* Inversely rotates the vector by the given rotation matrix around the given center.
|
|
321
|
-
* @param center The center around which to rotate the vector.
|
|
322
|
-
* @param matrix The rotation matrix to apply to the vector.
|
|
321
|
+
* @param center - The center around which to rotate the vector.
|
|
322
|
+
* @param matrix - The rotation matrix to apply to the vector.
|
|
323
323
|
* @returns This instance.
|
|
324
324
|
*/
|
|
325
325
|
rotateAroundInverse(center, matrix) {
|
|
@@ -333,7 +333,7 @@ export class Vector3 {
|
|
|
333
333
|
}
|
|
334
334
|
/**
|
|
335
335
|
* Transform the vector with a {@linkcode Transformation}.
|
|
336
|
-
* @param transformation The transformation to apply.
|
|
336
|
+
* @param transformation - The transformation to apply.
|
|
337
337
|
* @returns This instance.
|
|
338
338
|
*/
|
|
339
339
|
transform(transformation) {
|
|
@@ -343,7 +343,7 @@ export class Vector3 {
|
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* Inversely transform the vector with a {@linkcode Transformation}.
|
|
346
|
-
* @param transformation The transformation to apply.
|
|
346
|
+
* @param transformation - The transformation to apply.
|
|
347
347
|
* @returns This instance.
|
|
348
348
|
*/
|
|
349
349
|
transformInverse(transformation) {
|
|
@@ -353,7 +353,7 @@ export class Vector3 {
|
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
355
|
* Returns the dot product between two vectors.
|
|
356
|
-
* @param vector The other vector.
|
|
356
|
+
* @param vector - The other vector.
|
|
357
357
|
* @returns The dot product between the two vectors.
|
|
358
358
|
*/
|
|
359
359
|
dot(vector) {
|
|
@@ -361,9 +361,9 @@ export class Vector3 {
|
|
|
361
361
|
}
|
|
362
362
|
/**
|
|
363
363
|
* Returns the dot product between two vectors.
|
|
364
|
-
* @param x The X component of the other vector.
|
|
365
|
-
* @param y The Y component of the other vector.
|
|
366
|
-
* @param z The Z component of the other vector.
|
|
364
|
+
* @param x - The X component of the other vector.
|
|
365
|
+
* @param y - The Y component of the other vector.
|
|
366
|
+
* @param z - The Z component of the other vector.
|
|
367
367
|
* @returns The dot product between the two vectors.
|
|
368
368
|
*/
|
|
369
369
|
dotXYZ(x, y, z) {
|
|
@@ -372,7 +372,7 @@ export class Vector3 {
|
|
|
372
372
|
/**
|
|
373
373
|
* Calculates the dot product of this vector and another vector, and then
|
|
374
374
|
* sets this vector to the result.
|
|
375
|
-
* @param vector The other vector.
|
|
375
|
+
* @param vector - The other vector.
|
|
376
376
|
* @returns This instance.
|
|
377
377
|
*/
|
|
378
378
|
cross(vector) {
|
|
@@ -386,9 +386,9 @@ export class Vector3 {
|
|
|
386
386
|
}
|
|
387
387
|
/**
|
|
388
388
|
* Makes this vector perpendicular to the other 3 vectors.
|
|
389
|
-
* @param vector0 The first vector.
|
|
390
|
-
* @param vector1 The second vector.
|
|
391
|
-
* @param vector2 The third vector.
|
|
389
|
+
* @param vector0 - The first vector.
|
|
390
|
+
* @param vector1 - The second vector.
|
|
391
|
+
* @param vector2 - The third vector.
|
|
392
392
|
* @returns This instance.
|
|
393
393
|
*/
|
|
394
394
|
perpendicular(vector0, vector1, vector2) {
|
|
@@ -406,7 +406,7 @@ export class Vector3 {
|
|
|
406
406
|
/**
|
|
407
407
|
* Reflects this vector against the given normal and sets this vector to
|
|
408
408
|
* the result.
|
|
409
|
-
* @param normal The normal against which to reflect.
|
|
409
|
+
* @param normal - The normal against which to reflect.
|
|
410
410
|
* @returns This instance.
|
|
411
411
|
*/
|
|
412
412
|
reflect(normal) {
|
|
@@ -420,8 +420,8 @@ export class Vector3 {
|
|
|
420
420
|
* Calculates the reflection of this vector, based on the angle of incident
|
|
421
421
|
* into a material with the given refractive index, according to Snell's law.
|
|
422
422
|
* This vector is then set to the result.
|
|
423
|
-
* @param normal The normal against which to reflect.
|
|
424
|
-
* @param index The refractive index of the material.
|
|
423
|
+
* @param normal - The normal against which to reflect.
|
|
424
|
+
* @param index - The refractive index of the material.
|
|
425
425
|
* @returns This instance.
|
|
426
426
|
*/
|
|
427
427
|
fraction(normal, index) {
|
|
@@ -445,8 +445,8 @@ export class Vector3 {
|
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
447
|
* Adds two vectors and returns a new vector with the result.
|
|
448
|
-
* @param a The first input vector.
|
|
449
|
-
* @param b The second input vector.
|
|
448
|
+
* @param a - The first input vector.
|
|
449
|
+
* @param b - The second input vector.
|
|
450
450
|
* @returns A new {@linkcode Vector3}.
|
|
451
451
|
* @group Math
|
|
452
452
|
*/
|
|
@@ -455,8 +455,8 @@ export const addVector3 = (a, b) => {
|
|
|
455
455
|
};
|
|
456
456
|
/**
|
|
457
457
|
* Multiplies two vectors and returns a new vector with the result.
|
|
458
|
-
* @param a The first input vector.
|
|
459
|
-
* @param b The second input vector.
|
|
458
|
+
* @param a - The first input vector.
|
|
459
|
+
* @param b - The second input vector.
|
|
460
460
|
* @returns A new {@linkcode Vector3}.
|
|
461
461
|
* @group Math
|
|
462
462
|
*/
|
|
@@ -465,8 +465,8 @@ export const multiplyVector3 = (a, b) => {
|
|
|
465
465
|
};
|
|
466
466
|
/**
|
|
467
467
|
* Subtracts two vectors and returns a new vector with the result.
|
|
468
|
-
* @param a The first input vector.
|
|
469
|
-
* @param b The second input vector.
|
|
468
|
+
* @param a - The first input vector.
|
|
469
|
+
* @param b - The second input vector.
|
|
470
470
|
* @returns A new {@linkcode Vector3}.
|
|
471
471
|
* @group Math
|
|
472
472
|
*/
|
|
@@ -475,8 +475,8 @@ export const subtractVector3 = (a, b) => {
|
|
|
475
475
|
};
|
|
476
476
|
/**
|
|
477
477
|
* Calculates the cross product between two vectors and returns a new vector with the result.
|
|
478
|
-
* @param a The first input vector.
|
|
479
|
-
* @param b The second input vector.
|
|
478
|
+
* @param a - The first input vector.
|
|
479
|
+
* @param b - The second input vector.
|
|
480
480
|
* @returns A new vector, which is the cross product of the two input vectors.
|
|
481
481
|
* @group Math
|
|
482
482
|
*/
|
|
@@ -486,8 +486,8 @@ export const crossVector3 = (a, b) => {
|
|
|
486
486
|
};
|
|
487
487
|
/**
|
|
488
488
|
* Calculates the dot product between two vectors.
|
|
489
|
-
* @param a The first input vector.
|
|
490
|
-
* @param b The second input vector.
|
|
489
|
+
* @param a - The first input vector.
|
|
490
|
+
* @param b - The second input vector.
|
|
491
491
|
* @returns The dot product between the two vectors.
|
|
492
492
|
* @group Math
|
|
493
493
|
*/
|
|
@@ -45,114 +45,114 @@ export declare class Vector4 {
|
|
|
45
45
|
set w(value: number);
|
|
46
46
|
/**
|
|
47
47
|
* Constructs a new {@linkcode Vector4}.
|
|
48
|
-
* @param x The X component.
|
|
49
|
-
* @param y The Y component.
|
|
50
|
-
* @param z The Z component.
|
|
51
|
-
* @param w The W component.
|
|
48
|
+
* @param x - The X component.
|
|
49
|
+
* @param y - The Y component.
|
|
50
|
+
* @param z - The Z component.
|
|
51
|
+
* @param w - The W component.
|
|
52
52
|
*/
|
|
53
53
|
constructor(x: number, y: number, z: number, w: number);
|
|
54
54
|
/**
|
|
55
55
|
* Creates a copy of another {@linkcode Vector4}.
|
|
56
|
-
* @param vector The vector to copy.
|
|
56
|
+
* @param vector - The vector to copy.
|
|
57
57
|
* @returns A new vector.
|
|
58
58
|
*/
|
|
59
59
|
static fromVector4(vector: Readonly<Vector4>): Vector4;
|
|
60
60
|
/**
|
|
61
61
|
* Sets the vector to new coordinates.
|
|
62
|
-
* @param vector The coordinates to set the vector to.
|
|
62
|
+
* @param vector - The coordinates to set the vector to.
|
|
63
63
|
* @returns This instance.
|
|
64
64
|
*/
|
|
65
65
|
set(vector: Readonly<Vector4>): this;
|
|
66
66
|
/**
|
|
67
67
|
* Sets the vector to new coordinates.
|
|
68
|
-
* @param x The new X component for the vector.
|
|
69
|
-
* @param y The new Y component for the vector.
|
|
70
|
-
* @param z The new Z component for the vector.
|
|
71
|
-
* @param w The new W component for the vector.
|
|
68
|
+
* @param x - The new X component for the vector.
|
|
69
|
+
* @param y - The new Y component for the vector.
|
|
70
|
+
* @param z - The new Z component for the vector.
|
|
71
|
+
* @param w - The new W component for the vector.
|
|
72
72
|
* @returns This instance.
|
|
73
73
|
*/
|
|
74
74
|
setXYZW(x: number, y: number, z: number, w: number): this;
|
|
75
75
|
/**
|
|
76
76
|
* Adds the XYZ components of another vector to this vector.
|
|
77
|
-
* @param vector The vector to add to this vector.
|
|
77
|
+
* @param vector - The vector to add to this vector.
|
|
78
78
|
* @returns This instance.
|
|
79
79
|
*/
|
|
80
80
|
add3(vector: Readonly<Vector4>): this;
|
|
81
81
|
/**
|
|
82
82
|
* Adds the XYZ components of another vector to this vector.
|
|
83
|
-
* @param x The value to add to the X component.
|
|
84
|
-
* @param y The value to add to the Y component.
|
|
85
|
-
* @param z The value to add to the Z component.
|
|
83
|
+
* @param x - The value to add to the X component.
|
|
84
|
+
* @param y - The value to add to the Y component.
|
|
85
|
+
* @param z - The value to add to the Z component.
|
|
86
86
|
* @returns This instance.
|
|
87
87
|
*/
|
|
88
88
|
add3XYZ(x: number, y: number, z: number): this;
|
|
89
89
|
/**
|
|
90
90
|
* Scales another vector and adds its XYZ components to this vector.
|
|
91
|
-
* @param vector The vector to add to this vector.
|
|
92
|
-
* @param scale The scaling to apply to the input vector.
|
|
91
|
+
* @param vector - The vector to add to this vector.
|
|
92
|
+
* @param scale - The scaling to apply to the input vector.
|
|
93
93
|
* @returns This instance.
|
|
94
94
|
*/
|
|
95
95
|
addMultiply3(vector: Readonly<Vector4>, scale: number): this;
|
|
96
96
|
/**
|
|
97
97
|
* Scales another vector and adds its XYZ components to this vector.
|
|
98
|
-
* @param x The value to add to the X component.
|
|
99
|
-
* @param y The value to add to the Y component.
|
|
100
|
-
* @param z The value to add to the Z component.
|
|
101
|
-
* @param scale The scaling to apply to the input vector.
|
|
98
|
+
* @param x - The value to add to the X component.
|
|
99
|
+
* @param y - The value to add to the Y component.
|
|
100
|
+
* @param z - The value to add to the Z component.
|
|
101
|
+
* @param scale - The scaling to apply to the input vector.
|
|
102
102
|
* @returns This instance.
|
|
103
103
|
*/
|
|
104
104
|
addMultiply3XYZ(x: number, y: number, z: number, scale: number): this;
|
|
105
105
|
/**
|
|
106
106
|
* Subtracts the XYZ components of another vector from this vector.
|
|
107
|
-
* @param vector The vector to subtract from this vector.
|
|
107
|
+
* @param vector - The vector to subtract from this vector.
|
|
108
108
|
* @returns This instance.
|
|
109
109
|
*/
|
|
110
110
|
subtract3(vector: Readonly<Vector4>): this;
|
|
111
111
|
/**
|
|
112
112
|
* Subtracts the XYZ components of another vector from this vector.
|
|
113
|
-
* @param x The value to subtract from the X component.
|
|
114
|
-
* @param y The value to subtract from the Y component.
|
|
115
|
-
* @param z The value to subtract from the Z component.
|
|
113
|
+
* @param x - The value to subtract from the X component.
|
|
114
|
+
* @param y - The value to subtract from the Y component.
|
|
115
|
+
* @param z - The value to subtract from the Z component.
|
|
116
116
|
* @returns This instance.
|
|
117
117
|
*/
|
|
118
118
|
subtract3XYZ(x: number, y: number, z: number): this;
|
|
119
119
|
/**
|
|
120
120
|
* Multiplies the XYZ components of this vector by another vector.
|
|
121
|
-
* @param vector The vector to multiply with this vector.
|
|
121
|
+
* @param vector - The vector to multiply with this vector.
|
|
122
122
|
* @returns This instance.
|
|
123
123
|
*/
|
|
124
124
|
multiply3(vector: Readonly<Vector4>): this;
|
|
125
125
|
/**
|
|
126
126
|
* Multiplies the XYZ components of this vector by another vector.
|
|
127
|
-
* @param x The value to multiply with the X component.
|
|
128
|
-
* @param y The value to multiply with the Y component.
|
|
129
|
-
* @param z The value to multiply with the Z component.
|
|
127
|
+
* @param x - The value to multiply with the X component.
|
|
128
|
+
* @param y - The value to multiply with the Y component.
|
|
129
|
+
* @param z - The value to multiply with the Z component.
|
|
130
130
|
* @returns This instance.
|
|
131
131
|
*/
|
|
132
132
|
multiply3XYZ(x: number, y: number, z: number): this;
|
|
133
133
|
/**
|
|
134
134
|
* Multiplies the XYZ components of the vector by the given scale.
|
|
135
|
-
* @param scale The scaling to apply to the vector.
|
|
135
|
+
* @param scale - The scaling to apply to the vector.
|
|
136
136
|
* @returns This instance.
|
|
137
137
|
*/
|
|
138
138
|
multiply3Scale(scale: number): this;
|
|
139
139
|
/**
|
|
140
140
|
* Divides the XYZ components of this vector by another vector.
|
|
141
|
-
* @param vector The vector to divide this vector with.
|
|
141
|
+
* @param vector - The vector to divide this vector with.
|
|
142
142
|
* @returns This instance.
|
|
143
143
|
*/
|
|
144
144
|
divide3(vector: Readonly<Vector4>): this;
|
|
145
145
|
/**
|
|
146
146
|
* Divides the XYZ components of this vector by another vector.
|
|
147
|
-
* @param x The value to divide the X component with.
|
|
148
|
-
* @param y The value to divide the Y component with.
|
|
149
|
-
* @param z The value to divide the Z component with.
|
|
147
|
+
* @param x - The value to divide the X component with.
|
|
148
|
+
* @param y - The value to divide the Y component with.
|
|
149
|
+
* @param z - The value to divide the Z component with.
|
|
150
150
|
* @returns This instance.
|
|
151
151
|
*/
|
|
152
152
|
divide3XYZ(x: number, y: number, z: number): this;
|
|
153
153
|
/**
|
|
154
154
|
* Divides the XYZ components of the vector by the given scale.
|
|
155
|
-
* @param scale The scaling to apply to the vector.
|
|
155
|
+
* @param scale - The scaling to apply to the vector.
|
|
156
156
|
* @returns This instance.
|
|
157
157
|
*/
|
|
158
158
|
divide3Scale(scale: number): this;
|
|
@@ -168,15 +168,15 @@ export declare class Vector4 {
|
|
|
168
168
|
invertMultiply3(): this;
|
|
169
169
|
/**
|
|
170
170
|
* Clamps the components of the vector at the given boundary.
|
|
171
|
-
* @param floor The lowest value to allow.
|
|
172
|
-
* @param ceil The largest value to allow.
|
|
171
|
+
* @param floor - The lowest value to allow.
|
|
172
|
+
* @param ceil - The largest value to allow.
|
|
173
173
|
* @returns This instance.
|
|
174
174
|
*/
|
|
175
175
|
clamp(floor: number, ceil: number): this;
|
|
176
176
|
/**
|
|
177
177
|
* Linearly moves this vector towards a target vector.
|
|
178
|
-
* @param vector The target vector.
|
|
179
|
-
* @param t The location on the scale, from `0` to `1`.
|
|
178
|
+
* @param vector - The target vector.
|
|
179
|
+
* @param t - The location on the scale, from `0` to `1`.
|
|
180
180
|
* @returns This instance.
|
|
181
181
|
*/
|
|
182
182
|
lerp(vector: Readonly<Vector4>, t: number): this;
|