@woosh/meep-engine 2.89.2 → 2.89.5
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/build/meep.cjs +1 -1
- package/build/meep.module.js +1 -1
- package/package.json +1 -1
- package/src/core/geom/2d/circle/Circle.js +2 -2
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.d.ts +14 -0
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.js +64 -0
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.spec.d.ts +2 -0
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.spec.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.spec.js +79 -0
- package/src/core/geom/2d/circle/{computeCircleCirclePenetrationDistance.d.ts → circle_compute_circle_penetration.d.ts} +2 -2
- package/src/core/geom/2d/circle/circle_compute_circle_penetration.d.ts.map +1 -0
- package/src/core/geom/2d/circle/{computeCircleCirclePenetrationDistance.js → circle_compute_circle_penetration.js} +6 -4
- package/src/core/geom/2d/circle/{circleIntersectsCircle.d.ts → circle_intersects_circle.d.ts} +2 -2
- package/src/core/geom/2d/circle/circle_intersects_circle.d.ts.map +1 -0
- package/src/core/geom/2d/circle/{circleIntersectsCircle.js → circle_intersects_circle.js} +1 -1
- package/src/core/geom/2d/circle/{circleIntersectsPoint.d.ts → circle_intersects_point.d.ts} +2 -2
- package/src/core/geom/2d/circle/circle_intersects_point.d.ts.map +1 -0
- package/src/core/geom/2d/circle/{circleIntersectsPoint.js → circle_intersects_point.js} +1 -1
- package/src/core/geom/2d/shape/CircleShape.js +4 -4
- package/src/core/geom/2d/shape/PointShape.js +2 -2
- package/src/core/json/abstractJSONDeserializer.js +1 -1
- package/src/core/json/abstractJSONSerializer.js +1 -1
- package/src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.d.ts.map +1 -1
- package/src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js +5 -0
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +5 -2
- package/src/generation/markers/MarkerNode.d.ts.map +1 -1
- package/src/generation/markers/MarkerNode.js +3 -3
- package/src/core/geom/2d/circle/circleIntersectsCircle.d.ts.map +0 -1
- package/src/core/geom/2d/circle/circleIntersectsPoint.d.ts.map +0 -1
- package/src/core/geom/2d/circle/computeCircleCirclePenetrationDistance.d.ts.map +0 -1
package/build/meep.cjs
CHANGED
|
@@ -49287,7 +49287,7 @@ class Sampler2D {
|
|
|
49287
49287
|
* @param {number[]|Float32Array|Float64Array} result
|
|
49288
49288
|
* @param {number} result_offset
|
|
49289
49289
|
*/
|
|
49290
|
-
sampleBicubic(x,y, result, result_offset){
|
|
49290
|
+
sampleBicubic(x, y, result, result_offset) {
|
|
49291
49291
|
|
|
49292
49292
|
const itemSize = this.itemSize;
|
|
49293
49293
|
|
package/build/meep.module.js
CHANGED
|
@@ -49285,7 +49285,7 @@ class Sampler2D {
|
|
|
49285
49285
|
* @param {number[]|Float32Array|Float64Array} result
|
|
49286
49286
|
* @param {number} result_offset
|
|
49287
49287
|
*/
|
|
49288
|
-
sampleBicubic(x,y, result, result_offset){
|
|
49288
|
+
sampleBicubic(x, y, result, result_offset) {
|
|
49289
49289
|
|
|
49290
49290
|
const itemSize = this.itemSize;
|
|
49291
49291
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { circle_intersects_circle } from "./circle_intersects_circle.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A circle or a 2-dimensional sphere. Represented as a position (x,y) and radius (r)
|
|
@@ -59,7 +59,7 @@ Circle.prototype.overlaps = function (other) {
|
|
|
59
59
|
const y1 = other.y;
|
|
60
60
|
const r1 = other.r;
|
|
61
61
|
|
|
62
|
-
return
|
|
62
|
+
return circle_intersects_circle(x0, y0, r0, x1, y1, r1);
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {number} a_center_x
|
|
6
|
+
* @param {number} a_center_y
|
|
7
|
+
* @param {number} a_radius
|
|
8
|
+
* @param {number} b_center_x
|
|
9
|
+
* @param {number} b_center_y
|
|
10
|
+
* @param {number} b_radius
|
|
11
|
+
* @returns {boolean} if intersection exists, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export function circle_compute_circle_intersection(result: number[], result_offset: number, a_center_x: number, a_center_y: number, a_radius: number, b_center_x: number, b_center_y: number, b_radius: number): boolean;
|
|
14
|
+
//# sourceMappingURL=circle_compute_circle_intersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle_compute_circle_intersection.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circle_compute_circle_intersection.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,2DAVW,MAAM,EAAE,iBACR,MAAM,cACN,MAAM,cACN,MAAM,YACN,MAAM,cACN,MAAM,cACN,MAAM,YACN,MAAM,GACJ,OAAO,CAqDnB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]} result
|
|
4
|
+
* @param {number} result_offset
|
|
5
|
+
* @param {number} a_center_x
|
|
6
|
+
* @param {number} a_center_y
|
|
7
|
+
* @param {number} a_radius
|
|
8
|
+
* @param {number} b_center_x
|
|
9
|
+
* @param {number} b_center_y
|
|
10
|
+
* @param {number} b_radius
|
|
11
|
+
* @returns {boolean} if intersection exists, false otherwise
|
|
12
|
+
*/
|
|
13
|
+
export function circle_compute_circle_intersection(
|
|
14
|
+
result,
|
|
15
|
+
result_offset,
|
|
16
|
+
a_center_x, a_center_y, a_radius,
|
|
17
|
+
b_center_x, b_center_y, b_radius
|
|
18
|
+
) {
|
|
19
|
+
|
|
20
|
+
// see https://math.stackexchange.com/a/1033561
|
|
21
|
+
|
|
22
|
+
const abx = a_center_x - b_center_x;
|
|
23
|
+
const aby = a_center_y - b_center_y;
|
|
24
|
+
|
|
25
|
+
const d2 = abx * abx + aby * aby;
|
|
26
|
+
|
|
27
|
+
if (d2 === 0) {
|
|
28
|
+
// centers are at the same coordinate, no intersection possible except for full overlap
|
|
29
|
+
// Continuing would lead to division by 0, so we treat this as no-intersection
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const d = Math.sqrt(d2);
|
|
34
|
+
|
|
35
|
+
if (d > a_radius + b_radius) {
|
|
36
|
+
// no intersection
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (d < Math.abs(a_radius - b_radius)) {
|
|
41
|
+
// one circle is fully within another
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const a_radius2 = a_radius * a_radius;
|
|
46
|
+
const l = (a_radius2 - b_radius * b_radius + d * d) / (2 * d);
|
|
47
|
+
const h = Math.sqrt(a_radius2 - l * l)
|
|
48
|
+
|
|
49
|
+
const l_d = l / d;
|
|
50
|
+
const h_d = h / d;
|
|
51
|
+
|
|
52
|
+
const bax = b_center_x - a_center_x;
|
|
53
|
+
const bay = b_center_y - a_center_y;
|
|
54
|
+
|
|
55
|
+
// compute first root
|
|
56
|
+
result[result_offset] = l_d * bax + h_d * bay + a_center_x;
|
|
57
|
+
result[result_offset + 1] = l_d * bay - h_d * bax + a_center_y;
|
|
58
|
+
|
|
59
|
+
// second root
|
|
60
|
+
result[result_offset + 2] = l_d * bax - h_d * bay + a_center_x;
|
|
61
|
+
result[result_offset + 3] = l_d * bay + h_d * bax + a_center_y;
|
|
62
|
+
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle_compute_circle_intersection.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circle_compute_circle_intersection.spec.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { circle_compute_circle_intersection } from "./circle_compute_circle_intersection.js";
|
|
2
|
+
|
|
3
|
+
test("non-intersecting point circles", () => {
|
|
4
|
+
expect(
|
|
5
|
+
circle_compute_circle_intersection(
|
|
6
|
+
[], 0,
|
|
7
|
+
0, 0, 0,
|
|
8
|
+
1, 0, 0
|
|
9
|
+
)
|
|
10
|
+
).toBe(false);
|
|
11
|
+
|
|
12
|
+
expect(
|
|
13
|
+
circle_compute_circle_intersection(
|
|
14
|
+
[], 0,
|
|
15
|
+
1, 0, 0,
|
|
16
|
+
0, 0, 0
|
|
17
|
+
)
|
|
18
|
+
).toBe(false);
|
|
19
|
+
|
|
20
|
+
expect(
|
|
21
|
+
circle_compute_circle_intersection(
|
|
22
|
+
[], 0,
|
|
23
|
+
0, 1, 0,
|
|
24
|
+
0, 0, 0
|
|
25
|
+
)
|
|
26
|
+
).toBe(false);
|
|
27
|
+
|
|
28
|
+
expect(
|
|
29
|
+
circle_compute_circle_intersection(
|
|
30
|
+
[], 0,
|
|
31
|
+
0, 0, 0,
|
|
32
|
+
0, 1, 0
|
|
33
|
+
)
|
|
34
|
+
).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("circle inside circle", () => {
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
expect(
|
|
41
|
+
circle_compute_circle_intersection(
|
|
42
|
+
[], 0,
|
|
43
|
+
2, 3, 5,
|
|
44
|
+
3, 4, 11
|
|
45
|
+
)
|
|
46
|
+
).toBe(false);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("touching case", () => {
|
|
52
|
+
|
|
53
|
+
const result = [];
|
|
54
|
+
|
|
55
|
+
expect(
|
|
56
|
+
circle_compute_circle_intersection(
|
|
57
|
+
result, 0,
|
|
58
|
+
1, 3, 5,
|
|
59
|
+
7, 3, 1
|
|
60
|
+
)
|
|
61
|
+
).toBe(true);
|
|
62
|
+
|
|
63
|
+
expect(result).toEqual([6, 3, 6, 3]);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test("2 intersection points", () => {
|
|
67
|
+
|
|
68
|
+
const result = [];
|
|
69
|
+
|
|
70
|
+
expect(
|
|
71
|
+
circle_compute_circle_intersection(
|
|
72
|
+
result, 0,
|
|
73
|
+
-0.5, 0, 1,
|
|
74
|
+
0.5, 0, 1
|
|
75
|
+
)
|
|
76
|
+
).toBe(true);
|
|
77
|
+
|
|
78
|
+
expect(result).toEqual([0, -0.5 * Math.sqrt(3), 0, +0.5 * Math.sqrt(3)]);
|
|
79
|
+
});
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @param {number} br Radius of second circle
|
|
9
9
|
* @returns {number} positive value means that there is penetration, negative means that circles are separated
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
12
|
-
//# sourceMappingURL=
|
|
11
|
+
export function circle_compute_circle_penetration(ax: number, ay: number, ar: number, bx: number, by: number, br: number): number;
|
|
12
|
+
//# sourceMappingURL=circle_compute_circle_penetration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle_compute_circle_penetration.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circle_compute_circle_penetration.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,sDARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAuBlB"}
|
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
* @param {number} br Radius of second circle
|
|
9
9
|
* @returns {number} positive value means that there is penetration, negative means that circles are separated
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function circle_compute_circle_penetration(
|
|
12
|
+
ax, ay, ar,
|
|
13
|
+
bx, by, br
|
|
14
|
+
) {
|
|
15
|
+
|
|
12
16
|
const dx = bx - ax;
|
|
13
17
|
const dy = by - ax;
|
|
14
18
|
|
|
@@ -24,7 +28,5 @@ export function computeCircleCirclePenetrationDistance(ax, ay, ar, bx, by, br) {
|
|
|
24
28
|
*/
|
|
25
29
|
const minSeparation = ar + br;
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return result;
|
|
31
|
+
return minSeparation - distance;
|
|
30
32
|
}
|
package/src/core/geom/2d/circle/{circleIntersectsCircle.d.ts → circle_intersects_circle.d.ts}
RENAMED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* @param {number} r1 Radius is second circle
|
|
9
9
|
* @returns {boolean}
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
12
|
-
//# sourceMappingURL=
|
|
11
|
+
export function circle_intersects_circle(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): boolean;
|
|
12
|
+
//# sourceMappingURL=circle_intersects_circle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle_intersects_circle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circle_intersects_circle.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,6CARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAQnB"}
|
|
@@ -10,7 +10,7 @@ import { v2_distance } from "../../vec2/v2_distance.js";
|
|
|
10
10
|
* @param {number} r1 Radius is second circle
|
|
11
11
|
* @returns {boolean}
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function circle_intersects_circle(x0, y0, r0, x1, y1, r1) {
|
|
14
14
|
const minSeparation = r0 + r1;
|
|
15
15
|
|
|
16
16
|
const distance = v2_distance(x0, y0, x1, y1);
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* @param {number} py Point coordinate Y
|
|
8
8
|
* @returns {boolean}
|
|
9
9
|
*/
|
|
10
|
-
export function
|
|
11
|
-
//# sourceMappingURL=
|
|
10
|
+
export function circle_intersects_point(cx: number, cy: number, cr: number, px: number, py: number): boolean;
|
|
11
|
+
//# sourceMappingURL=circle_intersects_point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle_intersects_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circle_intersects_point.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,4CAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAMnB"}
|
|
@@ -9,7 +9,7 @@ import { v2_distance } from "../../vec2/v2_distance.js";
|
|
|
9
9
|
* @param {number} py Point coordinate Y
|
|
10
10
|
* @returns {boolean}
|
|
11
11
|
*/
|
|
12
|
-
export function
|
|
12
|
+
export function circle_intersects_point(cx, cy, cr, px, py) {
|
|
13
13
|
const distance = v2_distance(cx, cx, px, py);
|
|
14
14
|
|
|
15
15
|
return distance < cr;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { circle_intersects_circle } from "../circle/circle_intersects_circle.js";
|
|
2
|
+
import { circle_intersects_point } from "../circle/circle_intersects_point.js";
|
|
3
3
|
import { AbstractShape } from "./AbstractShape.js";
|
|
4
4
|
|
|
5
5
|
export class CircleShape extends AbstractShape {
|
|
@@ -52,11 +52,11 @@ export class CircleShape extends AbstractShape {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
intersectsPoint(x, y) {
|
|
55
|
-
return
|
|
55
|
+
return circle_intersects_point(this.x, this.y, this.radius, x, y);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
intersectsCircle(x, y, radius) {
|
|
59
|
-
return
|
|
59
|
+
return circle_intersects_circle(x, y, radius, this.x, this.y, this.radius);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { circle_intersects_point } from "../circle/circle_intersects_point.js";
|
|
2
2
|
import { AbstractShape } from "./AbstractShape.js";
|
|
3
3
|
|
|
4
4
|
export class PointShape extends AbstractShape {
|
|
@@ -23,7 +23,7 @@ export class PointShape extends AbstractShape {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
intersectsCircle(x, y, radius) {
|
|
26
|
-
return
|
|
26
|
+
return circle_intersects_point(x, y, radius, this.x, this.y);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paintTerrainOverlayViaLookupTable.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paintTerrainOverlayViaLookupTable.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/ecs/terrain/util/paintTerrainOverlayViaLookupTable.js"],"names":[],"mappings":"AA2BA;;;;;;;;GAQG;AACH;IAPkC,OAAO;IACZ,OAAO,EAAzB,SAAS;IACqB,GAAG,GAAjC,oBAAoB;IACK,KAAK,GAA9B,eAAe;IACkB,mBAAmB,UAA3C,MAAM,KAAE,MAAM;IACP,OAAO,GAAvB,MAAM;SAiEhB;0BA7FyB,gDAAgD;qCAFrC,iFAAiF;gCADtF,mDAAmD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../../../../core/assert.js";
|
|
1
2
|
import { passThrough } from "../../../../core/function/passThrough.js";
|
|
2
3
|
import { clamp01 } from "../../../../core/math/clamp01.js";
|
|
3
4
|
import { NumericInterval } from "../../../../core/math/interval/NumericInterval.js";
|
|
@@ -41,6 +42,10 @@ export function paintTerrainOverlayViaLookupTable({
|
|
|
41
42
|
lookupScaleFunction = passThrough,
|
|
42
43
|
channel = 0
|
|
43
44
|
}) {
|
|
45
|
+
|
|
46
|
+
assert.isNonNegativeInteger(channel, 'channel');
|
|
47
|
+
assert.lessThan(channel, sampler.itemSize);
|
|
48
|
+
|
|
44
49
|
let i, j;
|
|
45
50
|
|
|
46
51
|
const colorSample = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"Sampler2D.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/Sampler2D.js"],"names":[],"mappings":"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"}
|
|
@@ -210,7 +210,7 @@ export class Sampler2D {
|
|
|
210
210
|
* @param {number[]|Float32Array|Float64Array} result
|
|
211
211
|
* @param {number} result_offset
|
|
212
212
|
*/
|
|
213
|
-
sampleBicubic(x,y, result, result_offset){
|
|
213
|
+
sampleBicubic(x, y, result, result_offset) {
|
|
214
214
|
|
|
215
215
|
const itemSize = this.itemSize;
|
|
216
216
|
|
|
@@ -486,7 +486,7 @@ export class Sampler2D {
|
|
|
486
486
|
assert.isNumber(channel, "channel");
|
|
487
487
|
|
|
488
488
|
assert.isNonNegativeInteger(channel, 'channel');
|
|
489
|
-
assert.
|
|
489
|
+
assert.lessThan(channel, this.itemSize);
|
|
490
490
|
|
|
491
491
|
const index = (y * this.width + x) * this.itemSize + channel;
|
|
492
492
|
|
|
@@ -749,6 +749,9 @@ export class Sampler2D {
|
|
|
749
749
|
assert.lessThan(x, this.width);
|
|
750
750
|
assert.lessThan(y, this.height);
|
|
751
751
|
|
|
752
|
+
assert.isNonNegativeInteger(channel, 'channel');
|
|
753
|
+
assert.lessThan(channel, this.itemSize);
|
|
754
|
+
|
|
752
755
|
const pointIndex = y * this.width + x;
|
|
753
756
|
const pointAddress = pointIndex * this.itemSize;
|
|
754
757
|
const channelAddress = pointAddress + channel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerNode.d.ts","sourceRoot":"","sources":["../../../../src/generation/markers/MarkerNode.js"],"names":[],"mappings":"AAKA;IAEI;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,aAAY;IAEZ;;;OAGG;IACH,MAFU,QAAQ,CAER;IAEV;;;OAGG;IACH,UAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,WAFU,SAAS,CAES;IAE5B;;;;OAIG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,gBAAgB;IAGhB;;;;OAIG;IACH,YAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,iBAHW,MAAM,EAAE,GACN,OAAO,CAanB;IAED;;;OAGG;IACH,SAFa,UAAU,CAQtB;IAED;;;OAGG;IACH,YAFW,UAAU,QAcpB;IAED;;;;OAIG;IACH,gBAHW,UAAU,GACR,OAAO,CAOnB;IAIL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC;
|
|
1
|
+
{"version":3,"file":"MarkerNode.d.ts","sourceRoot":"","sources":["../../../../src/generation/markers/MarkerNode.js"],"names":[],"mappings":"AAKA;IAEI;;;OAGG;IACH,UAFU,MAAM,CAEH;IAEb;;;OAGG;IACH,aAAY;IAEZ;;;OAGG;IACH,MAFU,QAAQ,CAER;IAEV;;;OAGG;IACH,UAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,WAFU,SAAS,CAES;IAE5B;;;;OAIG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,gBAAgB;IAGhB;;;;OAIG;IACH,YAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,iBAHW,MAAM,EAAE,GACN,OAAO,CAanB;IAED;;;OAGG;IACH,SAFa,UAAU,CAQtB;IAED;;;OAGG;IACH,YAFW,UAAU,QAcpB;IAED;;;;OAIG;IACH,gBAHW,UAAU,GACR,OAAO,CAOnB;IAIL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CANhC;oBAtHmB,4BAA4B;0BACtB,yCAAyC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { array_copy_entire } from "../../core/collection/array/array_copy_entire.js";
|
|
2
|
+
import { circle_intersects_circle } from "../../core/geom/2d/circle/circle_intersects_circle.js";
|
|
1
3
|
import Vector2 from "../../core/geom/Vector2.js";
|
|
2
4
|
import { Transform } from "../../engine/ecs/transform/Transform.js";
|
|
3
|
-
import { circleIntersectsCircle } from "../../core/geom/2d/circle/circleIntersectsCircle.js";
|
|
4
|
-
import { array_copy_entire } from "../../core/collection/array/array_copy_entire.js";
|
|
5
5
|
|
|
6
6
|
export class MarkerNode {
|
|
7
7
|
|
|
@@ -115,7 +115,7 @@ export class MarkerNode {
|
|
|
115
115
|
const p0 = this.transform.position;
|
|
116
116
|
const p1 = other.transform.position;
|
|
117
117
|
|
|
118
|
-
return
|
|
118
|
+
return circle_intersects_circle(p0.x, p0.y, this.size, p1.x, p1.y, other.size);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"circleIntersectsCircle.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circleIntersectsCircle.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,2CARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAQnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"circleIntersectsPoint.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/circleIntersectsPoint.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,0CAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAMnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"computeCircleCirclePenetrationDistance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/circle/computeCircleCirclePenetrationDistance.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,2DARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAqBlB"}
|