@esengine/ecs-framework-math 1.0.5 → 2.9.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.
Files changed (93) hide show
  1. package/LICENSE +21 -0
  2. package/bin/Animation/Easing.d.ts +244 -0
  3. package/bin/Animation/Easing.d.ts.map +1 -0
  4. package/bin/Animation/Easing.js +407 -0
  5. package/bin/Animation/Easing.js.map +1 -0
  6. package/bin/Animation/Interpolation.d.ts +172 -0
  7. package/bin/Animation/Interpolation.d.ts.map +1 -0
  8. package/bin/Animation/Interpolation.js +327 -0
  9. package/bin/Animation/Interpolation.js.map +1 -0
  10. package/bin/Animation/index.d.ts +8 -0
  11. package/bin/Animation/index.d.ts.map +1 -0
  12. package/bin/Animation/index.js +8 -0
  13. package/bin/Animation/index.js.map +1 -0
  14. package/bin/Circle.d.ts +277 -0
  15. package/bin/Circle.d.ts.map +1 -0
  16. package/bin/Circle.js +496 -0
  17. package/bin/Circle.js.map +1 -0
  18. package/bin/Collision/CollisionDetector.d.ts +114 -0
  19. package/bin/Collision/CollisionDetector.d.ts.map +1 -0
  20. package/bin/Collision/CollisionDetector.js +353 -0
  21. package/bin/Collision/CollisionDetector.js.map +1 -0
  22. package/bin/Collision/index.d.ts +7 -0
  23. package/bin/Collision/index.d.ts.map +1 -0
  24. package/bin/Collision/index.js +7 -0
  25. package/bin/Collision/index.js.map +1 -0
  26. package/bin/Color.d.ts +277 -0
  27. package/bin/Color.d.ts.map +1 -0
  28. package/bin/Color.js +470 -0
  29. package/bin/Color.js.map +1 -0
  30. package/bin/Fixed32.d.ts +266 -0
  31. package/bin/Fixed32.d.ts.map +1 -0
  32. package/bin/Fixed32.js +381 -0
  33. package/bin/Fixed32.js.map +1 -0
  34. package/bin/FixedMath.d.ts +109 -0
  35. package/bin/FixedMath.d.ts.map +1 -0
  36. package/bin/FixedMath.js +264 -0
  37. package/bin/FixedMath.js.map +1 -0
  38. package/bin/FixedVector2.d.ts +293 -0
  39. package/bin/FixedVector2.d.ts.map +1 -0
  40. package/bin/FixedVector2.js +413 -0
  41. package/bin/FixedVector2.js.map +1 -0
  42. package/bin/MathUtils.d.ts +312 -0
  43. package/bin/MathUtils.d.ts.map +1 -0
  44. package/bin/MathUtils.js +500 -0
  45. package/bin/MathUtils.js.map +1 -0
  46. package/bin/Matrix3.d.ts +288 -0
  47. package/bin/Matrix3.d.ts.map +1 -0
  48. package/bin/Matrix3.js +542 -0
  49. package/bin/Matrix3.js.map +1 -0
  50. package/bin/Rectangle.d.ts +266 -0
  51. package/bin/Rectangle.d.ts.map +1 -0
  52. package/bin/Rectangle.js +437 -0
  53. package/bin/Rectangle.js.map +1 -0
  54. package/bin/Vector2.d.ts +333 -0
  55. package/bin/Vector2.d.ts.map +1 -0
  56. package/bin/Vector2.js +484 -0
  57. package/bin/Vector2.js.map +1 -0
  58. package/bin/Vector3.d.ts +257 -0
  59. package/bin/Vector3.d.ts.map +1 -0
  60. package/bin/Vector3.js +372 -0
  61. package/bin/Vector3.js.map +1 -0
  62. package/bin/index.d.ts +25 -0
  63. package/bin/index.d.ts.map +1 -0
  64. package/bin/index.js +32 -0
  65. package/bin/index.js.map +1 -0
  66. package/bin/nodes/ColorNodes.d.ts +70 -0
  67. package/bin/nodes/ColorNodes.d.ts.map +1 -0
  68. package/bin/nodes/ColorNodes.js +427 -0
  69. package/bin/nodes/ColorNodes.js.map +1 -0
  70. package/bin/nodes/FixedNodes.d.ts +98 -0
  71. package/bin/nodes/FixedNodes.d.ts.map +1 -0
  72. package/bin/nodes/FixedNodes.js +612 -0
  73. package/bin/nodes/FixedNodes.js.map +1 -0
  74. package/bin/nodes/FixedVectorNodes.d.ts +58 -0
  75. package/bin/nodes/FixedVectorNodes.d.ts.map +1 -0
  76. package/bin/nodes/FixedVectorNodes.js +330 -0
  77. package/bin/nodes/FixedVectorNodes.js.map +1 -0
  78. package/bin/nodes/VectorNodes.d.ts +62 -0
  79. package/bin/nodes/VectorNodes.d.ts.map +1 -0
  80. package/bin/nodes/VectorNodes.js +355 -0
  81. package/bin/nodes/VectorNodes.js.map +1 -0
  82. package/bin/nodes/index.d.ts +20 -0
  83. package/bin/nodes/index.d.ts.map +1 -0
  84. package/bin/nodes/index.js +27 -0
  85. package/bin/nodes/index.js.map +1 -0
  86. package/package.json +45 -26
  87. package/index.cjs +0 -2
  88. package/index.cjs.map +0 -1
  89. package/index.d.ts +0 -1968
  90. package/index.mjs +0 -2
  91. package/index.mjs.map +0 -1
  92. package/index.umd.js +0 -2
  93. package/index.umd.js.map +0 -1
@@ -0,0 +1,355 @@
1
+ /**
2
+ * @zh Vector2 蓝图节点
3
+ * @en Vector2 Blueprint Nodes
4
+ */
5
+ import { Vector2 } from '../Vector2';
6
+ // Make Vector2
7
+ export const MakeVector2Template = {
8
+ type: 'MakeVector2',
9
+ title: 'Make Vector2',
10
+ category: 'math',
11
+ description: 'Creates a Vector2 from X and Y',
12
+ keywords: ['make', 'create', 'vector', 'vector2'],
13
+ menuPath: ['Math', 'Vector', 'Make Vector2'],
14
+ isPure: true,
15
+ inputs: [
16
+ { name: 'x', displayName: 'X', type: 'float', defaultValue: 0 },
17
+ { name: 'y', displayName: 'Y', type: 'float', defaultValue: 0 }
18
+ ],
19
+ outputs: [
20
+ { name: 'vector', displayName: 'Vector', type: 'vector2' }
21
+ ],
22
+ color: '#2196F3'
23
+ };
24
+ export class MakeVector2Executor {
25
+ execute(node, context) {
26
+ const ctx = context;
27
+ const x = Number(ctx.evaluateInput(node.id, 'x', 0));
28
+ const y = Number(ctx.evaluateInput(node.id, 'y', 0));
29
+ return { outputs: { vector: new Vector2(x, y) } };
30
+ }
31
+ }
32
+ // Break Vector2
33
+ export const BreakVector2Template = {
34
+ type: 'BreakVector2',
35
+ title: 'Break Vector2',
36
+ category: 'math',
37
+ description: 'Breaks a Vector2 into X and Y',
38
+ keywords: ['break', 'split', 'vector', 'vector2'],
39
+ menuPath: ['Math', 'Vector', 'Break Vector2'],
40
+ isPure: true,
41
+ inputs: [
42
+ { name: 'vector', displayName: 'Vector', type: 'vector2' }
43
+ ],
44
+ outputs: [
45
+ { name: 'x', displayName: 'X', type: 'float' },
46
+ { name: 'y', displayName: 'Y', type: 'float' }
47
+ ],
48
+ color: '#2196F3'
49
+ };
50
+ export class BreakVector2Executor {
51
+ execute(node, context) {
52
+ const ctx = context;
53
+ const vector = ctx.evaluateInput(node.id, 'vector', Vector2.ZERO);
54
+ return { outputs: { x: vector?.x ?? 0, y: vector?.y ?? 0 } };
55
+ }
56
+ }
57
+ // Vector2 Add
58
+ export const Vector2AddTemplate = {
59
+ type: 'Vector2Add',
60
+ title: 'Vector2 +',
61
+ category: 'math',
62
+ description: 'Adds two vectors',
63
+ keywords: ['add', 'plus', 'vector'],
64
+ menuPath: ['Math', 'Vector', 'Add'],
65
+ isPure: true,
66
+ inputs: [
67
+ { name: 'a', displayName: 'A', type: 'vector2' },
68
+ { name: 'b', displayName: 'B', type: 'vector2' }
69
+ ],
70
+ outputs: [
71
+ { name: 'result', displayName: 'Result', type: 'vector2' }
72
+ ],
73
+ color: '#2196F3'
74
+ };
75
+ export class Vector2AddExecutor {
76
+ execute(node, context) {
77
+ const ctx = context;
78
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
79
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
80
+ return { outputs: { result: Vector2.add(a ?? Vector2.ZERO, b ?? Vector2.ZERO) } };
81
+ }
82
+ }
83
+ // Vector2 Subtract
84
+ export const Vector2SubtractTemplate = {
85
+ type: 'Vector2Subtract',
86
+ title: 'Vector2 -',
87
+ category: 'math',
88
+ description: 'Subtracts B from A',
89
+ keywords: ['subtract', 'minus', 'vector'],
90
+ menuPath: ['Math', 'Vector', 'Subtract'],
91
+ isPure: true,
92
+ inputs: [
93
+ { name: 'a', displayName: 'A', type: 'vector2' },
94
+ { name: 'b', displayName: 'B', type: 'vector2' }
95
+ ],
96
+ outputs: [
97
+ { name: 'result', displayName: 'Result', type: 'vector2' }
98
+ ],
99
+ color: '#2196F3'
100
+ };
101
+ export class Vector2SubtractExecutor {
102
+ execute(node, context) {
103
+ const ctx = context;
104
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
105
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
106
+ return { outputs: { result: Vector2.subtract(a ?? Vector2.ZERO, b ?? Vector2.ZERO) } };
107
+ }
108
+ }
109
+ // Vector2 Scale
110
+ export const Vector2ScaleTemplate = {
111
+ type: 'Vector2Scale',
112
+ title: 'Vector2 *',
113
+ category: 'math',
114
+ description: 'Scales a vector by a scalar',
115
+ keywords: ['scale', 'multiply', 'vector'],
116
+ menuPath: ['Math', 'Vector', 'Scale'],
117
+ isPure: true,
118
+ inputs: [
119
+ { name: 'vector', displayName: 'Vector', type: 'vector2' },
120
+ { name: 'scalar', displayName: 'Scalar', type: 'float', defaultValue: 1 }
121
+ ],
122
+ outputs: [
123
+ { name: 'result', displayName: 'Result', type: 'vector2' }
124
+ ],
125
+ color: '#2196F3'
126
+ };
127
+ export class Vector2ScaleExecutor {
128
+ execute(node, context) {
129
+ const ctx = context;
130
+ const vector = ctx.evaluateInput(node.id, 'vector', Vector2.ZERO);
131
+ const scalar = Number(ctx.evaluateInput(node.id, 'scalar', 1));
132
+ return { outputs: { result: Vector2.multiply(vector ?? Vector2.ZERO, scalar) } };
133
+ }
134
+ }
135
+ // Vector2 Length
136
+ export const Vector2LengthTemplate = {
137
+ type: 'Vector2Length',
138
+ title: 'Vector2 Length',
139
+ category: 'math',
140
+ description: 'Gets the length of a vector',
141
+ keywords: ['length', 'magnitude', 'vector'],
142
+ menuPath: ['Math', 'Vector', 'Length'],
143
+ isPure: true,
144
+ inputs: [
145
+ { name: 'vector', displayName: 'Vector', type: 'vector2' }
146
+ ],
147
+ outputs: [
148
+ { name: 'length', displayName: 'Length', type: 'float' }
149
+ ],
150
+ color: '#2196F3'
151
+ };
152
+ export class Vector2LengthExecutor {
153
+ execute(node, context) {
154
+ const ctx = context;
155
+ const vector = ctx.evaluateInput(node.id, 'vector', Vector2.ZERO);
156
+ return { outputs: { length: (vector ?? Vector2.ZERO).length } };
157
+ }
158
+ }
159
+ // Vector2 Normalize
160
+ export const Vector2NormalizeTemplate = {
161
+ type: 'Vector2Normalize',
162
+ title: 'Vector2 Normalize',
163
+ category: 'math',
164
+ description: 'Normalizes a vector to unit length',
165
+ keywords: ['normalize', 'unit', 'vector'],
166
+ menuPath: ['Math', 'Vector', 'Normalize'],
167
+ isPure: true,
168
+ inputs: [
169
+ { name: 'vector', displayName: 'Vector', type: 'vector2' }
170
+ ],
171
+ outputs: [
172
+ { name: 'result', displayName: 'Result', type: 'vector2' }
173
+ ],
174
+ color: '#2196F3'
175
+ };
176
+ export class Vector2NormalizeExecutor {
177
+ execute(node, context) {
178
+ const ctx = context;
179
+ const vector = ctx.evaluateInput(node.id, 'vector', Vector2.ZERO);
180
+ return { outputs: { result: (vector ?? Vector2.ZERO).normalized() } };
181
+ }
182
+ }
183
+ // Vector2 Dot
184
+ export const Vector2DotTemplate = {
185
+ type: 'Vector2Dot',
186
+ title: 'Vector2 Dot',
187
+ category: 'math',
188
+ description: 'Calculates dot product',
189
+ keywords: ['dot', 'product', 'vector'],
190
+ menuPath: ['Math', 'Vector', 'Dot Product'],
191
+ isPure: true,
192
+ inputs: [
193
+ { name: 'a', displayName: 'A', type: 'vector2' },
194
+ { name: 'b', displayName: 'B', type: 'vector2' }
195
+ ],
196
+ outputs: [
197
+ { name: 'result', displayName: 'Result', type: 'float' }
198
+ ],
199
+ color: '#2196F3'
200
+ };
201
+ export class Vector2DotExecutor {
202
+ execute(node, context) {
203
+ const ctx = context;
204
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
205
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
206
+ return { outputs: { result: Vector2.dot(a ?? Vector2.ZERO, b ?? Vector2.ZERO) } };
207
+ }
208
+ }
209
+ // Vector2 Cross
210
+ export const Vector2CrossTemplate = {
211
+ type: 'Vector2Cross',
212
+ title: 'Vector2 Cross',
213
+ category: 'math',
214
+ description: '2D cross product (returns scalar)',
215
+ keywords: ['cross', 'product', 'vector'],
216
+ menuPath: ['Math', 'Vector', 'Cross Product'],
217
+ isPure: true,
218
+ inputs: [
219
+ { name: 'a', displayName: 'A', type: 'vector2' },
220
+ { name: 'b', displayName: 'B', type: 'vector2' }
221
+ ],
222
+ outputs: [
223
+ { name: 'result', displayName: 'Result', type: 'float' }
224
+ ],
225
+ color: '#2196F3'
226
+ };
227
+ export class Vector2CrossExecutor {
228
+ execute(node, context) {
229
+ const ctx = context;
230
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
231
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
232
+ return { outputs: { result: Vector2.cross(a ?? Vector2.ZERO, b ?? Vector2.ZERO) } };
233
+ }
234
+ }
235
+ // Vector2 Distance
236
+ export const Vector2DistanceTemplate = {
237
+ type: 'Vector2Distance',
238
+ title: 'Vector2 Distance',
239
+ category: 'math',
240
+ description: 'Distance between two points',
241
+ keywords: ['distance', 'length', 'vector'],
242
+ menuPath: ['Math', 'Vector', 'Distance'],
243
+ isPure: true,
244
+ inputs: [
245
+ { name: 'a', displayName: 'A', type: 'vector2' },
246
+ { name: 'b', displayName: 'B', type: 'vector2' }
247
+ ],
248
+ outputs: [
249
+ { name: 'distance', displayName: 'Distance', type: 'float' }
250
+ ],
251
+ color: '#2196F3'
252
+ };
253
+ export class Vector2DistanceExecutor {
254
+ execute(node, context) {
255
+ const ctx = context;
256
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
257
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
258
+ return { outputs: { distance: Vector2.distance(a ?? Vector2.ZERO, b ?? Vector2.ZERO) } };
259
+ }
260
+ }
261
+ // Vector2 Lerp
262
+ export const Vector2LerpTemplate = {
263
+ type: 'Vector2Lerp',
264
+ title: 'Vector2 Lerp',
265
+ category: 'math',
266
+ description: 'Linear interpolation between two vectors',
267
+ keywords: ['lerp', 'interpolate', 'vector'],
268
+ menuPath: ['Math', 'Vector', 'Lerp'],
269
+ isPure: true,
270
+ inputs: [
271
+ { name: 'a', displayName: 'A', type: 'vector2' },
272
+ { name: 'b', displayName: 'B', type: 'vector2' },
273
+ { name: 't', displayName: 'T', type: 'float', defaultValue: 0.5 }
274
+ ],
275
+ outputs: [
276
+ { name: 'result', displayName: 'Result', type: 'vector2' }
277
+ ],
278
+ color: '#2196F3'
279
+ };
280
+ export class Vector2LerpExecutor {
281
+ execute(node, context) {
282
+ const ctx = context;
283
+ const a = ctx.evaluateInput(node.id, 'a', Vector2.ZERO);
284
+ const b = ctx.evaluateInput(node.id, 'b', Vector2.ZERO);
285
+ const t = Number(ctx.evaluateInput(node.id, 't', 0.5));
286
+ return { outputs: { result: Vector2.lerp(a ?? Vector2.ZERO, b ?? Vector2.ZERO, t) } };
287
+ }
288
+ }
289
+ // Vector2 Rotate
290
+ export const Vector2RotateTemplate = {
291
+ type: 'Vector2Rotate',
292
+ title: 'Vector2 Rotate',
293
+ category: 'math',
294
+ description: 'Rotates a vector by angle (radians)',
295
+ keywords: ['rotate', 'turn', 'vector'],
296
+ menuPath: ['Math', 'Vector', 'Rotate'],
297
+ isPure: true,
298
+ inputs: [
299
+ { name: 'vector', displayName: 'Vector', type: 'vector2' },
300
+ { name: 'angle', displayName: 'Angle (rad)', type: 'float', defaultValue: 0 }
301
+ ],
302
+ outputs: [
303
+ { name: 'result', displayName: 'Result', type: 'vector2' }
304
+ ],
305
+ color: '#2196F3'
306
+ };
307
+ export class Vector2RotateExecutor {
308
+ execute(node, context) {
309
+ const ctx = context;
310
+ const vector = ctx.evaluateInput(node.id, 'vector', Vector2.ZERO);
311
+ const angle = Number(ctx.evaluateInput(node.id, 'angle', 0));
312
+ return { outputs: { result: (vector ?? Vector2.ZERO).rotated(angle) } };
313
+ }
314
+ }
315
+ // Vector2 From Angle
316
+ export const Vector2FromAngleTemplate = {
317
+ type: 'Vector2FromAngle',
318
+ title: 'Vector2 From Angle',
319
+ category: 'math',
320
+ description: 'Creates unit vector from angle (radians)',
321
+ keywords: ['from', 'angle', 'direction', 'vector'],
322
+ menuPath: ['Math', 'Vector', 'From Angle'],
323
+ isPure: true,
324
+ inputs: [
325
+ { name: 'angle', displayName: 'Angle (rad)', type: 'float', defaultValue: 0 }
326
+ ],
327
+ outputs: [
328
+ { name: 'vector', displayName: 'Vector', type: 'vector2' }
329
+ ],
330
+ color: '#2196F3'
331
+ };
332
+ export class Vector2FromAngleExecutor {
333
+ execute(node, context) {
334
+ const ctx = context;
335
+ const angle = Number(ctx.evaluateInput(node.id, 'angle', 0));
336
+ return { outputs: { vector: Vector2.fromAngle(angle) } };
337
+ }
338
+ }
339
+ // Node definitions collection
340
+ export const VectorNodeDefinitions = [
341
+ { template: MakeVector2Template, executor: new MakeVector2Executor() },
342
+ { template: BreakVector2Template, executor: new BreakVector2Executor() },
343
+ { template: Vector2AddTemplate, executor: new Vector2AddExecutor() },
344
+ { template: Vector2SubtractTemplate, executor: new Vector2SubtractExecutor() },
345
+ { template: Vector2ScaleTemplate, executor: new Vector2ScaleExecutor() },
346
+ { template: Vector2LengthTemplate, executor: new Vector2LengthExecutor() },
347
+ { template: Vector2NormalizeTemplate, executor: new Vector2NormalizeExecutor() },
348
+ { template: Vector2DotTemplate, executor: new Vector2DotExecutor() },
349
+ { template: Vector2CrossTemplate, executor: new Vector2CrossExecutor() },
350
+ { template: Vector2DistanceTemplate, executor: new Vector2DistanceExecutor() },
351
+ { template: Vector2LerpTemplate, executor: new Vector2LerpExecutor() },
352
+ { template: Vector2RotateTemplate, executor: new Vector2RotateExecutor() },
353
+ { template: Vector2FromAngleTemplate, executor: new Vector2FromAngleExecutor() }
354
+ ];
355
+ //# sourceMappingURL=VectorNodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VectorNodes.js","sourceRoot":"","sources":["../../src/nodes/VectorNodes.ts"],"names":[],"mappings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E;IACxE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,kBAAkB,EAAE,EAAE;IACpE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,uBAAuB,EAAE,EAAE;IAC9E,EAAE,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,oBAAoB,EAAE,EAAE;IACxE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,qBAAqB,EAAE,EAAE;IAC1E,EAAE,QAAQ,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,wBAAwB,EAAE,EAAE;IAChF,EAAE,QAAQ,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,kBAAkB,EAAE,EAAE;IACpE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,EAAE,IAAI,oBAAoB,EAAE,EAAE;IACxE,EAAE,QAAQ,EAAE,uBAAuB,EAAE,QAAQ,EAAE,IAAI,uBAAuB,EAAE,EAAE;IAC9E,EAAE,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,mBAAmB,EAAE,EAAE;IACtE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,QAAQ,EAAE,IAAI,qBAAqB,EAAE,EAAE;IAC1E,EAAE,QAAQ,EAAE,wBAAwB,EAAE,QAAQ,EAAE,IAAI,wBAAwB,EAAE,EAAE;CACnF,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @zh 数学库蓝图节点
3
+ * @en Math Library Blueprint Nodes
4
+ *
5
+ * @zh 导出所有数学相关的蓝图节点
6
+ * @en Exports all math-related blueprint nodes
7
+ */
8
+ export * from './VectorNodes';
9
+ export * from './FixedNodes';
10
+ export * from './FixedVectorNodes';
11
+ export * from './ColorNodes';
12
+ /**
13
+ * @zh 所有数学库蓝图节点定义
14
+ * @en All math library blueprint node definitions
15
+ */
16
+ export declare const MathNodeDefinitions: {
17
+ template: import("@esengine/blueprint").BlueprintNodeTemplate;
18
+ executor: import("./VectorNodes").MakeVector2Executor;
19
+ }[];
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAQ7B;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;GAK/B,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @zh 数学库蓝图节点
3
+ * @en Math Library Blueprint Nodes
4
+ *
5
+ * @zh 导出所有数学相关的蓝图节点
6
+ * @en Exports all math-related blueprint nodes
7
+ */
8
+ export * from './VectorNodes';
9
+ export * from './FixedNodes';
10
+ export * from './FixedVectorNodes';
11
+ export * from './ColorNodes';
12
+ // Re-export node definition collections
13
+ import { VectorNodeDefinitions } from './VectorNodes';
14
+ import { FixedNodeDefinitions } from './FixedNodes';
15
+ import { FixedVectorNodeDefinitions } from './FixedVectorNodes';
16
+ import { ColorNodeDefinitions } from './ColorNodes';
17
+ /**
18
+ * @zh 所有数学库蓝图节点定义
19
+ * @en All math library blueprint node definitions
20
+ */
21
+ export const MathNodeDefinitions = [
22
+ ...VectorNodeDefinitions,
23
+ ...FixedNodeDefinitions,
24
+ ...FixedVectorNodeDefinitions,
25
+ ...ColorNodeDefinitions
26
+ ];
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodes/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAE7B,wCAAwC;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,GAAG,qBAAqB;IACxB,GAAG,oBAAoB;IACvB,GAAG,0BAA0B;IAC7B,GAAG,oBAAoB;CAC1B,CAAC"}
package/package.json CHANGED
@@ -1,26 +1,11 @@
1
1
  {
2
2
  "name": "@esengine/ecs-framework-math",
3
- "version": "1.0.5",
3
+ "version": "2.9.0",
4
4
  "description": "ECS框架2D数学库 - 提供向量、矩阵、几何形状和碰撞检测功能",
5
- "main": "index.cjs",
6
- "module": "index.mjs",
7
- "unpkg": "index.umd.js",
8
- "types": "index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./index.mjs",
12
- "require": "./index.cjs",
13
- "types": "./index.d.ts"
14
- }
15
- },
5
+ "main": "bin/index.js",
6
+ "types": "bin/index.d.ts",
16
7
  "files": [
17
- "index.mjs",
18
- "index.mjs.map",
19
- "index.cjs",
20
- "index.cjs.map",
21
- "index.umd.js",
22
- "index.umd.js.map",
23
- "index.d.ts",
8
+ "bin/**/*",
24
9
  "README.md",
25
10
  "LICENSE"
26
11
  ],
@@ -33,18 +18,52 @@
33
18
  "geometry",
34
19
  "collision",
35
20
  "game-engine",
36
- "typescript",
37
- "rollup"
21
+ "typescript"
38
22
  ],
39
23
  "author": "yhh",
40
24
  "license": "MIT",
25
+ "dependencies": {
26
+ "@esengine/blueprint": "4.4.0"
27
+ },
28
+ "devDependencies": {
29
+ "@rollup/plugin-commonjs": "^28.0.3",
30
+ "@rollup/plugin-node-resolve": "^16.0.1",
31
+ "@rollup/plugin-terser": "^0.4.4",
32
+ "@types/jest": "^29.5.14",
33
+ "@types/node": "^20.19.0",
34
+ "jest": "^29.7.0",
35
+ "jest-environment-jsdom": "^29.7.0",
36
+ "rimraf": "^5.0.0",
37
+ "rollup": "^4.42.0",
38
+ "rollup-plugin-dts": "^6.2.1",
39
+ "ts-jest": "^29.4.0",
40
+ "typescript": "^5.8.3"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "registry": "https://registry.npmjs.org/"
45
+ },
41
46
  "repository": {
42
47
  "type": "git",
43
- "url": "https://github.com/esengine/ecs-framework.git",
48
+ "url": "https://github.com/esengine/esengine.git",
44
49
  "directory": "packages/math"
45
50
  },
46
- "engines": {
47
- "node": ">=16.0.0"
48
- },
49
- "sideEffects": false
51
+ "scripts": {
52
+ "clean": "rimraf bin dist tsconfig.tsbuildinfo",
53
+ "build:ts": "tsc",
54
+ "prebuild": "npm run clean",
55
+ "build": "npm run build:ts && node build-rollup.cjs",
56
+ "build:watch": "tsc --watch",
57
+ "rebuild": "npm run clean && npm run build",
58
+ "build:npm": "npm run build",
59
+ "publish:npm": "npm run build:npm && cd dist && npm publish",
60
+ "test": "jest --config jest.config.cjs",
61
+ "test:watch": "jest --watch --config jest.config.cjs",
62
+ "test:coverage": "jest --coverage --config jest.config.cjs",
63
+ "test:ci": "jest --ci --coverage --config jest.config.cjs",
64
+ "test:clear": "jest --clearCache",
65
+ "publish:patch": "npm version patch && npm run build:npm && cd dist && npm publish",
66
+ "publish:minor": "npm version minor && npm run build:npm && cd dist && npm publish",
67
+ "publish:major": "npm version major && npm run build:npm && cd dist && npm publish"
68
+ }
50
69
  }
package/index.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";class t{constructor(t=0,e=0){this.x=t,this.y=e}get length(){return Math.sqrt(this.x*this.x+this.y*this.y)}get lengthSquared(){return this.x*this.x+this.y*this.y}get angle(){return Math.atan2(this.y,this.x)}get isZero(){return 0===this.x&&0===this.y}get isUnit(){const t=this.lengthSquared;return Math.abs(t-1)<Number.EPSILON}set(t,e){return this.x=t,this.y=e,this}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new t(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){return this.x*=t,this.y*=t,this}divide(t){if(0===t)throw new Error("不能除以零");return this.x/=t,this.y/=t,this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}normalize(){const t=this.length;return 0===t?this:this.divide(t)}normalized(){return this.clone().normalize()}distanceTo(t){const e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}distanceToSquared(t){const e=this.x-t.x,r=this.y-t.y;return e*e+r*r}angleTo(t){const e=this.dot(t),r=this.length*t.length;return 0===r?0:Math.acos(Math.max(-1,Math.min(1,e/r)))}projectOnto(e){const r=this.dot(e),i=e.lengthSquared;return 0===i?new t:e.clone().multiply(r/i)}projectOntoLength(t){const e=t.length;return 0===e?0:this.dot(t)/e}perpendicular(){return new t(-this.y,this.x)}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.x*e-this.y*r,s=this.x*r+this.y*e;return this.x=i,this.y=s,this}rotated(t){return this.clone().rotate(t)}rotateAround(t,e){return this.subtract(t).rotate(e).add(t)}reflect(t){const e=this.dot(t);return this.x-=2*e*t.x,this.y-=2*e*t.y,this}reflected(t){return this.clone().reflect(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}clampLength(t){return this.lengthSquared>t*t?this.normalize().multiply(t):this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}equals(t,e=Number.EPSILON){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e}exactEquals(t){return this.x===t.x&&this.y===t.y}static add(e,r){return new t(e.x+r.x,e.y+r.y)}static subtract(e,r){return new t(e.x-r.x,e.y-r.y)}static multiply(e,r){return new t(e.x*r,e.y*r)}static dot(t,e){return t.x*e.x+t.y*e.y}static cross(t,e){return t.x*e.y-t.y*e.x}static distance(t,e){const r=t.x-e.x,i=t.y-e.y;return Math.sqrt(r*r+i*i)}static lerp(e,r,i){return new t(e.x+(r.x-e.x)*i,e.y+(r.y-e.y)*i)}static fromAngle(e){return new t(Math.cos(e),Math.sin(e))}static fromPolar(e,r){return new t(e*Math.cos(r),e*Math.sin(r))}static min(e,r){return new t(Math.min(e.x,r.x),Math.min(e.y,r.y))}static max(e,r){return new t(Math.max(e.x,r.x),Math.max(e.y,r.y))}toString(){return`Vector2(${this.x.toFixed(3)}, ${this.y.toFixed(3)})`}toArray(){return[this.x,this.y]}toObject(){return{x:this.x,y:this.y}}}t.ZERO=new t(0,0),t.ONE=new t(1,1),t.RIGHT=new t(1,0),t.LEFT=new t(-1,0),t.UP=new t(0,1),t.DOWN=new t(0,-1);class e{constructor(t){this.elements=new Float32Array(9),t?this.elements.set(t):this.identity()}get(t,e){return this.elements[3*t+e]}set(t,e,r){return this.elements[3*t+e]=r,this}get m00(){return this.elements[0]}set m00(t){this.elements[0]=t}get m01(){return this.elements[1]}set m01(t){this.elements[1]=t}get m02(){return this.elements[2]}set m02(t){this.elements[2]=t}get m10(){return this.elements[3]}set m10(t){this.elements[3]=t}get m11(){return this.elements[4]}set m11(t){this.elements[4]=t}get m12(){return this.elements[5]}set m12(t){this.elements[5]=t}get m20(){return this.elements[6]}set m20(t){this.elements[6]=t}get m21(){return this.elements[7]}set m21(t){this.elements[7]=t}get m22(){return this.elements[8]}set m22(t){this.elements[8]=t}identity(){return this.elements.set([1,0,0,0,1,0,0,0,1]),this}zero(){return this.elements.fill(0),this}copy(t){return this.elements.set(t.elements),this}clone(){return new e(this.elements)}fromArray(t){return this.elements.set(t),this}add(t){for(let e=0;e<9;e++)this.elements[e]+=t.elements[e];return this}subtract(t){for(let e=0;e<9;e++)this.elements[e]-=t.elements[e];return this}multiplyScalar(t){for(let e=0;e<9;e++)this.elements[e]*=t;return this}multiply(t){const e=this.elements,r=t.elements,i=new Float32Array(9);return i[0]=e[0]*r[0]+e[1]*r[3]+e[2]*r[6],i[1]=e[0]*r[1]+e[1]*r[4]+e[2]*r[7],i[2]=e[0]*r[2]+e[1]*r[5]+e[2]*r[8],i[3]=e[3]*r[0]+e[4]*r[3]+e[5]*r[6],i[4]=e[3]*r[1]+e[4]*r[4]+e[5]*r[7],i[5]=e[3]*r[2]+e[4]*r[5]+e[5]*r[8],i[6]=e[6]*r[0]+e[7]*r[3]+e[8]*r[6],i[7]=e[6]*r[1]+e[7]*r[4]+e[8]*r[7],i[8]=e[6]*r[2]+e[7]*r[5]+e[8]*r[8],this.elements.set(i),this}premultiply(t){const e=t.elements,r=this.elements,i=new Float32Array(9);return i[0]=e[0]*r[0]+e[1]*r[3]+e[2]*r[6],i[1]=e[0]*r[1]+e[1]*r[4]+e[2]*r[7],i[2]=e[0]*r[2]+e[1]*r[5]+e[2]*r[8],i[3]=e[3]*r[0]+e[4]*r[3]+e[5]*r[6],i[4]=e[3]*r[1]+e[4]*r[4]+e[5]*r[7],i[5]=e[3]*r[2]+e[4]*r[5]+e[5]*r[8],i[6]=e[6]*r[0]+e[7]*r[3]+e[8]*r[6],i[7]=e[6]*r[1]+e[7]*r[4]+e[8]*r[7],i[8]=e[6]*r[2]+e[7]*r[5]+e[8]*r[8],this.elements.set(i),this}makeTranslation(t,e){return this.elements.set([1,0,t,0,1,e,0,0,1]),this}makeRotation(t){const e=Math.cos(t),r=Math.sin(t);return this.elements.set([e,-r,0,r,e,0,0,0,1]),this}makeScale(t,e){return this.elements.set([t,0,0,0,e,0,0,0,1]),this}translate(t,e){return this.m02+=this.m00*t+this.m01*e,this.m12+=this.m10*t+this.m11*e,this}rotate(t){const e=Math.cos(t),r=Math.sin(t),i=this.m00*e+this.m01*r,s=this.m00*-r+this.m01*e,n=this.m10*e+this.m11*r,h=this.m10*-r+this.m11*e;return this.m00=i,this.m01=s,this.m10=n,this.m11=h,this}scale(t,e){return this.m00*=t,this.m01*=e,this.m10*=t,this.m11*=e,this}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}determinant(){const t=this.elements;return t[0]*(t[4]*t[8]-t[5]*t[7])-t[1]*(t[3]*t[8]-t[5]*t[6])+t[2]*(t[3]*t[7]-t[4]*t[6])}invert(){const t=this.elements,e=this.determinant();if(Math.abs(e)<Number.EPSILON)return console.warn("Matrix3: 矩阵不可逆"),this;const r=1/e,i=new Float32Array(9);return i[0]=(t[4]*t[8]-t[5]*t[7])*r,i[1]=(t[2]*t[7]-t[1]*t[8])*r,i[2]=(t[1]*t[5]-t[2]*t[4])*r,i[3]=(t[5]*t[6]-t[3]*t[8])*r,i[4]=(t[0]*t[8]-t[2]*t[6])*r,i[5]=(t[2]*t[3]-t[0]*t[5])*r,i[6]=(t[3]*t[7]-t[4]*t[6])*r,i[7]=(t[1]*t[6]-t[0]*t[7])*r,i[8]=(t[0]*t[4]-t[1]*t[3])*r,this.elements.set(i),this}transformVector(e){const r=e.x,i=e.y,s=this.m20*r+this.m21*i+this.m22;return new t((this.m00*r+this.m01*i+this.m02)/s,(this.m10*r+this.m11*i+this.m12)/s)}transformDirection(e){return new t(this.m00*e.x+this.m01*e.y,this.m10*e.x+this.m11*e.y)}transformVectors(t){return t.map((t=>this.transformVector(t)))}getTranslation(){return new t(this.m02,this.m12)}getRotation(){return Math.atan2(this.m10,this.m00)}getScale(){const e=Math.sqrt(this.m00*this.m00+this.m10*this.m10),r=Math.sqrt(this.m01*this.m01+this.m11*this.m11),i=this.determinant();return new t(i<0?-e:e,r)}decompose(){return{translation:this.getTranslation(),rotation:this.getRotation(),scale:this.getScale()}}equals(t,e=Number.EPSILON){for(let r=0;r<9;r++)if(Math.abs(this.elements[r]-t.elements[r])>=e)return!1;return!0}exactEquals(t){for(let e=0;e<9;e++)if(this.elements[e]!==t.elements[e])return!1;return!0}isIdentity(t=Number.EPSILON){return this.equals(e.IDENTITY,t)}static multiply(t,e){return t.clone().multiply(e)}static translation(t,r){return(new e).makeTranslation(t,r)}static rotation(t){return(new e).makeRotation(t)}static scale(t,r){return(new e).makeScale(t,r)}static TRS(t,r,i){const s=Math.cos(r),n=Math.sin(r);return new e([i.x*s,-i.y*n,t.x,i.x*n,i.y*s,t.y,0,0,1])}toString(){const t=this.elements;return`Matrix3(\n ${t[0].toFixed(3)}, ${t[1].toFixed(3)}, ${t[2].toFixed(3)}\n ${t[3].toFixed(3)}, ${t[4].toFixed(3)}, ${t[5].toFixed(3)}\n ${t[6].toFixed(3)}, ${t[7].toFixed(3)}, ${t[8].toFixed(3)}\n)`}toArray(){return Array.from(this.elements)}toCSSTransform(){const t=this.elements;return`matrix(${t[0]}, ${t[3]}, ${t[1]}, ${t[4]}, ${t[2]}, ${t[5]})`}}e.IDENTITY=new e([1,0,0,0,1,0,0,0,1]),e.ZERO=new e([0,0,0,0,0,0,0,0,0]);class r{constructor(t=0,e=0,r=0,i=0){this.x=t,this.y=e,this.width=r,this.height=i}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}get centerX(){return this.x+.5*this.width}get centerY(){return this.y+.5*this.height}get center(){return new t(this.centerX,this.centerY)}get topLeft(){return new t(this.x,this.y)}get topRight(){return new t(this.right,this.y)}get bottomLeft(){return new t(this.x,this.bottom)}get bottomRight(){return new t(this.right,this.bottom)}get area(){return this.width*this.height}get perimeter(){return 2*(this.width+this.height)}get isEmpty(){return this.width<=0||this.height<=0}get isSquare(){return this.width===this.height&&this.width>0}set(t,e,r,i){return this.x=t,this.y=e,this.width=r,this.height=i,this}copy(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}clone(){return new r(this.x,this.y,this.width,this.height)}setPosition(t,e){return this.x=t,this.y=e,this}setSize(t,e){return this.width=t,this.height=e,this}setCenter(t,e){return this.x=t-.5*this.width,this.y=e-.5*this.height,this}translate(t,e){return this.x+=t,this.y+=e,this}scale(t,e=t){const r=this.centerX,i=this.centerY;return this.width*=t,this.height*=e,this.setCenter(r,i)}inflate(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this}inflateXY(t,e){return this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this}containsPoint(t){return t.x>=this.x&&t.x<=this.right&&t.y>=this.y&&t.y<=this.bottom}contains(t,e){return t>=this.x&&t<=this.right&&e>=this.y&&e<=this.bottom}containsRect(t){return this.x<=t.x&&this.y<=t.y&&this.right>=t.right&&this.bottom>=t.bottom}intersects(t){return this.x<t.right&&this.right>t.x&&this.y<t.bottom&&this.bottom>t.y}intersection(t){if(!this.intersects(t))return r.EMPTY.clone();const e=Math.max(this.x,t.x),i=Math.max(this.y,t.y),s=Math.min(this.right,t.right),n=Math.min(this.bottom,t.bottom);return new r(e,i,s-e,n-i)}union(t){const e=Math.min(this.x,t.x),i=Math.min(this.y,t.y),s=Math.max(this.right,t.right),n=Math.max(this.bottom,t.bottom);return new r(e,i,s-e,n-i)}intersectionArea(t){const e=this.intersection(t);return e.isEmpty?0:e.area}distanceToPoint(t){const e=Math.max(0,Math.max(this.x-t.x,t.x-this.right)),r=Math.max(0,Math.max(this.y-t.y,t.y-this.bottom));return Math.sqrt(e*e+r*r)}distanceToRect(t){if(this.intersects(t))return 0;const e=Math.max(0,Math.max(this.x-t.right,t.x-this.right)),r=Math.max(0,Math.max(this.y-t.bottom,t.y-this.bottom));return Math.sqrt(e*e+r*r)}closestPointTo(e){return new t(Math.max(this.x,Math.min(this.right,e.x)),Math.max(this.y,Math.min(this.bottom,e.y)))}equals(t,e=Number.EPSILON){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e&&Math.abs(this.width-t.width)<e&&Math.abs(this.height-t.height)<e}exactEquals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}static fromCenter(t,e,i,s){return new r(t-.5*i,e-.5*s,i,s)}static fromPoints(t,e){const i=Math.min(t.x,e.x),s=Math.min(t.y,e.y),n=Math.abs(e.x-t.x),h=Math.abs(e.y-t.y);return new r(i,s,n,h)}static fromPointArray(t){if(0===t.length)return r.EMPTY.clone();let e=t[0].x,i=t[0].y,s=t[0].x,n=t[0].y;for(let r=1;r<t.length;r++)e=Math.min(e,t[r].x),i=Math.min(i,t[r].y),s=Math.max(s,t[r].x),n=Math.max(n,t[r].y);return new r(e,i,s-e,n-i)}static square(t,e,i){return new r(t,e,i,i)}static lerp(t,e,i){return new r(t.x+(e.x-t.x)*i,t.y+(e.y-t.y)*i,t.width+(e.width-t.width)*i,t.height+(e.height-t.height)*i)}toString(){return`Rectangle(${this.x.toFixed(2)}, ${this.y.toFixed(2)}, ${this.width.toFixed(2)}, ${this.height.toFixed(2)})`}toArray(){return[this.x,this.y,this.width,this.height]}toObject(){return{x:this.x,y:this.y,width:this.width,height:this.height}}getVertices(){return[this.topLeft,this.topRight,this.bottomRight,this.bottomLeft]}}r.EMPTY=new r(0,0,0,0);class i{constructor(t=0,e=0,r=0){this.x=t,this.y=e,this.radius=r}get center(){return new t(this.x,this.y)}set center(t){this.x=t.x,this.y=t.y}get diameter(){return 2*this.radius}set diameter(t){this.radius=.5*t}get area(){return Math.PI*this.radius*this.radius}get circumference(){return 2*Math.PI*this.radius}get bounds(){return new r(this.x-this.radius,this.y-this.radius,this.diameter,this.diameter)}get isEmpty(){return this.radius<=0}set(t,e,r){return this.x=t,this.y=e,this.radius=r,this}copy(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}clone(){return new i(this.x,this.y,this.radius)}setPosition(t,e){return this.x=t,this.y=e,this}setCenter(t){return this.x=t.x,this.y=t.y,this}setRadius(t){return this.radius=t,this}translate(t,e){return this.x+=t,this.y+=e,this}translateBy(t){return this.x+=t.x,this.y+=t.y,this}scale(t){return this.radius*=t,this}inflate(t){return this.radius+=t,this}containsPoint(t){const e=t.x-this.x,r=t.y-this.y;return e*e+r*r<=this.radius*this.radius}contains(t,e){const r=t-this.x,i=e-this.y;return r*r+i*i<=this.radius*this.radius}containsCircle(t){return this.distanceToCircle(t)+t.radius<=this.radius}pointOnBoundary(t,e=Number.EPSILON){const r=this.distanceToPoint(t);return Math.abs(r-this.radius)<e}intersects(t){const e=this.x-t.x,r=this.y-t.y,i=e*e+r*r,s=this.radius+t.radius;return i<=s*s}intersectsRect(t){const e=Math.max(t.x,Math.min(this.x,t.right)),r=Math.max(t.y,Math.min(this.y,t.bottom)),i=this.x-e,s=this.y-r;return i*i+s*s<=this.radius*this.radius}intersectionArea(t){const e=this.distanceToCircle(t);if(e>=this.radius+t.radius)return 0;if(e<=Math.abs(this.radius-t.radius)){const e=Math.min(this.radius,t.radius);return Math.PI*e*e}const r=this.radius,i=t.radius;return r*r*Math.acos((e*e+r*r-i*i)/(2*e*r))+i*i*Math.acos((e*e+i*i-r*r)/(2*e*i))-.5*Math.sqrt((-e+r+i)*(e+r-i)*(e-r+i)*(e+r+i))}distanceToPoint(t){const e=t.x-this.x,r=t.y-this.y;return Math.sqrt(e*e+r*r)}distanceToPointFromBoundary(t){return this.distanceToPoint(t)-this.radius}distanceToCircle(t){const e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)}distanceToCircleFromBoundary(t){return this.distanceToCircle(t)-this.radius-t.radius}distanceToRect(t){return Math.max(0,t.distanceToPoint(this.center)-this.radius)}closestPointTo(e){const r=t.subtract(e,this.center);return r.isZero?new t(this.x+this.radius,this.y):this.center.clone().add(r.normalized().multiply(this.radius))}farthestPointFrom(e){const r=t.subtract(e,this.center);return r.isZero?new t(this.x-this.radius,this.y):this.center.clone().subtract(r.normalized().multiply(this.radius))}getPointAtAngle(e){return new t(this.x+this.radius*Math.cos(e),this.y+this.radius*Math.sin(e))}getAngleToPoint(t){return Math.atan2(t.y-this.y,t.x-this.x)}getLineIntersections(e,r){const i=r.x-e.x,s=r.y-e.y,n=e.x-this.x,h=e.y-this.y,a=i*i+s*s,o=2*(n*i+h*s),c=o*o-4*a*(n*n+h*h-this.radius*this.radius);if(c<0)return[];if(0===c){const r=-o/(2*a);return[new t(e.x+r*i,e.y+r*s)]}const u=Math.sqrt(c),l=(-o-u)/(2*a),m=(-o+u)/(2*a);return[new t(e.x+l*i,e.y+l*s),new t(e.x+m*i,e.y+m*s)]}equals(t,e=Number.EPSILON){return Math.abs(this.x-t.x)<e&&Math.abs(this.y-t.y)<e&&Math.abs(this.radius-t.radius)<e}exactEquals(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius}static fromDiameter(t,e,r){return new i(t,e,.5*r)}static fromThreePoints(t,e,r){const s=t.x,n=t.y,h=e.x,a=e.y,o=r.x,c=r.y,u=2*(s*(a-c)+h*(c-n)+o*(n-a));if(Math.abs(u)<Number.EPSILON)return null;const l=((s*s+n*n)*(a-c)+(h*h+a*a)*(c-n)+(o*o+c*c)*(n-a))/u,m=((s*s+n*n)*(o-h)+(h*h+a*a)*(s-o)+(o*o+c*c)*(h-s))/u,x=Math.sqrt((s-l)*(s-l)+(n-m)*(n-m));return new i(l,m,x)}static fromPointArray(e){if(0===e.length)return i.EMPTY.clone();if(1===e.length)return new i(e[0].x,e[0].y,0);let r=e[0].x,s=e[0].y,n=e[0].x,h=e[0].y;for(const t of e)r=Math.min(r,t.x),s=Math.min(s,t.y),n=Math.max(n,t.x),h=Math.max(h,t.y);const a=.5*(r+n),o=.5*(s+h),c=new t(a,o);let u=0;for(const r of e){const e=t.distance(c,r);u=Math.max(u,e)}return new i(a,o,u)}static lerp(t,e,r){return new i(t.x+(e.x-t.x)*r,t.y+(e.y-t.y)*r,t.radius+(e.radius-t.radius)*r)}toString(){return`Circle(${this.x.toFixed(2)}, ${this.y.toFixed(2)}, r=${this.radius.toFixed(2)})`}toArray(){return[this.x,this.y,this.radius]}toObject(){return{x:this.x,y:this.y,radius:this.radius}}}i.EMPTY=new i(0,0,0),i.UNIT=new i(0,0,1);class s{static degToRad(t){return t*s.DEG_TO_RAD}static radToDeg(t){return t*s.RAD_TO_DEG}static normalizeAngle(t){for(;t<0;)t+=s.TWO_PI;for(;t>=s.TWO_PI;)t-=s.TWO_PI;return t}static normalizeAngleSigned(t){for(;t<=-Math.PI;)t+=s.TWO_PI;for(;t>Math.PI;)t-=s.TWO_PI;return t}static angleDifference(t,e){let r=e-t;return r=s.normalizeAngleSigned(r),r}static lerpAngle(t,e,r){return t+s.angleDifference(t,e)*r}static clamp(t,e,r){return Math.max(e,Math.min(r,t))}static clamp01(t){return Math.max(0,Math.min(1,t))}static lerp(t,e,r){return t+(e-t)*r}static inverseLerp(t,e,r){return Math.abs(e-t)<s.EPSILON?0:(r-t)/(e-t)}static remap(t,e,r,i,n){const h=s.inverseLerp(e,r,t);return s.lerp(i,n,h)}static smoothStep(t){return(t=s.clamp01(t))*t*(3-2*t)}static smootherStep(t){return(t=s.clamp01(t))*t*t*(t*(6*t-15)+10)}static approximately(t,e,r=s.EPSILON){return Math.abs(t-e)<r}static isZero(t,e=s.EPSILON){return Math.abs(t)<e}static sign(t){return t>0?1:t<0?-1:0}static random(t=0,e=1){return Math.random()*(e-t)+t}static randomInt(t,e){return Math.floor(Math.random()*(e-t+1))+t}static randomChoice(t){return t[Math.floor(Math.random()*t.length)]}static randomBoolean(t=.5){return Math.random()<t}static randomInUnitCircle(){const e=Math.random()*s.TWO_PI,r=Math.sqrt(Math.random());return t.fromPolar(r,e)}static randomOnUnitCircle(){const e=Math.random()*s.TWO_PI;return t.fromAngle(e)}static fastInverseSqrt(t){return 1/Math.sqrt(t)}static fastPow(t,e){return 0===e?1:1===e?t:2===e?t*t:3===e?t*t*t:Math.pow(t,e)}static factorial(t){if(t<0)return NaN;if(0===t||1===t)return 1;let e=1;for(let r=2;r<=t;r++)e*=r;return e}static gcd(t,e){for(t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e));0!==e;){const r=e;e=t%e,t=r}return t}static lcm(t,e){return Math.abs(t*e)/s.gcd(t,e)}static fibonacci(t){if(t<=0)return 0;if(1===t)return 1;let e=0,r=1;for(let i=2;i<=t;i++){const t=e+r;e=r,r=t}return r}static arithmeticSum(t,e,r){return(t+e)*r*.5}static geometricSum(t,e,r){return Math.abs(e-1)<s.EPSILON?t*r:t*(1-Math.pow(e,r))/(1-e)}static quadraticBezier(e,r,i,s){const n=1-s,h=s*s,a=n*n;return new t(a*e.x+2*n*s*r.x+h*i.x,a*e.y+2*n*s*r.y+h*i.y)}static cubicBezier(e,r,i,s,n){const h=1-n,a=n*n,o=h*h,c=o*h,u=a*n;return new t(c*e.x+3*o*n*r.x+3*h*a*i.x+u*s.x,c*e.y+3*o*n*r.y+3*h*a*i.y+u*s.y)}static catmullRom(e,r,i,s,n){const h=n*n,a=h*n,o=.5*(2*r.x+(-e.x+i.x)*n+(2*e.x-5*r.x+4*i.x-s.x)*h+(-e.x+3*r.x-3*i.x+s.x)*a),c=.5*(2*r.y+(-e.y+i.y)*n+(2*e.y-5*r.y+4*i.y-s.y)*h+(-e.y+3*r.y-3*i.y+s.y)*a);return new t(o,c)}static noise(t,e=0,r=0){let i=43758.5453*Math.sin(12.9898*t+78.233*e+37.719*r);return i-Math.floor(i)}static smoothNoise(t,e=0,r=0){const i=Math.floor(t),n=Math.floor(e),h=t-i,a=e-n,o=s.noise(i,n,r),c=s.noise(i+1,n,r),u=s.noise(i,n+1,r),l=s.noise(i+1,n+1,r),m=s.lerp(o,c,h),x=s.lerp(u,l,h);return s.lerp(m,x,a)}static toPrecision(t,e){const r=Math.pow(10,e);return Math.round(t*r)/r}static inRange(t,e,r){return t>=e&&t<=r}static min(...t){return Math.min(...t)}static max(...t){return Math.max(...t)}static average(t){return 0===t.length?0:t.reduce(((t,e)=>t+e),0)/t.length}static median(t){if(0===t.length)return 0;const e=[...t].sort(((t,e)=>t-e)),r=Math.floor(e.length/2);return e.length%2==0?(e[r-1]+e[r])/2:e[r]}}s.PI=Math.PI,s.TWO_PI=2*Math.PI,s.HALF_PI=.5*Math.PI,s.QUARTER_PI=.25*Math.PI,s.DEG_TO_RAD=Math.PI/180,s.RAD_TO_DEG=180/Math.PI,s.GOLDEN_RATIO=.5*(1+Math.sqrt(5)),s.EPSILON=Number.EPSILON;class n{static linear(t){return t}static quadIn(t){return t*t}static quadOut(t){return 1-(1-t)*(1-t)}static quadInOut(t){return t<.5?2*t*t:1-2*(1-t)*(1-t)}static cubicIn(t){return t*t*t}static cubicOut(t){return 1-Math.pow(1-t,3)}static cubicInOut(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}static quartIn(t){return t*t*t*t}static quartOut(t){return 1-Math.pow(1-t,4)}static quartInOut(t){return t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2}static quintIn(t){return t*t*t*t*t}static quintOut(t){return 1-Math.pow(1-t,5)}static quintInOut(t){return t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*(t-1))}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return 1-Math.sqrt(1-t*t)}static circOut(t){return Math.sqrt(1-(t-1)*(t-1))}static circInOut(t){return t<.5?(1-Math.sqrt(1-4*t*t))/2:(Math.sqrt(1-(-2*t+2)*(-2*t+2))+1)/2}static backIn(t,e=1.70158){return(e+1)*t*t*t-e*t*t}static backOut(t,e=1.70158){const r=e;return 1+(r+1)*Math.pow(t-1,3)+r*Math.pow(t-1,2)}static backInOut(t,e=1.70158){const r=1.525*e;return t<.5?Math.pow(2*t,2)*(2*(r+1)*t-r)/2:(Math.pow(2*t-2,2)*((r+1)*(2*t-2)+r)+2)/2}static elasticIn(t,e=1,r=.3){if(0===t)return 0;if(1===t)return 1;const i=r/4;return-e*Math.pow(2,10*(t-1))*Math.sin((t-1-i)*(2*Math.PI)/r)}static elasticOut(t,e=1,r=.3){if(0===t)return 0;if(1===t)return 1;const i=r/4;return e*Math.pow(2,-10*t)*Math.sin((t-i)*(2*Math.PI)/r)+1}static elasticInOut(t,e=1,r=.45){if(0===t)return 0;if(1===t)return 1;const i=r/4;return t<.5?e*Math.pow(2,10*(2*t-1))*Math.sin((2*t-1-i)*(2*Math.PI)/r)*-.5:e*Math.pow(2,-10*(2*t-1))*Math.sin((2*t-1-i)*(2*Math.PI)/r)*.5+1}static bounceIn(t){return 1-n.bounceOut(1-t)}static bounceOut(t){const e=7.5625,r=2.75;return t<1/r?e*t*t:t<2/r?e*(t-=1.5/r)*t+.75:t<2.5/r?e*(t-=2.25/r)*t+.9375:e*(t-=2.625/r)*t+.984375}static bounceInOut(t){return t<.5?(1-n.bounceOut(1-2*t))/2:(1+n.bounceOut(2*t-1))/2}static combine(t,e){return e||(e=new Array(t.length).fill(1/t.length)),r=>{let i=0;for(let s=0;s<t.length;s++)i+=t[s](r)*(e[s]||0);return i}}static piecewise(t){const e=t.reduce(((t,e)=>t+e.duration),0),r=t.map((t=>({...t,duration:t.duration/e})));return t=>{let e=0;for(const i of r){if(t<=e+i.duration){const r=(t-e)/i.duration;return i.easing(Math.max(0,Math.min(1,r)))}e+=i.duration}return r[r.length-1].easing(1)}}static reverse(t){return e=>1-t(1-e)}static mirror(t){return e=>t(e<.5?2*e:2-2*e)}}n.smoothIn=n.quadOut,n.smoothOut=n.quadIn,n.quickIn=n.cubicOut,n.quickOut=n.cubicIn,n.natural=n.quartOut,n.emphasize=n.backOut;class h{constructor(t){this.cache=new Map,this.interpolator=t}setRange(t,e){this.from===t&&this.to===e||(this.from=t,this.to=e,this.cache.clear())}get(t){if(!this.from||!this.to)throw new Error("插值范围未设置");if(!this.cache.has(t)){const e=this.interpolator(this.from,this.to,t);this.cache.set(t,e)}return this.cache.get(t)}clearCache(){this.cache.clear()}}class a{static number(t,e,r){return s.lerp(t,e,r)}static vector2(e,r,i){return t.lerp(e,r,i)}static angle(t,e,r){return s.lerpAngle(t,e,r)}static color(t,e,r){const i=[],n=Math.max(t.length,e.length);for(let h=0;h<n;h++){const n=t[h]??(3===h?1:0),a=e[h]??(3===h?1:0);i[h]=s.lerp(n,a,r)}return i}static cubicSpline(t,e,r,i,s){const n=s*s;return.5*(2*e+(-t+r)*s+(2*t-5*e+4*r-i)*n+(3*e-t-3*r+i)*(n*s))}static hermite(t,e,r,i,s){const n=s*s,h=n*s;return(2*h-3*n+1)*t+(h-2*n+s)*e+(-2*h+3*n)*r+(h-n)*i}static slerp(e,r,i){let s=t.dot(e,r),n=r;if(s<0&&(s=-s,n=r.clone().negate()),s>.9995)return t.lerp(e,n,i).normalize();const h=Math.acos(Math.abs(s)),a=Math.sin(h),o=Math.sin((1-i)*h)/a,c=Math.sin(i*h)/a;return new t(e.x*o+n.x*c,e.y*o+n.y*c)}static createCachedInterpolator(t){return new h(t)}static spline(t,e){if(0===t.length)return 0;if(1===t.length)return t[0];if(2===t.length)return s.lerp(t[0],t[1],e);const r=t.length-1,i=e*r,n=Math.floor(i),h=i-n,o=Math.max(0,Math.min(r-1,n)),c=t[Math.max(0,o-1)],u=t[o],l=t[Math.min(r,o+1)],m=t[Math.min(r,o+2)];return a.cubicSpline(c,u,l,m,h)}static vectorSpline(e,r){if(0===e.length)return new t;if(1===e.length)return e[0].clone();if(2===e.length)return t.lerp(e[0],e[1],r);const i=e.map((t=>t.x)),s=e.map((t=>t.y));return new t(a.spline(i,r),a.spline(s,r))}static keyframe(t,e,r){if(0===t.length)throw new Error("至少需要一个关键帧");if(1===t.length||e<=t[0].time)return t[0].value;if(e>=t[t.length-1].time)return t[t.length-1].value;for(let i=0;i<t.length-1;i++){const s=t[i],n=t[i+1];if(e>=s.time&&e<=n.time){const t=n.time-s.time,i=t>0?(e-s.time)/t:0,h=s.easing?s.easing(i):i;return r(s.value,n.value,h)}}return t[t.length-1].value}static pathInterpolation(e,r,i=!1){if(0===e.length)return new t;if(1===e.length)return e[0].clone();const s=r*a.getPathLength(e,i);let n=0;const h=i?e.length:e.length-1;for(let r=0;r<h;r++){const i=e[r],h=e[(r+1)%e.length],a=t.distance(i,h);if(n+a>=s){const e=(s-n)/a;return t.lerp(i,h,e)}n+=a}return e[e.length-1].clone()}static getPathLength(e,r=!1){if(e.length<2)return 0;let i=0;const s=r?e.length:e.length-1;for(let r=0;r<s;r++){const s=e[r],n=e[(r+1)%e.length];i+=t.distance(s,n)}return i}static createNumberInterpolator(t,e){return r=>a.number(t,e,r)}static createVectorInterpolator(t,e){return r=>a.vector2(t,e,r)}static createCompositeInterpolator(t){return(e,r,i)=>{const s=[];for(let n=0;n<Math.min(t.length,e.length,r.length);n++)s[n]=t[n](e[n],r[n],i);return s}}}exports.CachedInterpolator=h,exports.Circle=i,exports.CollisionDetector=class{static pointCircle(e,r){const i=t.distance(e,r.center);if(!(i<=r.radius))return{collided:!1};return{collided:!0,normal:i>0?t.subtract(e,r.center).normalize():new t(1,0),penetration:r.radius-i,contactPoint:e.clone()}}static pointRect(e,r){if(!r.containsPoint(e))return{collided:!1};const i=e.x-r.left,s=r.right-e.x,n=e.y-r.top,h=r.bottom-e.y,a=Math.min(i,s,n,h);let o,c=a;return o=a===i?new t(-1,0):a===s?new t(1,0):new t(0,a===n?-1:1),{collided:!0,normal:o,penetration:c,contactPoint:e.clone()}}static circleCircle(e,r){const i=t.distance(e.center,r.center),s=e.radius+r.radius;if(!(i<=s))return{collided:!1};const n=i>0?t.subtract(r.center,e.center).normalize():new t(1,0),h=s-i,a=e.center.clone().add(n.clone().multiply(e.radius-.5*h));return{collided:!0,normal:n,penetration:h,contactPoint:a}}static circleRect(e,r){const i=r.closestPointTo(e.center),s=t.distance(e.center,i);if(!(s<=e.radius))return{collided:!1};return{collided:!0,normal:s>0?t.subtract(i,e.center).normalize():new t(0,-1),penetration:e.radius-s,contactPoint:i}}static rectRect(e,r){if(!e.intersects(r))return{collided:!1};const i=Math.max(e.left,r.left),s=Math.min(e.right,r.right),n=Math.max(e.top,r.top),h=Math.min(e.bottom,r.bottom),a=s-i,o=h-n;let c,u;a<o?(u=a,c=e.centerX<r.centerX?new t(-1,0):new t(1,0)):(u=o,c=e.centerY<r.centerY?new t(0,-1):new t(0,1));return{collided:!0,normal:c,penetration:u,contactPoint:new t(.5*(i+s),.5*(n+h))}}static rayCircle(e,r,i,s=1/0){const n=t.subtract(e,i.center),h=r.lengthSquared,a=2*t.dot(n,r),o=a*a-4*h*(n.lengthSquared-i.radius*i.radius);if(o<0)return{collided:!1};const c=Math.sqrt(o),u=(-a-c)/(2*h);let l=u>=0?u:(-a+c)/(2*h);if(l<0||l>s)return{collided:!1};const m=e.clone().add(r.clone().multiply(l));return{collided:!0,normal:t.subtract(m,i.center).normalize(),contactPoint:m,distance:l,penetration:0}}static rayRect(e,r,i,s=1/0){const n=0!==r.x?1/r.x:1e10,h=0!==r.y?1/r.y:1e10,a=(i.left-e.x)*n,o=(i.right-e.x)*n,c=(i.top-e.y)*h,u=(i.bottom-e.y)*h,l=Math.max(Math.min(a,o),Math.min(c,u)),m=Math.min(Math.max(a,o),Math.max(c,u));if(m<0||l>m||l>s)return{collided:!1};const x=l>=0?l:m,d=e.clone().add(r.clone().multiply(x));let y;const M=1e-6;return y=Math.abs(d.x-i.left)<M?new t(-1,0):Math.abs(d.x-i.right)<M?new t(1,0):Math.abs(d.y-i.top)<M?new t(0,-1):new t(0,1),{collided:!0,normal:y,contactPoint:d,distance:x,penetration:0}}static lineSegmentLineSegment(e,r,i,s){const n=t.subtract(r,e),h=t.subtract(s,i),a=t.subtract(i,e),o=t.cross(n,h);if(Math.abs(o)<Number.EPSILON)return{collided:!1};const c=t.cross(a,h)/o,u=t.cross(a,n)/o;if(c>=0&&c<=1&&u>=0&&u<=1){const t=e.clone().add(n.clone().multiply(c));return{collided:!0,normal:n.perpendicular().normalize(),contactPoint:t,penetration:0}}return{collided:!1}}static lineSegmentCircle(e,r,i){const s=t.subtract(r,e),n=t.subtract(e,i.center),h=t.dot(s,s),a=2*t.dot(n,s),o=a*a-4*h*(t.dot(n,n)-i.radius*i.radius);if(o<0)return{collided:!1};const c=Math.sqrt(o),u=(-a-c)/(2*h),l=(-a+c)/(2*h),m=[];if(u>=0&&u<=1&&m.push(u),l>=0&&l<=1&&m.push(l),0===m.length)return{collided:!1};const x=m[0],d=e.clone().add(s.clone().multiply(x));return{collided:!0,normal:t.subtract(d,i.center).normalize(),contactPoint:d,penetration:0}}static aabbTest(t,e){return t.intersects(e)}static circleTest(e,r,i,s){return t.distance(e,i)<=r+s}},exports.Easing=n,exports.Interpolation=a,exports.MathUtils=s,exports.Matrix3=e,exports.Rectangle=r,exports.Vector2=t;
2
- //# sourceMappingURL=index.cjs.map