@oliversalzburg/js-utils 0.0.13 → 0.0.15

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 (157) hide show
  1. package/_site/assets/navigation.js +1 -1
  2. package/_site/assets/search.js +1 -1
  3. package/_site/classes/AbstractError.html +47 -8
  4. package/_site/classes/Canvas.html +66 -26
  5. package/_site/classes/CanvasSandbox.html +76 -0
  6. package/_site/classes/Euler.html +217 -0
  7. package/_site/classes/InternalError.html +48 -9
  8. package/_site/classes/InvalidArgumentError.html +47 -8
  9. package/_site/classes/InvalidOperationError.html +47 -8
  10. package/_site/classes/Matrix3.html +167 -0
  11. package/_site/classes/NotImplementedError.html +47 -8
  12. package/_site/classes/PermissionViolationError.html +47 -8
  13. package/_site/classes/Quaternion.html +211 -0
  14. package/_site/classes/Random.html +60 -13
  15. package/_site/classes/RenderLoop.html +62 -20
  16. package/_site/classes/ResourceConflictError.html +47 -8
  17. package/_site/classes/Transformation.html +52 -0
  18. package/_site/classes/UnexpectedNilError.html +44 -5
  19. package/_site/classes/UnknownError.html +47 -8
  20. package/_site/classes/Vector2.html +80 -37
  21. package/_site/classes/Vector3.html +201 -15
  22. package/_site/classes/Vector4.html +156 -0
  23. package/_site/favicon.ico +0 -0
  24. package/_site/functions/addVector2.html +43 -4
  25. package/_site/functions/addVector3.html +44 -0
  26. package/_site/functions/blend.html +41 -2
  27. package/_site/functions/blendAdditive.html +41 -2
  28. package/_site/functions/blendSubtractive.html +41 -2
  29. package/_site/functions/clamp.html +41 -2
  30. package/_site/functions/coalesceOnRejection.html +48 -0
  31. package/_site/functions/cosDeg.html +41 -2
  32. package/_site/functions/crossVector3.html +44 -0
  33. package/_site/functions/deg2rad.html +41 -2
  34. package/_site/functions/difference.html +41 -2
  35. package/_site/functions/distance.html +41 -2
  36. package/_site/functions/dotVector3.html +44 -0
  37. package/_site/functions/errorToJSON.html +41 -2
  38. package/_site/functions/errorToRecord.html +41 -2
  39. package/_site/functions/errorToSimpleSerializable.html +41 -2
  40. package/_site/functions/filterType.html +41 -2
  41. package/_site/functions/formatString.html +41 -2
  42. package/_site/functions/formatStringTemplate.html +41 -2
  43. package/_site/functions/fromRGB.html +41 -2
  44. package/_site/functions/fromRGBA.html +41 -2
  45. package/_site/functions/getA.html +41 -2
  46. package/_site/functions/getB.html +41 -2
  47. package/_site/functions/getDocumentElementTypeById.html +41 -2
  48. package/_site/functions/getG.html +41 -2
  49. package/_site/functions/getR.html +41 -2
  50. package/_site/functions/intersect.html +41 -2
  51. package/_site/functions/is.html +41 -2
  52. package/_site/functions/isError.html +41 -2
  53. package/_site/functions/isInteger.html +41 -2
  54. package/_site/functions/isNil.html +41 -2
  55. package/_site/functions/isqrt.html +41 -2
  56. package/_site/functions/multiplyVector2.html +43 -4
  57. package/_site/functions/multiplyVector3.html +44 -0
  58. package/_site/functions/mustExist.html +41 -2
  59. package/_site/functions/nextPalette.html +42 -2
  60. package/_site/functions/prepareAsyncContext.html +46 -0
  61. package/_site/functions/putPixel32.html +47 -8
  62. package/_site/functions/putPixel32Add.html +47 -8
  63. package/_site/functions/putPixel32Sub.html +47 -8
  64. package/_site/functions/putSubPixel32.html +41 -2
  65. package/_site/functions/rad2deg.html +41 -2
  66. package/_site/functions/randomRange.html +41 -2
  67. package/_site/functions/safeRGBComponent.html +41 -2
  68. package/_site/functions/seedFromString.html +41 -2
  69. package/_site/functions/shuffleArray.html +41 -2
  70. package/_site/functions/sinDeg.html +41 -2
  71. package/_site/functions/sleep.html +41 -2
  72. package/_site/functions/somecolor.html +41 -2
  73. package/_site/functions/subtractVector2.html +43 -4
  74. package/_site/functions/subtractVector3.html +44 -0
  75. package/_site/functions/toGrayScale.html +41 -2
  76. package/_site/functions/unknownToError.html +41 -2
  77. package/_site/index.html +41 -2
  78. package/_site/interfaces/CanvasOptions.html +42 -3
  79. package/_site/interfaces/CanvasSandboxApplication.html +60 -0
  80. package/_site/interfaces/CanvasSandboxExpectedOptions.html +48 -0
  81. package/_site/interfaces/RenderLoopOptions.html +43 -4
  82. package/_site/modules.html +59 -3
  83. package/_site/types/AnyAsyncFunction.html +41 -0
  84. package/_site/types/AnyConstructor.html +41 -2
  85. package/_site/types/AnyFunction.html +41 -2
  86. package/_site/types/ConstructorOf.html +41 -2
  87. package/_site/types/FunctionReturning.html +41 -2
  88. package/_site/types/Maybe.html +41 -2
  89. package/_site/types/Mixin.html +41 -2
  90. package/_site/types/Nil.html +41 -2
  91. package/_site/types/RenderLoopCallback.html +41 -2
  92. package/_site/types/SerializedError.html +41 -2
  93. package/_site/variables/MS_PER_FRAME_60FPS.html +42 -0
  94. package/_site/variables/PALETTES.html +41 -2
  95. package/_site/variables/TWO_PI.html +41 -2
  96. package/_site/variables/random-1.html +41 -2
  97. package/docs/assets/favicon.ico +0 -0
  98. package/lib/Async.d.ts +3 -0
  99. package/lib/Async.js +17 -0
  100. package/lib/Async.js.map +1 -0
  101. package/lib/async.d.ts +24 -0
  102. package/lib/async.js +37 -0
  103. package/lib/async.js.map +1 -0
  104. package/lib/core.d.ts +4 -0
  105. package/lib/core.js.map +1 -1
  106. package/lib/graphics/canvas copy.d.ts +170 -0
  107. package/lib/graphics/canvas copy.js +300 -0
  108. package/lib/graphics/canvas copy.js.map +1 -0
  109. package/lib/graphics/canvas-sandbox.d.ts +206 -0
  110. package/lib/graphics/canvas-sandbox.js +272 -0
  111. package/lib/graphics/canvas-sandbox.js.map +1 -0
  112. package/lib/graphics/canvas-worker.d.ts +50 -0
  113. package/lib/graphics/canvas-worker.js +78 -0
  114. package/lib/graphics/canvas-worker.js.map +1 -0
  115. package/lib/graphics/canvas.d.ts +14 -9
  116. package/lib/graphics/canvas.js +53 -19
  117. package/lib/graphics/canvas.js.map +1 -1
  118. package/lib/graphics/core.d.ts +2 -1
  119. package/lib/graphics/core.js +2 -0
  120. package/lib/graphics/core.js.map +1 -1
  121. package/lib/graphics/index.d.ts +1 -0
  122. package/lib/graphics/index.js +1 -0
  123. package/lib/graphics/index.js.map +1 -1
  124. package/lib/graphics/render-loop.d.ts +6 -5
  125. package/lib/graphics/render-loop.js +18 -9
  126. package/lib/graphics/render-loop.js.map +1 -1
  127. package/lib/index.d.ts +1 -0
  128. package/lib/index.js +1 -0
  129. package/lib/index.js.map +1 -1
  130. package/lib/math/euler.d.ts +19 -0
  131. package/lib/math/euler.js +23 -0
  132. package/lib/math/euler.js.map +1 -0
  133. package/lib/math/index.d.ts +5 -1
  134. package/lib/math/index.js +5 -1
  135. package/lib/math/index.js.map +1 -1
  136. package/lib/math/matrix3.d.ts +218 -0
  137. package/lib/math/matrix3.js +509 -0
  138. package/lib/math/matrix3.js.map +1 -0
  139. package/lib/math/quaternion.d.ts +120 -0
  140. package/lib/math/quaternion.js +272 -0
  141. package/lib/math/quaternion.js.map +1 -0
  142. package/lib/math/transformation.d.ts +27 -0
  143. package/lib/math/transformation.js +32 -0
  144. package/lib/math/transformation.js.map +1 -0
  145. package/lib/math/vector2.d.ts +19 -13
  146. package/lib/math/vector2.js +12 -4
  147. package/lib/math/vector2.js.map +1 -1
  148. package/lib/math/vector3.d.ts +256 -3
  149. package/lib/math/vector3.js +440 -1
  150. package/lib/math/vector3.js.map +1 -1
  151. package/lib/math/vector4.d.ts +183 -0
  152. package/lib/math/vector4.js +303 -0
  153. package/lib/math/vector4.js.map +1 -0
  154. package/lib/random.d.ts +12 -0
  155. package/lib/random.js +16 -0
  156. package/lib/random.js.map +1 -1
  157. package/package.json +4 -3
@@ -0,0 +1,218 @@
1
+ import { Euler } from "./euler.js";
2
+ import { Quaternion } from "./quaternion.js";
3
+ import { Vector3 } from "./vector3.js";
4
+ /**
5
+ * A matrix with 3 x 3 components.
6
+ * @group Math
7
+ */
8
+ export declare class Matrix3 {
9
+ /**
10
+ * The components of the matrix.
11
+ */
12
+ m: number[][];
13
+ /**
14
+ * Get position `0,0` of this matrix.
15
+ * @returns The position `0,0` of this matrix.
16
+ */
17
+ get m00(): number;
18
+ /**
19
+ * Set position `0,0` of this matrix.
20
+ */
21
+ set m00(value: number);
22
+ /**
23
+ * Get position `1,0` of this matrix.
24
+ * @returns The position `1,0` of this matrix.
25
+ */
26
+ get m10(): number;
27
+ /**
28
+ * Set position `1,0` of this matrix.
29
+ */
30
+ set m10(value: number);
31
+ /**
32
+ * Get position `2,0` of this matrix.
33
+ * @returns The position `2,0` of this matrix.
34
+ */
35
+ get m20(): number;
36
+ /**
37
+ * Set position `2,0` of this matrix.
38
+ */
39
+ set m20(value: number);
40
+ /**
41
+ * Get position `0,1` of this matrix.
42
+ * @returns The position `0,1` of this matrix.
43
+ */
44
+ get m01(): number;
45
+ /**
46
+ * Set position `0,1` of this matrix.
47
+ */
48
+ set m01(value: number);
49
+ /**
50
+ * Get position `1,1` of this matrix.
51
+ * @returns The position `1,1` of this matrix.
52
+ */
53
+ get m11(): number;
54
+ /**
55
+ * Set position `1,1` of this matrix.
56
+ */
57
+ set m11(value: number);
58
+ /**
59
+ * Get position `2,1` of this matrix.
60
+ * @returns The position `2,1` of this matrix.
61
+ */
62
+ get m21(): number;
63
+ /**
64
+ * Set position `2,1` of this matrix.
65
+ */
66
+ set m21(value: number);
67
+ /**
68
+ * Get position `0,2` of this matrix.
69
+ * @returns The position `0,2` of this matrix.
70
+ */
71
+ get m02(): number;
72
+ /**
73
+ * Set position `0,2` of this matrix.
74
+ */
75
+ set m02(value: number);
76
+ /**
77
+ * Get position `1,2` of this matrix.
78
+ * @returns The position `1,2` of this matrix.
79
+ */
80
+ get m12(): number;
81
+ /**
82
+ * Set position `1,2` of this matrix.
83
+ */
84
+ set m12(value: number);
85
+ /**
86
+ * Get position `2,2` of this matrix.
87
+ * @returns The position `2,2` of this matrix.
88
+ */
89
+ get m22(): number;
90
+ /**
91
+ * Set position `2,2` of this matrix.
92
+ */
93
+ set m22(value: number);
94
+ /**
95
+ * Constructs a new {@linkcode Matrix3}.
96
+ * @param m00 Position `0,0` of this matrix.
97
+ * @param m10 Position `1,0` of this matrix.
98
+ * @param m20 Position `2,0` of this matrix.
99
+ * @param m01 Position `0,1` of this matrix.
100
+ * @param m11 Position `1,1` of this matrix.
101
+ * @param m21 Position `2,1` of this matrix.
102
+ * @param m02 Position `0,2` of this matrix.
103
+ * @param m12 Position `1,2` of this matrix.
104
+ * @param m22 Position `2,2` of this matrix.
105
+ */
106
+ constructor(m00?: number, m10?: number, m20?: number, m01?: number, m11?: number, m21?: number, m02?: number, m12?: number, m22?: number);
107
+ /**
108
+ * Creates a new {@linkcode Matrix3} from another {@linkcode Matrix3}.
109
+ * @param matrix The matrix to copy.
110
+ * @returns A new matrix.
111
+ */
112
+ static fromMatrix3(matrix: Readonly<Matrix3>): Matrix3;
113
+ /**
114
+ * Creates a new {@linkcode Matrix3} from a rotation in Euler angles.
115
+ * @param degrees The rotation in Euler angles.
116
+ * @returns A new matrix.
117
+ */
118
+ static fromEuler(degrees: Readonly<Euler>): Matrix3;
119
+ /**
120
+ * Creates a new {@linkcode Matrix3} from a rotation around an axis.
121
+ * @param axis The axis around which to rotate.
122
+ * @param degrees The rotation in degrees.
123
+ * @returns A new matrix.
124
+ */
125
+ static fromVector3(axis: Readonly<Vector3>, degrees: number): Matrix3;
126
+ /**
127
+ * Creates a new {@linkcode Matrix3} from a quaternion.
128
+ * @param quaternion The quaternion describes the rotation.
129
+ * @returns A new matrix.
130
+ */
131
+ static fromQuaternion(quaternion: Readonly<Quaternion>): Matrix3;
132
+ /**
133
+ * Sets the matrix to new values from another matrix.
134
+ * @param matrix The matrix to copy.
135
+ * @returns This instance.
136
+ */
137
+ set(matrix: Readonly<Matrix3>): this;
138
+ /**
139
+ * Update the matrix by individual components.
140
+ * @param m00 Position `0,0` of this matrix.
141
+ * @param m10 Position `1,0` of this matrix.
142
+ * @param m20 Position `2,0` of this matrix.
143
+ * @param m01 Position `0,1` of this matrix.
144
+ * @param m11 Position `1,1` of this matrix.
145
+ * @param m21 Position `2,1` of this matrix.
146
+ * @param m02 Position `0,2` of this matrix.
147
+ * @param m12 Position `1,2` of this matrix.
148
+ * @param m22 Position `2,2` of this matrix.
149
+ * @returns This instance.
150
+ */
151
+ setM(m00: number, m10: number, m20: number, m01: number, m11: number, m21: number, m02: number, m12: number, m22: number): this;
152
+ /**
153
+ * Sets the matrix to a rotation in Euler angles.
154
+ * @param degrees The rotation in Euler angles.
155
+ * @returns This instance.
156
+ */
157
+ setEuler(degrees: Readonly<Euler>): this;
158
+ /**
159
+ * Sets the matrix to a rotation around an axis.
160
+ * @param axis The axis around which to rotate.
161
+ * @param degrees The rotation in degrees.
162
+ * @returns This instance.
163
+ */
164
+ setVector3(axis: Readonly<Vector3>, degrees: number): this;
165
+ /**
166
+ * Sets the matrix to a rotation described by a quaternion.
167
+ * @param quaternion The quaternion describing the rotation.
168
+ * @returns This instance.
169
+ */
170
+ setQuaternion(quaternion: Readonly<Quaternion>): this;
171
+ /**
172
+ * Normalizes the matrix.
173
+ * @returns This instance.
174
+ */
175
+ normalize(): this;
176
+ /**
177
+ * Inverts the matrix.
178
+ * @returns This instance.
179
+ */
180
+ invert(): this;
181
+ /**
182
+ * Multiply with another matrix from the right.
183
+ * @param matrix The matrix to multiply with.
184
+ * @returns This instance.
185
+ */
186
+ multiplyR(matrix: Readonly<Matrix3>): this;
187
+ /**
188
+ * Inversely multiply with another matrix from the right.
189
+ * @param matrix The matrix to multiply with.
190
+ * @returns This instance.
191
+ */
192
+ multiplyInverseR(matrix: Readonly<Matrix3>): this;
193
+ /**
194
+ * Multiply with another matrix from the left.
195
+ * @param matrix The matrix to multiply with.
196
+ * @returns This instance.
197
+ */
198
+ multiplyL(matrix: Readonly<Matrix3>): this;
199
+ /**
200
+ * Inversely multiply with another matrix from the right.
201
+ * @param matrix The matrix to multiply with.
202
+ * @returns This instance.
203
+ */
204
+ multiplyInverseL(matrix: Readonly<Matrix3>): this;
205
+ /**
206
+ * Sets this matrix up as a transformation matrix to look in a given direction.
207
+ * @param direction The direction to look in.
208
+ * @param upVector The vector indicating the up direction. If not provided
209
+ * a best effort is made to find a good one.
210
+ * @returns This instance.
211
+ */
212
+ lookAt(direction: Readonly<Vector3>, upVector?: Readonly<Vector3>): this;
213
+ /**
214
+ * Return the components of this matrix as an array.
215
+ * @returns The components of this matrix as an array.
216
+ */
217
+ asArray(): [number, number, number, number, number, number, number, number, number];
218
+ }