@woosh/meep-engine 2.48.21 → 2.48.23
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/editor/ecs/component/editors/three/BufferGeometryEditor.js +1 -1
- package/editor/ecs/component/editors/three/MeshEditor.js +1 -1
- package/editor/tools/SelectionTool.js +1 -1
- package/editor/view/library/MeshLibraryView.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/32BitEncoder.js +1 -1
- package/src/core/bvh2/LeafNode.js +2 -2
- package/src/core/bvh2/Node.d.ts +1 -1
- package/src/core/bvh2/Node.js +1 -1
- package/src/core/bvh2/NodeValidator.js +1 -1
- package/src/core/bvh2/serialization/deserializeBinaryNode.js +1 -1
- package/src/core/bvh2/serialization/deserializeBinaryNodeFromBinaryBuffer.js +2 -2
- package/src/core/bvh2/serialization/serializeBinaryNode.js +1 -1
- package/src/core/bvh2/serialization/serializeBinaryNodeToBinaryBuffer.js +2 -2
- package/src/core/cache/Cache.js +4 -2
- package/src/core/codegen/LineBuilder.js +3 -0
- package/src/core/collection/HashMap.js +6 -0
- package/src/core/collection/heap/Uint32Heap.js +1 -0
- package/src/core/events/signal/Signal.js +7 -5
- package/src/core/events/signal/SignalBinding.js +56 -54
- package/src/core/events/signal/SignalFlags.js +7 -0
- package/src/core/function/Functions.js +1 -1
- package/src/core/geom/{Rectangle.js → 2d/Rectangle.js} +5 -5
- package/src/core/geom/{AABB2.js → 2d/aabb/AABB2.js} +10 -78
- package/src/core/geom/{AABB2.spec.js → 2d/aabb/AABB2.spec.js} +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_overlap.js +42 -0
- package/src/core/geom/2d/aabb/aabb2_contains.js +23 -0
- package/src/core/geom/2d/aabb/aabb2_distance_sqr_to_point.js +25 -0
- package/src/core/geom/2d/aabb/aabb2_distance_to_point.js +17 -0
- package/src/core/geom/2d/aabb/aabb2_distance_to_point.spec.js +17 -0
- package/src/core/geom/2d/aabb/aabb2_overlap_exists.js +18 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.js +45 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_sqr_to_point.spec.js +40 -0
- package/src/core/geom/2d/aabb/aabb2_signed_distance_to_point.js +27 -0
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.js +4 -0
- package/src/core/geom/2d/quad-tree/PointQuadTree.js +3 -0
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeNode.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +6 -8
- package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +3 -3
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.d.ts +1 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.js +13 -13
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/AABB3.spec.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +13 -9
- package/src/core/geom/3d/topology/util/compute_face_connection_weight.js +40 -0
- package/src/core/geom/packing/max-rect/MaxRectangles.js +1 -1
- package/src/core/geom/{GeometryMath.js → rayTriangleIntersection.js} +5 -1
- package/src/core/graph/GraphUtils.js +1 -1
- package/src/core/graph/build_face_graph_from_mesh.js +1 -3
- package/src/core/graph/layout/BoxLayouter.js +1 -1
- package/src/core/graph/layout/CircleLayout.js +2 -2
- package/src/core/model/node-graph/visual/NodeVisualData.js +1 -1
- package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +2 -2
- package/src/engine/asset/preloader/Preloader.js +3 -3
- package/src/engine/ecs/components/Renderable.d.ts +1 -1
- package/src/engine/ecs/components/Renderable.js +1 -1
- package/src/engine/ecs/gui/position/ViewportPositionSystem.js +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +2 -2
- package/src/engine/ecs/tooltip/TooltipComponentSystem.js +1 -1
- package/src/engine/graphics/camera/makeScreenScissorFrustum.d.ts +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/ecs/mesh/Mesh.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh/Mesh.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/sample/load_gltf.js +0 -3
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts +1 -1
- package/src/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +1 -1
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshBoundingVolumes.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +1 -1
- package/src/engine/graphics/render/forward_plus/debug/createScreenGrid.js +1 -1
- package/src/engine/graphics/render/view/CameraView.js +1 -1
- package/src/engine/graphics/texture/atlas/AtlasPatch.js +2 -2
- package/src/engine/graphics/texture/atlas/TextureAtlas.spec.js +2 -2
- package/src/engine/graphics/util/makeMeshPreviewScene.js +1 -1
- package/src/engine/graphics/util/renderObjectToSampler2D.js +1 -1
- package/src/engine/ui/tiles2d/computeTileGridMove.js +3 -2
- package/src/engine/ui/tiles2d/computeTileGridMove.spec.js +1 -1
- package/src/generation/theme/AreaMask.js +1 -1
- package/src/view/View.js +1 -1
- package/src/view/elements/progress/RectangularPieProgressView.js +1 -1
- package/src/view/minimap/Minimap.js +1 -1
- package/src/view/minimap/gl/MinimapFogOfWar.js +1 -1
- package/src/view/tooltip/DomTooltipObserver.js +1 -1
- package/src/view/tooltip/TooltipManager.js +1 -1
- package/src/view/tooltip/TooltipView.js +1 -1
- package/src/view/util/DomSizeObserver.js +2 -2
- package/src/core/geom/2d/AABB2Math.js +0 -40
- package/src/core/geom/2d/AABB2Math.spec.js +0 -17
- /package/src/core/geom/{LineSegment2.js → 2d/LineSegment2.js} +0 -0
- /package/src/core/geom/{Rectangle.spec.js → 2d/Rectangle.spec.js} +0 -0
- /package/src/core/geom/{AABB2.d.ts → 2d/aabb/AABB2.d.ts} +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Encoded_v0.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/deserializeAABB3Quantized16Uint.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Encoded_v0.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/serializeAABB3Quantized16Uint.js +0 -0
|
@@ -13,7 +13,7 @@ import { CameraClippingPlaneComputer } from "../camera/CameraClippingPlaneComput
|
|
|
13
13
|
import { assert } from "../../../../core/assert.js";
|
|
14
14
|
import { ForwardPlusRenderingPlugin } from "../../render/forward_plus/plugin/ForwardPlusRenderingPlugin.js";
|
|
15
15
|
import { ThreeLightCache } from "./three/ThreeLightCache.js";
|
|
16
|
-
import { AABB3 } from "../../../../core/
|
|
16
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
17
17
|
import { ShadowManager } from "./shadow/ShadowManager.js";
|
|
18
18
|
import { AbstractContextSystem } from "../../../ecs/system/AbstractContextSystem.js";
|
|
19
19
|
import { LightContext } from "./LightContext.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by Alex Goldring on 25.02.2015.
|
|
3
3
|
*/
|
|
4
|
-
import { AABB3 } from "../../../../core/
|
|
4
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
5
5
|
import { LeafNode } from "../../../../core/bvh2/LeafNode.js";
|
|
6
6
|
import { getSkeletonBoneByType } from "./SkeletonUtils.js";
|
|
7
7
|
import { assert } from "../../../../core/assert.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AABB3 } from "../../../../core/
|
|
1
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
2
2
|
import { DrawMode } from "./DrawMode.js";
|
|
3
3
|
import { ShadedGeometryFlags } from "./ShadedGeometryFlags.js";
|
|
4
4
|
import { aabb3_matrix4_project } from "../../../../core/geom/3d/aabb/aabb3_matrix4_project.js";
|
|
@@ -6,7 +6,6 @@ import { GLTFAssetLoader } from "../../../../asset/loaders/GLTFAssetLoader.js";
|
|
|
6
6
|
import { three_object_to_entity_composition } from "../three_object_to_entity_composition.js";
|
|
7
7
|
import { TransformAttachmentSystem } from "../../../../ecs/transform-attachment/TransformAttachmentSystem.js";
|
|
8
8
|
import { Camera } from "../../camera/Camera.js";
|
|
9
|
-
import { MicronRenderPlugin } from "../../../micron/plugin/MicronRenderPlugin.js";
|
|
10
9
|
import { enableEditor } from "../../../../../../editor/enableEditor.js";
|
|
11
10
|
import { MeshSystem } from "../../mesh/MeshSystem.js";
|
|
12
11
|
|
|
@@ -31,8 +30,6 @@ async function init(harness) {
|
|
|
31
30
|
config.addLoader(GameAssetType.ModelGLTF_JSON, gltfAssetLoader);
|
|
32
31
|
config.addLoader(GameAssetType.ModelGLTF, gltfAssetLoader);
|
|
33
32
|
|
|
34
|
-
config.addPlugin(MicronRenderPlugin);
|
|
35
|
-
|
|
36
33
|
await config.apply(engine);
|
|
37
34
|
|
|
38
35
|
enableEditor(engine);
|
package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {AABB3} from "../../../../core/
|
|
1
|
+
import {AABB3} from "../../../../core/geom/3d/aabb/AABB3";
|
|
2
2
|
import {EntityComponentDataset} from "../../../ecs/EntityComponentDataset";
|
|
3
3
|
|
|
4
4
|
export function sg_hierarchy_compute_bounding_box_via_parent_entity(result: AABB3, root_entity: number, ecd: EntityComponentDataset): void
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Vector3 from "../../../../../core/geom/Vector3.js";
|
|
2
2
|
|
|
3
3
|
import { Vector3 as ThreeVector3 } from 'three';
|
|
4
|
-
import { rayTriangleIntersection } from "../../../../../core/geom/
|
|
4
|
+
import { rayTriangleIntersection } from "../../../../../core/geom/rayTriangleIntersection.js";
|
|
5
5
|
import { SurfacePoint3 } from "../../../../../core/geom/3d/SurfacePoint3.js";
|
|
6
6
|
import { assert } from "../../../../../core/assert.js";
|
|
7
7
|
import { v3_length } from "../../../../../core/geom/v3_length.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computeSkinnedMeshVertices } from "./computeSkinnedMeshVertices.js";
|
|
2
|
-
import { AABB3 } from "../../../../core/
|
|
2
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
3
3
|
import Vector4 from "../../../../core/geom/Vector4.js";
|
|
4
4
|
import { computeBoundingSphereFromVertexData } from "../computeBoundingSphereFromVertexData.js";
|
|
5
5
|
import { Box3, Sphere as ThreeSphere, Vector3 as ThreeVector3 } from "three";
|
|
@@ -14,7 +14,7 @@ import { ParticleParameters } from "./ParticleParameters.js";
|
|
|
14
14
|
import { BlendingType } from "../../../../texture/sampler/BlendingType.js";
|
|
15
15
|
import Quaternion from "../../../../../../core/geom/Quaternion.js";
|
|
16
16
|
import { ParticleEmitterFlag } from "./ParticleEmitterFlag.js";
|
|
17
|
-
import { AABB3 } from "../../../../../../core/
|
|
17
|
+
import { AABB3 } from "../../../../../../core/geom/3d/aabb/AABB3.js";
|
|
18
18
|
import {
|
|
19
19
|
PARTICLE_ATTRIBUTE_AGE,
|
|
20
20
|
PARTICLE_ATTRIBUTE_BLEND,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Vector3 from "../../../../../../core/geom/Vector3.js";
|
|
2
2
|
import { NumericInterval } from "../../../../../../core/math/interval/NumericInterval.js";
|
|
3
3
|
import { ParameterTrackSet } from "../parameter/ParameterTrackSet.js";
|
|
4
|
-
import { AABB3 } from "../../../../../../core/
|
|
4
|
+
import { AABB3 } from "../../../../../../core/geom/3d/aabb/AABB3.js";
|
|
5
5
|
import { ParticleParameters } from "./ParticleParameters.js";
|
|
6
6
|
import { ConicRay } from "../../../../../../core/geom/ConicRay.js";
|
|
7
7
|
import { SimulationStepDefinition } from "../simulator/SimulationStepDefinition.js";
|
|
@@ -3,7 +3,7 @@ import { MouseEvents } from "../../../../input/devices/events/MouseEvents.js";
|
|
|
3
3
|
import { readPositionFromMouseEvent } from "../../../../input/devices/PointerDevice.js";
|
|
4
4
|
import Vector2 from "../../../../../core/geom/Vector2.js";
|
|
5
5
|
import { VisualTip } from "../../../../../view/tooltip/VisualTip.js";
|
|
6
|
-
import Rectangle from "../../../../../core/geom/Rectangle.js";
|
|
6
|
+
import Rectangle from "../../../../../core/geom/2d/Rectangle.js";
|
|
7
7
|
import LabelView from "../../../../../view/common/LabelView.js";
|
|
8
8
|
import { CanvasView } from "../../../../../view/elements/CanvasView.js";
|
|
9
9
|
import EmptyView from "../../../../../view/elements/EmptyView.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IncrementalDeltaSet } from "../visibility/IncrementalDeltaSet.js";
|
|
2
|
-
import { AABB3 } from "../../../../core/
|
|
2
|
+
import { AABB3 } from "../../../../core/geom/3d/aabb/AABB3.js";
|
|
3
3
|
import { CameraViewFlags } from "./CameraViewFlags.js";
|
|
4
4
|
import { Frustum } from "three";
|
|
5
5
|
import { read_frustum_planes_to_array } from "../../../../core/geom/3d/frustum/read_frustum_planes_to_array.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Vector2 from "../../../../core/geom/Vector2.js";
|
|
2
|
-
import Rectangle from "../../../../core/geom/Rectangle.js";
|
|
3
|
-
import AABB2 from "../../../../core/geom/AABB2.js";
|
|
2
|
+
import Rectangle from "../../../../core/geom/2d/Rectangle.js";
|
|
3
|
+
import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js";
|
|
4
4
|
|
|
5
5
|
export class AtlasPatch {
|
|
6
6
|
constructor() {
|
|
@@ -2,7 +2,7 @@ import { TextureAtlas } from "./TextureAtlas.js";
|
|
|
2
2
|
import { Sampler2D } from "../sampler/Sampler2D.js";
|
|
3
3
|
import { AtlasPatchFlag } from "./AtlasPatchFlag.js";
|
|
4
4
|
import { AtlasPatch } from "./AtlasPatch.js";
|
|
5
|
-
import {
|
|
5
|
+
import { aabb2_overlap_exists } from "../../../../core/geom/2d/aabb/aabb2_overlap_exists.js";
|
|
6
6
|
|
|
7
7
|
expect.extend({
|
|
8
8
|
toBeContainedInAtlas(patch, atlas) {
|
|
@@ -204,7 +204,7 @@ function isPackingValid(patches, atlas) {
|
|
|
204
204
|
const _x1 = _x0 + patch1.size.x + patch1.padding * 2;
|
|
205
205
|
const _y1 = _y0 + patch1.size.y + patch1.padding * 2;
|
|
206
206
|
|
|
207
|
-
if (
|
|
207
|
+
if (aabb2_overlap_exists(x0, y0, x1, y1, _x0, _y0, _x1, _y1)) {
|
|
208
208
|
return false;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
@@ -11,7 +11,7 @@ import { rootObject3DFastMatrixUpdate } from "../ecs/mesh/rootObject3DFastMatrix
|
|
|
11
11
|
import { camera_compute_distance_to_fit_length } from "../camera/camera_compute_distance_to_fit_length.js";
|
|
12
12
|
import { scaleObject3ToBox } from "./ScaleObject3ToBox.js";
|
|
13
13
|
import { DEG_TO_RAD } from "../../../core/math/DEG_TO_RAD.js";
|
|
14
|
-
import AABB2 from "../../../core/geom/AABB2.js";
|
|
14
|
+
import AABB2 from "../../../core/geom/2d/aabb/AABB2.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LinearFilter, RGBAFormat, WebGLRenderTarget } from "three";
|
|
2
|
-
import AABB2 from "../../../core/geom/AABB2.js";
|
|
2
|
+
import AABB2 from "../../../core/geom/2d/aabb/AABB2.js";
|
|
3
3
|
import Vector2 from "../../../core/geom/Vector2.js";
|
|
4
4
|
import { WebGLRendererPool } from "../render/RendererPool.js";
|
|
5
5
|
import { makeMeshPreviewScene } from "./makeMeshPreviewScene.js";
|
|
@@ -3,7 +3,8 @@ import { max2 } from "../../../core/math/max2.js";
|
|
|
3
3
|
import { min2 } from "../../../core/math/min2.js";
|
|
4
4
|
import { TileMoveProgram } from "./TileMoveProgram.js";
|
|
5
5
|
import { TileMoveInstruction } from "./TileMoveInstruction.js";
|
|
6
|
-
import {
|
|
6
|
+
import { aabb2_overlap_exists } from "../../../core/geom/2d/aabb/aabb2_overlap_exists.js";
|
|
7
|
+
import { aabb2_contains } from "../../../core/geom/2d/aabb/aabb2_contains.js";
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -121,7 +122,7 @@ export function computeTileGridMove(tile, targetX, targetY, source, target) {
|
|
|
121
122
|
const x1 = x0 + sourceTile.size.x;
|
|
122
123
|
const y1 = y0 + sourceTile.size.y;
|
|
123
124
|
|
|
124
|
-
if (!
|
|
125
|
+
if (!aabb2_overlap_exists(sourceOcclusionRegionX0, sourceOcclusionRegionY0, sourceOcclusionRegionX1, sourceOcclusionRegionY1, x0, y0, x1, y1)) {
|
|
125
126
|
//tile is outside of the transfer area
|
|
126
127
|
continue;
|
|
127
128
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import TileGrid from "./TileGrid.js";
|
|
2
|
-
import Rectangle from "../../../core/geom/Rectangle.js";
|
|
2
|
+
import Rectangle from "../../../core/geom/2d/Rectangle.js";
|
|
3
3
|
import { computeTileGridMove } from "./computeTileGridMove.js";
|
|
4
4
|
|
|
5
5
|
test("move to empty space works as intended", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Sampler2D } from "../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
2
|
-
import AABB2 from "../../core/geom/AABB2.js";
|
|
2
|
+
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
3
3
|
import { computeUnsignedDistanceField } from "../../engine/graphics/texture/sampler/distanceField.js";
|
|
4
4
|
|
|
5
5
|
export class AreaMask {
|
package/src/view/View.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import Vector2 from "../core/geom/Vector2.js";
|
|
7
7
|
|
|
8
|
-
import AABB2 from "../core/geom/AABB2.js";
|
|
8
|
+
import AABB2 from "../core/geom/2d/aabb/AABB2.js";
|
|
9
9
|
import Signal from "../core/events/signal/Signal.js";
|
|
10
10
|
import { SignalBinding } from "../core/events/signal/SignalBinding.js";
|
|
11
11
|
import { assert } from "../core/assert.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import View from "../../View.js";
|
|
2
2
|
import SVG from "../../SVG.js";
|
|
3
|
-
import { line2_line2_intersection } from "../../../core/geom/LineSegment2.js";
|
|
3
|
+
import { line2_line2_intersection } from "../../../core/geom/2d/LineSegment2.js";
|
|
4
4
|
import Vector1 from "../../../core/geom/Vector1.js";
|
|
5
5
|
|
|
6
6
|
export class RectangularPieProgressView extends View {
|
|
@@ -12,7 +12,7 @@ import { Camera } from "../../engine/graphics/ecs/camera/Camera.js";
|
|
|
12
12
|
import { PointerDevice } from "../../engine/input/devices/PointerDevice.js";
|
|
13
13
|
import TopDownCameraController from "../../engine/graphics/ecs/camera/topdown/TopDownCameraController.js";
|
|
14
14
|
import { MinimapMarkersGL } from "./gl/MinimapMarkersGL.js";
|
|
15
|
-
import Rectangle from "../../core/geom/Rectangle.js";
|
|
15
|
+
import Rectangle from "../../core/geom/2d/Rectangle.js";
|
|
16
16
|
import { EntityObserver } from "../../engine/ecs/EntityObserver.js";
|
|
17
17
|
import { Transform } from "../../engine/ecs/transform/Transform.js";
|
|
18
18
|
import { MinimapWorldGL } from "./gl/MinimapWorldGL.js";
|
|
@@ -4,7 +4,7 @@ import { Mesh, PlaneBufferGeometry } from "three";
|
|
|
4
4
|
import { buildScreenSpaceFogOfWarShader } from "../../../engine/ecs/fow/shader/screenSpaceFogOfWarShader.js";
|
|
5
5
|
import { computeUvTransformFromFogOfWar } from "../../../engine/ecs/fow/shader/FogOfWarRenderer.js";
|
|
6
6
|
import { SignalBinding } from "../../../core/events/signal/SignalBinding.js";
|
|
7
|
-
import AABB2 from "../../../core/geom/AABB2.js";
|
|
7
|
+
import AABB2 from "../../../core/geom/2d/aabb/AABB2.js";
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Rectangle from "../../core/geom/Rectangle.js";
|
|
1
|
+
import Rectangle from "../../core/geom/2d/Rectangle.js";
|
|
2
2
|
import { VisualTip } from "./VisualTip.js";
|
|
3
3
|
import Signal from "../../core/events/signal/Signal.js";
|
|
4
4
|
import ObservedBoolean from "../../core/model/ObservedBoolean.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EmptyView from "../elements/EmptyView.js";
|
|
2
|
-
import AABB2 from "../../core/geom/AABB2.js";
|
|
2
|
+
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
3
3
|
import Task from "../../core/process/task/Task.js";
|
|
4
4
|
import ConcurrentExecutor from "../../core/process/executor/ConcurrentExecutor.js";
|
|
5
5
|
import { TaskSignal } from "../../core/process/task/TaskSignal.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import View from "../View.js";
|
|
2
2
|
import Vector2 from "../../core/geom/Vector2.js";
|
|
3
|
-
import AABB2 from "../../core/geom/AABB2.js";
|
|
3
|
+
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
4
4
|
import { CompassArrowView } from "../elements/CompassArrowView.js";
|
|
5
5
|
import EmptyView from "../elements/EmptyView.js";
|
|
6
6
|
import { forceIntoBox } from "../../core/graph/layout/box/forceIntoBox.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Rectangle from "../../core/geom/Rectangle.js";
|
|
2
|
-
import AABB2 from "../../core/geom/AABB2.js";
|
|
1
|
+
import Rectangle from "../../core/geom/2d/Rectangle.js";
|
|
2
|
+
import AABB2 from "../../core/geom/2d/aabb/AABB2.js";
|
|
3
3
|
import { assert } from "../../core/assert.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { max3 } from "../../math/max3.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {number} x0
|
|
6
|
-
* @param {number} y0
|
|
7
|
-
* @param {number} x1
|
|
8
|
-
* @param {number} y1
|
|
9
|
-
* @param {number} px
|
|
10
|
-
* @param {number} py
|
|
11
|
-
* @returns {number}
|
|
12
|
-
*/
|
|
13
|
-
export function aabb2_distanceToPoint(x0, y0, x1, y1, px, py) {
|
|
14
|
-
const sqrD = aabb2_sqrDistanceToPoint(x0, y0, x1, y1, px, py);
|
|
15
|
-
return Math.sqrt(sqrD);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @param {number} x0
|
|
21
|
-
* @param {number} y0
|
|
22
|
-
* @param {number} x1
|
|
23
|
-
* @param {number} y1
|
|
24
|
-
* @param {number} px
|
|
25
|
-
* @param {number} py
|
|
26
|
-
* @returns {number}
|
|
27
|
-
*/
|
|
28
|
-
export function aabb2_sqrDistanceToPoint(x0, y0, x1, y1, px, py) {
|
|
29
|
-
|
|
30
|
-
const dxLeft = x0 - px;
|
|
31
|
-
const dxRight = px - x1;
|
|
32
|
-
|
|
33
|
-
const dyTop = y0 - py;
|
|
34
|
-
const dyBottom = py - y1;
|
|
35
|
-
|
|
36
|
-
var dx = max3(dxLeft, 0, dxRight);
|
|
37
|
-
var dy = max3(dyTop, 0, dyBottom);
|
|
38
|
-
|
|
39
|
-
return dx * dx + dy * dy;
|
|
40
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { aabb2_distanceToPoint } from "./AABB2Math.js";
|
|
2
|
-
|
|
3
|
-
test('aabb2_distanceToPoint', () => {
|
|
4
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 0, 0)).toBeCloseTo(0);
|
|
5
|
-
|
|
6
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 1, 0)).toBeCloseTo(1);
|
|
7
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 0, 1)).toBeCloseTo(1);
|
|
8
|
-
|
|
9
|
-
expect(aabb2_distanceToPoint(0, 0, 0, 0, 1, 1)).toBeCloseTo(1.41421356237);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 2, 0.5)).toBeCloseTo(1);
|
|
13
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 0.5, 2)).toBeCloseTo(1);
|
|
14
|
-
|
|
15
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, -1, 0.5)).toBeCloseTo(1);
|
|
16
|
-
expect(aabb2_distanceToPoint(0, 0, 1, 1, 0.5, -1)).toBeCloseTo(1);
|
|
17
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|