@woosh/meep-engine 2.50.0 → 2.50.2
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/README.md +39 -0
- package/editor/Editor.js +5 -1
- package/editor/SelectionVisualizer.js +9 -3
- package/editor/tools/paint/TerrainTexturePaintTool.js +6 -1
- package/editor/view/EditorView.js +5 -1
- package/editor/view/ecs/EntityList.js +48 -37
- package/editor/view/makeEntityDecorators.js +125 -0
- package/package.json +7 -3
- package/samples/generation/README.md +6 -0
- package/{src/generation/example → samples/generation}/SampleGenerator0.js +60 -46
- package/{src/generation/example → samples/generation}/filters/SampleGroundMoistureFilter.js +14 -12
- package/samples/generation/filters/SampleNoise20_0.js +3 -0
- package/{src/generation/example → samples/generation}/generators/interactive/mir_generator_place_buff_objects.js +29 -23
- package/{src/generation/example → samples/generation}/generators/mir_generator_place_bases.js +33 -25
- package/{src/generation/example → samples/generation}/generators/mir_generator_place_road_decorators.js +16 -14
- package/samples/generation/generators/mir_generator_place_starting_point.js +60 -0
- package/{src/generation/example → samples/generation}/grid/configureMirGrid.js +2 -2
- package/{src/generation/example → samples/generation}/main.js +29 -28
- package/{src/generation/example → samples/generation}/rules/matcher_not_play_area.js +1 -1
- package/samples/generation/rules/matcher_play_area.js +5 -0
- package/{src/generation/example → samples/generation}/rules/matcher_tag_not_traversable.js +1 -1
- package/samples/generation/rules/matcher_tag_occupied.js +5 -0
- package/samples/generation/rules/matcher_tag_traversable.js +5 -0
- package/{src/generation/example → samples/generation}/rules/matcher_tag_traversable_unoccupied.js +1 -1
- package/{src/generation/example → samples/generation}/rules/matcher_tag_unoccupied.js +1 -1
- package/{src/generation/example → samples/generation}/rules/mir_matcher_attack_corridor.js +3 -3
- package/{src/generation/example → samples/generation}/themes/SampleTheme0.js +57 -47
- package/{src/generation/example → samples/generation}/themes/SampleTheme1.js +4 -4
- package/{src/generation/example → samples/generation}/themes/SampleTheme2.js +4 -4
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +4 -4
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +5 -5
- package/src/core/geom/3d/plane/is_point_within_planes.js +1 -1
- package/src/core/geom/3d/plane/lerp_planes_to_array.js +2 -0
- package/src/core/geom/3d/plane/{plane_computeConvex3PlaneIntersection.js → plane3_compute_convex_3_plane_intersection.js} +1 -1
- package/src/core/geom/3d/plane/{plane3_computeLineSegmentIntersection.js → plane3_compute_line_segment_intersection.js} +1 -1
- package/src/core/geom/3d/plane/{computePlanePlaneIntersection.js → plane3_compute_plane_intersection.js} +15 -11
- package/src/core/geom/3d/plane/{computePlaneLineIntersection.js → plane3_compute_ray_intersection.js} +5 -1
- package/src/core/geom/3d/plane/plane3_intersect_plane.js +14 -0
- package/src/core/geom/3d/plane/{plane_three_compute_convex3_plane_intersection.js → plane3_three_compute_convex_3_plane_intersection.js} +7 -4
- package/src/core/geom/3d/plane/planeRayIntersection.js +2 -2
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +5 -5
- package/src/core/geom/Vector3.d.ts +4 -2
- package/src/engine/ecs/EntityBlueprint.d.ts +14 -0
- package/src/engine/ecs/EntityBlueprint.js +2 -2
- package/src/engine/ecs/EntityBlueprint.spec.js +52 -0
- package/src/engine/ecs/EntityBuilder.js +8 -0
- package/src/engine/ecs/EntityManager.d.ts +1 -0
- package/src/engine/ecs/EntityManager.js +16 -8
- package/src/engine/ecs/EntityManager.spec.js +62 -1
- package/src/engine/ecs/System.js +8 -2
- package/src/engine/ecs/{Blueprint.js → storage/json/Blueprint.js} +1 -1
- package/src/engine/ecs/{EntityFactory.js → storage/json/EntityFactory.js} +1 -1
- package/src/engine/ecs/storage/{JSONDeSerializer.js → json/JSONDeSerializer.js} +4 -4
- package/src/engine/ecs/storage/json/README.md +5 -0
- package/src/engine/graphics/ecs/camera/Camera.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.spec.js +5 -0
- package/src/engine/graphics/ecs/path/entity/EntityPath.js +1 -1
- package/src/engine/graphics/render/forward_plus/computeFrustumCorners.js +10 -10
- package/src/engine/graphics/render/layers/RenderLayerUtils.js +3 -3
- package/src/engine/intelligence/behavior/Behavior.d.ts +5 -0
- package/src/engine/intelligence/behavior/Behavior.js +19 -0
- package/src/engine/intelligence/behavior/SelectorBehavior.js +4 -2
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +2 -0
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +3 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +2 -3
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +2 -2
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +1 -1
- package/src/engine/scene/SceneManager.spec.js +24 -0
- package/src/generation/grid/GridData.js +8 -2
- package/src/generation/grid/GridData.spec.js +5 -0
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +1 -1
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +2 -2
- package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +1 -1
- package/src/view/common/VirtualListView.js +2 -0
- package/src/view/minimap/dom/MinimapCameraView.js +3 -3
- package/src/core/geom/3d/plane/computePlaneRayIntersection.js +0 -55
- package/src/generation/example/filters/SampleNoise20_0.js +0 -3
- package/src/generation/example/generators/mir_generator_place_starting_point.js +0 -52
- package/src/generation/example/rules/matcher_play_area.js +0 -5
- package/src/generation/example/rules/matcher_tag_occupied.js +0 -5
- package/src/generation/example/rules/matcher_tag_traversable.js +0 -5
- package/src/generation/grid/MarkerMatchCounter.js +0 -25
- /package/{src/generation/example → samples/generation}/grid/MirGridLayers.js +0 -0
- /package/src/engine/ecs/storage/{JSONSerializer.js → json/JSONSerializer.js} +0 -0
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
import { CellMatcherGridPattern } from "
|
|
1
|
+
import { CellMatcherGridPattern } from "../../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
2
2
|
import { matcher_tag_traversable_unoccupied } from "../../rules/matcher_tag_traversable_unoccupied.js";
|
|
3
|
-
import { CellMatcherNot } from "
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
3
|
+
import { CellMatcherNot } from "../../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
4
|
+
import {
|
|
5
|
+
CellMatcherContainsMarkerWithinRadius
|
|
6
|
+
} from "../../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
7
|
+
import { GridCellActionPlaceTags } from "../../../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
8
|
+
import { GridTags } from "../../../../src/generation/GridTags.js";
|
|
9
|
+
import { bitwiseAnd } from "../../../../src/core/binary/operations/bitwiseAnd.js";
|
|
10
|
+
import { GridCellActionPlaceMarker } from "../../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
11
|
+
import { GridCellPlacementRule } from "../../../../src/generation/placement/GridCellPlacementRule.js";
|
|
12
|
+
import {
|
|
13
|
+
GridTaskActionRuleSet
|
|
14
|
+
} from "../../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js";
|
|
15
|
+
import { GridActionRuleSet } from "../../../../src/generation/markers/GridActionRuleSet.js";
|
|
16
|
+
import { GridCellActionPlaceMarkerGroup } from "../../../../src/generation/markers/GridCellActionPlaceMarkerGroup.js";
|
|
13
17
|
import { matcher_tag_not_traversable } from "../../rules/matcher_tag_not_traversable.js";
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
MarkerNodeMatcherContainsTag
|
|
20
|
+
} from "../../../../src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js";
|
|
21
|
+
import { CellMatcherAnd } from "../../../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
22
|
+
import { MarkerNodeMatcherByType } from "../../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
23
|
+
import { CellMatcherOr } from "../../../../src/generation/rules/logic/CellMatcherOr.js";
|
|
24
|
+
import { RuleSelectionPolicyType } from "../../../../src/generation/markers/RuleSelectionPolicyType.js";
|
|
25
|
+
import { MarkerNodeMatcherAnd } from "../../../../src/generation/markers/matcher/MarkerNodeMatcherAnd.js";
|
|
20
26
|
import { MirGridLayers } from "../../grid/MirGridLayers.js";
|
|
21
|
-
import { CellFilterLiteralFloat } from "
|
|
22
|
-
import { MirMarkerTypes } from "
|
|
23
|
-
import { GridPatternMatcherCell } from "
|
|
24
|
-
import { BuffObjectTypes } from "
|
|
25
|
-
import { UnlockableElementsManager } from "
|
|
26
|
-
import { GridCellActionSequence } from "
|
|
27
|
+
import { CellFilterLiteralFloat } from "../../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
28
|
+
import { MirMarkerTypes } from "../../../../../generator/MirMarkerTypes.js";
|
|
29
|
+
import { GridPatternMatcherCell } from "../../../../src/generation/rules/cell/GridPatternMatcherCell.js";
|
|
30
|
+
import { BuffObjectTypes } from "../../../../../../generator/BuffObjectTypes.js";
|
|
31
|
+
import { UnlockableElementsManager } from "../../../../../../model/unlocks/UnlockableElementsManager.js";
|
|
32
|
+
import { GridCellActionSequence } from "../../../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
27
33
|
|
|
28
34
|
const TAG_MAJOR = 'Major Buff';
|
|
29
35
|
const TAG_MINOR = 'Minor Buff';
|
package/{src/generation/example → samples/generation}/generators/mir_generator_place_bases.js
RENAMED
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
import { GridTaskActionRuleSet } from "
|
|
2
|
-
import { GridCellPlacementRule } from "
|
|
3
|
-
import { CellMatcherGridPattern } from "
|
|
4
|
-
import { GridActionRuleSet } from "
|
|
5
|
-
import { GridCellActionPlaceTags } from "
|
|
6
|
-
import { GridTags } from "
|
|
7
|
-
import { GridCellActionPlaceMarker } from "
|
|
8
|
-
import { CellMatcherNot } from "
|
|
9
|
-
import {
|
|
1
|
+
import { GridTaskActionRuleSet } from "../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js";
|
|
2
|
+
import { GridCellPlacementRule } from "../../../src/generation/placement/GridCellPlacementRule.js";
|
|
3
|
+
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
4
|
+
import { GridActionRuleSet } from "../../../src/generation/markers/GridActionRuleSet.js";
|
|
5
|
+
import { GridCellActionPlaceTags } from "../../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
6
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
7
|
+
import { GridCellActionPlaceMarker } from "../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
8
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
9
|
+
import {
|
|
10
|
+
CellMatcherContainsMarkerWithinRadius
|
|
11
|
+
} from "../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
10
12
|
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
11
|
-
import { bitwiseAnd } from "../../../core/binary/operations/bitwiseAnd.js";
|
|
12
|
-
import { GridCellActionPlaceMarkerGroup } from "
|
|
13
|
-
import { MarkerNodeMatcherByType } from "
|
|
13
|
+
import { bitwiseAnd } from "../../../src/core/binary/operations/bitwiseAnd.js";
|
|
14
|
+
import { GridCellActionPlaceMarkerGroup } from "../../../src/generation/markers/GridCellActionPlaceMarkerGroup.js";
|
|
15
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
14
16
|
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
15
|
-
import { CellFilterLiteralFloat } from "
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
18
|
+
import {
|
|
19
|
+
MarkerNodeEmitterGridCellAction
|
|
20
|
+
} from "../../../src/generation/markers/emitter/MarkerNodeEmitterGridCellAction.js";
|
|
21
|
+
import { MarkerNodeEmitterPredicated } from "../../../src/generation/markers/emitter/MarkerNodeEmitterPredicated.js";
|
|
22
|
+
import { GridDataNodePredicateNot } from "../../../src/generation/markers/predicate/GridDataNodePredicateNot.js";
|
|
23
|
+
import {
|
|
24
|
+
GridDataNodePredicateOverlaps
|
|
25
|
+
} from "../../../src/generation/markers/predicate/GridDataNodePredicateOverlaps.js";
|
|
26
|
+
import { MarkerNodeMatcherAny } from "../../../src/generation/markers/matcher/MarkerNodeMatcherAny.js";
|
|
27
|
+
import { MarkerNodeEmitterFromAction } from "../../../src/generation/markers/emitter/MarkerNodeEmitterFromAction.js";
|
|
28
|
+
import { Transform } from "../../../src/engine/ecs/transform/Transform.js";
|
|
29
|
+
import {
|
|
30
|
+
MarkerNodeTransformerOffsetPosition
|
|
31
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js";
|
|
24
32
|
import {
|
|
25
33
|
MarkerNodeTransformerRecordUniqueRandomEnum
|
|
26
|
-
} from "
|
|
27
|
-
import { MirMarkerTypes } from "
|
|
28
|
-
import { MirMarkerTags } from "
|
|
29
|
-
import { GridCellActionSequence } from "
|
|
34
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js";
|
|
35
|
+
import { MirMarkerTypes } from "../../../../generator/MirMarkerTypes.js";
|
|
36
|
+
import { MirMarkerTags } from "../../../../generator/MirMarkerTags.js";
|
|
37
|
+
import { GridCellActionSequence } from "../../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
30
38
|
|
|
31
39
|
const pMatcher = new CellMatcherGridPattern();
|
|
32
40
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { GridTaskActionRuleSet } from "
|
|
2
|
-
import { GridActionRuleSet } from "
|
|
3
|
-
import { GridCellPlacementRule } from "
|
|
4
|
-
import { CellMatcherGridPattern } from "
|
|
5
|
-
import { CellMatcherLayerBitMaskTest } from "
|
|
6
|
-
import { GridTags } from "
|
|
7
|
-
import { CellMatcherAnd } from "
|
|
8
|
-
import { CellMatcherNot } from "
|
|
9
|
-
import { GridCellActionPlaceMarker } from "
|
|
1
|
+
import { GridTaskActionRuleSet } from "../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js";
|
|
2
|
+
import { GridActionRuleSet } from "../../../src/generation/markers/GridActionRuleSet.js";
|
|
3
|
+
import { GridCellPlacementRule } from "../../../src/generation/placement/GridCellPlacementRule.js";
|
|
4
|
+
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
5
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
6
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
7
|
+
import { CellMatcherAnd } from "../../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
8
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
9
|
+
import { GridCellActionPlaceMarker } from "../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
10
10
|
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
CellMatcherContainsMarkerWithinRadius
|
|
13
|
+
} from "../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
14
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
15
|
+
import { MarkerNodeMatcherContainsTag } from "../../../src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js";
|
|
16
|
+
import { MarkerNodeMatcherAny } from "../../../src/generation/markers/matcher/MarkerNodeMatcherAny.js";
|
|
15
17
|
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
16
|
-
import { CellFilterLiteralFloat } from "
|
|
18
|
+
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
17
19
|
|
|
18
20
|
|
|
19
21
|
const matcher_tag_road = CellMatcherLayerBitMaskTest.from(GridTags.Road, MirGridLayers.Tags);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { GridCellPlacementRule } from "../../../src/generation/placement/GridCellPlacementRule.js";
|
|
2
|
+
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
3
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
4
|
+
import { GridCellActionPlaceTags } from "../../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
5
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
6
|
+
import { GridCellActionPlaceMarker } from "../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
7
|
+
import { GridTaskExecuteRuleTimes } from "../../../src/generation/grid/generation/GridTaskExecuteRuleTimes.js";
|
|
8
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
9
|
+
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
10
|
+
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
11
|
+
import {
|
|
12
|
+
GridCellActionTransformNearbyMarkers
|
|
13
|
+
} from "../../../src/generation/placement/GridCellActionTransformNearbyMarkers.js";
|
|
14
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
15
|
+
import {
|
|
16
|
+
MarkerNodeTransformerRecordProperty
|
|
17
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js";
|
|
18
|
+
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
19
|
+
import { MirMarkerTypes } from "../../../../generator/MirMarkerTypes.js";
|
|
20
|
+
import {
|
|
21
|
+
MarkerNodeTransformerRemoveTag
|
|
22
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerRemoveTag.js";
|
|
23
|
+
import { MirMarkerTags } from "../../../../generator/MirMarkerTags.js";
|
|
24
|
+
import {
|
|
25
|
+
MarkerNodeTransformerSequence
|
|
26
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerSequence.js";
|
|
27
|
+
import { GridCellActionSequence } from "../../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
28
|
+
|
|
29
|
+
const MATCH_STARTING_POINT = CellMatcherLayerBitMaskTest.from(GridTags.StartingPoint, MirGridLayers.Tags);
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
const pattern = new CellMatcherGridPattern();
|
|
33
|
+
|
|
34
|
+
pattern.addRule(0, 0, matcher_tag_traversable_unoccupied);
|
|
35
|
+
pattern.addRule(0, 0, CellMatcherNot.from(MATCH_STARTING_POINT));
|
|
36
|
+
// NEXT TO A BASE
|
|
37
|
+
pattern.addRule(0, -1, CellMatcherLayerBitMaskTest.from(GridTags.Base, MirGridLayers.Tags));
|
|
38
|
+
|
|
39
|
+
const rule = GridCellPlacementRule.from(
|
|
40
|
+
{
|
|
41
|
+
matcher: pattern,
|
|
42
|
+
action: GridCellActionSequence.from([
|
|
43
|
+
GridCellActionPlaceTags.from(GridTags.StartingPoint | GridTags.Occupied, MirGridLayers.Tags),
|
|
44
|
+
GridCellActionPlaceMarker.from({ type: MirMarkerTypes.StartingPoint }),
|
|
45
|
+
// transfer ownership of any base within some distance to the player
|
|
46
|
+
GridCellActionTransformNearbyMarkers.from(
|
|
47
|
+
5,
|
|
48
|
+
MarkerNodeMatcherByType.from(MirMarkerTypes.Base),
|
|
49
|
+
MarkerNodeTransformerSequence.from([
|
|
50
|
+
MarkerNodeTransformerRecordProperty.from('team', CellFilterLiteralFloat.from(0)),
|
|
51
|
+
MarkerNodeTransformerRemoveTag.from(MirMarkerTags.Encounter)
|
|
52
|
+
])
|
|
53
|
+
)
|
|
54
|
+
])
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
rule.allowRotation = true;
|
|
59
|
+
|
|
60
|
+
export const mir_generator_place_starting_point = () => GridTaskExecuteRuleTimes.from(rule, 1);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GridDataLayer } from "
|
|
1
|
+
import { GridDataLayer } from "../../../src/generation/grid/layers/GridDataLayer.js";
|
|
2
2
|
import { MirGridLayers } from "./MirGridLayers.js";
|
|
3
|
-
import { BinaryDataType } from "../../../core/binary/type/BinaryDataType.js";
|
|
3
|
+
import { BinaryDataType } from "../../../src/core/binary/type/BinaryDataType.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { EngineHarness } from "../../engine/EngineHarness.js";
|
|
2
|
-
import RenderSystem from "../../engine/ecs/systems/RenderSystem.js";
|
|
3
|
-
import { Camera } from "../../engine/graphics/ecs/camera/Camera.js";
|
|
4
|
-
import TopDownCameraController from "../../engine/graphics/ecs/camera/topdown/TopDownCameraController.js";
|
|
5
|
-
import Vector3 from "../../core/geom/Vector3.js";
|
|
6
|
-
import { TopDownCameraLander } from "../../engine/graphics/ecs/camera/topdown/TopDownCameraLander.js";
|
|
7
|
-
import Terrain from "../../engine/ecs/terrain/ecs/Terrain.js";
|
|
8
|
-
import { TerrainFlags } from "../../engine/ecs/terrain/ecs/TerrainFlags.js";
|
|
9
|
-
import Water from "../../engine/graphics/ecs/water/Water.js";
|
|
10
|
-
import GridObstacle from "../../engine/grid/components/GridObstacle.js";
|
|
11
|
-
import EntityBuilder from "../../engine/ecs/EntityBuilder.js";
|
|
12
|
-
import GridPosition from "../../engine/grid/components/GridPosition.js";
|
|
13
|
-
import { Transform } from "../../engine/ecs/transform/Transform.js";
|
|
14
|
-
import { GridData } from "
|
|
15
|
-
import { computeStringHash } from "../../core/primitives/strings/computeStringHash.js";
|
|
16
|
-
import { ThemeEngine } from "
|
|
17
|
-
import { AreaTheme } from "
|
|
18
|
-
import TaskGroup from "../../core/process/task/TaskGroup.js";
|
|
19
|
-
import { generateTerrainPreview } from "
|
|
1
|
+
import { EngineHarness } from "../../src/engine/EngineHarness.js";
|
|
2
|
+
import RenderSystem from "../../src/engine/ecs/systems/RenderSystem.js";
|
|
3
|
+
import { Camera } from "../../src/engine/graphics/ecs/camera/Camera.js";
|
|
4
|
+
import TopDownCameraController from "../../src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js";
|
|
5
|
+
import Vector3 from "../../src/core/geom/Vector3.js";
|
|
6
|
+
import { TopDownCameraLander } from "../../src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.js";
|
|
7
|
+
import Terrain from "../../src/engine/ecs/terrain/ecs/Terrain.js";
|
|
8
|
+
import { TerrainFlags } from "../../src/engine/ecs/terrain/ecs/TerrainFlags.js";
|
|
9
|
+
import Water from "../../src/engine/graphics/ecs/water/Water.js";
|
|
10
|
+
import GridObstacle from "../../src/engine/grid/components/GridObstacle.js";
|
|
11
|
+
import EntityBuilder from "../../src/engine/ecs/EntityBuilder.js";
|
|
12
|
+
import GridPosition from "../../src/engine/grid/components/GridPosition.js";
|
|
13
|
+
import { Transform } from "../../src/engine/ecs/transform/Transform.js";
|
|
14
|
+
import { GridData } from "../../src/generation/grid/GridData.js";
|
|
15
|
+
import { computeStringHash } from "../../src/core/primitives/strings/computeStringHash.js";
|
|
16
|
+
import { ThemeEngine } from "../../src/generation/theme/ThemeEngine.js";
|
|
17
|
+
import { AreaTheme } from "../../src/generation/theme/AreaTheme.js";
|
|
18
|
+
import TaskGroup from "../../src/core/process/task/TaskGroup.js";
|
|
19
|
+
import { generateTerrainPreview } from "../../../../generator/generator/generateTerrainPreview.js";
|
|
20
20
|
import { SampleTheme0 } from "./themes/SampleTheme0.js";
|
|
21
21
|
import { SampleGenerator0 } from "./SampleGenerator0.js";
|
|
22
22
|
import { configureMirGrid } from "./grid/configureMirGrid.js";
|
|
23
|
-
import { EngineConfiguration } from "../../engine/EngineConfiguration.js";
|
|
24
|
-
import TerrainSystem from "../../engine/ecs/terrain/ecs/TerrainSystem.js";
|
|
25
|
-
import WaterSystem from "../../engine/graphics/ecs/water/WaterSystem.js";
|
|
26
|
-
import { MeshSystem } from "../../engine/graphics/ecs/mesh/MeshSystem.js";
|
|
27
|
-
import TopDownCameraControllerSystem
|
|
28
|
-
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
23
|
+
import { EngineConfiguration } from "../../src/engine/EngineConfiguration.js";
|
|
24
|
+
import TerrainSystem from "../../src/engine/ecs/terrain/ecs/TerrainSystem.js";
|
|
25
|
+
import WaterSystem from "../../src/engine/graphics/ecs/water/WaterSystem.js";
|
|
26
|
+
import { MeshSystem } from "../../src/engine/graphics/ecs/mesh/MeshSystem.js";
|
|
27
|
+
import TopDownCameraControllerSystem
|
|
28
|
+
from "../../src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js";
|
|
29
|
+
import { TopDownCameraLanderSystem } from "../../src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js";
|
|
30
|
+
import LightSystem from "../../src/engine/graphics/ecs/light/LightSystem.js";
|
|
31
|
+
import { TaskLoadingScreen } from "../../src/view/task/TaskLoadingScreen.js";
|
|
32
|
+
import { actionTask } from "../../src/core/process/task/util/actionTask.js";
|
|
32
33
|
|
|
33
34
|
function makeEngineConfig(engine) {
|
|
34
35
|
const config = new EngineConfiguration();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellMatcherNot } from "
|
|
1
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
2
2
|
import { matcher_play_area } from "./matcher_play_area.js";
|
|
3
3
|
|
|
4
4
|
export const matcher_not_play_area = CellMatcherNot.from(matcher_play_area);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
2
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
3
|
+
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
4
|
+
|
|
5
|
+
export const matcher_play_area = CellMatcherLayerBitMaskTest.from(GridTags.PlayArea, MirGridLayers.Tags);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellMatcherNot } from "
|
|
1
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
2
2
|
import { matcher_tag_traversable } from "./matcher_tag_traversable.js";
|
|
3
3
|
|
|
4
4
|
export const matcher_tag_not_traversable = CellMatcherNot.from(matcher_tag_traversable);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
2
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
3
|
+
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
4
|
+
|
|
5
|
+
export const matcher_tag_occupied = CellMatcherLayerBitMaskTest.from(GridTags.Occupied, MirGridLayers.Tags);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
2
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
3
|
+
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
4
|
+
|
|
5
|
+
export const matcher_tag_traversable = CellMatcherLayerBitMaskTest.from(GridTags.Traversable, MirGridLayers.Tags);
|
package/{src/generation/example → samples/generation}/rules/matcher_tag_traversable_unoccupied.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellMatcherAnd } from "
|
|
1
|
+
import { CellMatcherAnd } from "../../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
2
2
|
import { matcher_tag_traversable } from "./matcher_tag_traversable.js";
|
|
3
3
|
import { matcher_tag_unoccupied } from "./matcher_tag_unoccupied.js";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellMatcherNot } from "
|
|
1
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
2
2
|
import { matcher_tag_occupied } from "./matcher_tag_occupied.js";
|
|
3
3
|
|
|
4
4
|
export const matcher_tag_unoccupied = CellMatcherNot.from(matcher_tag_occupied);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CellMatcherGridPattern } from "
|
|
1
|
+
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
2
2
|
import { matcher_tag_not_traversable } from "./matcher_tag_not_traversable.js";
|
|
3
3
|
import { matcher_tag_traversable_unoccupied } from "./matcher_tag_traversable_unoccupied.js";
|
|
4
|
-
import { CellMatcherOr } from "
|
|
5
|
-
import { GridPatternMatcherCell } from "
|
|
4
|
+
import { CellMatcherOr } from "../../../src/generation/rules/logic/CellMatcherOr.js";
|
|
5
|
+
import { GridPatternMatcherCell } from "../../../src/generation/rules/cell/GridPatternMatcherCell.js";
|
|
6
6
|
|
|
7
7
|
const pCorridor_1 = CellMatcherGridPattern.from([
|
|
8
8
|
GridPatternMatcherCell.from(matcher_tag_traversable_unoccupied, 0, 0),
|
|
@@ -1,57 +1,67 @@
|
|
|
1
|
-
import { Theme } from "
|
|
2
|
-
import { TerrainTheme } from "
|
|
3
|
-
import { TerrainLayerRule } from "
|
|
4
|
-
import { MarkerProcessingRule } from "
|
|
5
|
-
import { MarkerNodeMatcherByType } from "
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
1
|
+
import { Theme } from "../../../src/generation/theme/Theme.js";
|
|
2
|
+
import { TerrainTheme } from "../../../src/generation/theme/TerrainTheme.js";
|
|
3
|
+
import { TerrainLayerRule } from "../../../src/generation/theme/TerrainLayerRule.js";
|
|
4
|
+
import { MarkerProcessingRule } from "../../../src/generation/markers/actions/MarkerProcessingRule.js";
|
|
5
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
6
|
+
import {
|
|
7
|
+
MarkerNodeActionEntityPlacement
|
|
8
|
+
} from "../../../src/generation/markers/actions/MarkerNodeActionEntityPlacement.js";
|
|
9
|
+
import { EntityBlueprint } from "../../../src/engine/ecs/EntityBlueprintjs";
|
|
10
|
+
import Mesh from "../../../src/engine/graphics/ecs/mesh/Meshjs";
|
|
11
|
+
import { Transform } from "../../../src/engine/ecs/transform/Transformjs";
|
|
12
|
+
import GridPosition from "../../../src/engine/grid/components/GridPosition.js";
|
|
11
13
|
import { matcher_tag_not_traversable } from "../rules/matcher_tag_not_traversable.js";
|
|
12
|
-
import { CellMatcherLayerBitMaskTest } from "
|
|
13
|
-
import { GridTags } from "
|
|
14
|
-
import { CellFilterCellMatcher } from "
|
|
15
|
-
import { CellFilterSimplexNoise } from "
|
|
16
|
-
import { CellFilterFXAA } from "
|
|
17
|
-
import { CellFilterMultiply } from "
|
|
18
|
-
import { CellFilterLerp } from "
|
|
19
|
-
import { CellFilterLiteralFloat } from "
|
|
20
|
-
import Tag from "../../../engine/ecs/components/
|
|
21
|
-
import HeadsUpDisplay from "../../../engine/ecs/gui/hud/HeadsUpDisplay.js";
|
|
22
|
-
import ViewportPosition from "../../../engine/ecs/gui/position/ViewportPosition.js";
|
|
23
|
-
import GUIElement from "../../../engine/ecs/gui/
|
|
14
|
+
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
15
|
+
import { GridTags } from "../../../src/generation/GridTags.js";
|
|
16
|
+
import { CellFilterCellMatcher } from "../../../src/generation/filtering/CellFilterCellMatcher.js";
|
|
17
|
+
import { CellFilterSimplexNoise } from "../../../src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js";
|
|
18
|
+
import { CellFilterFXAA } from "../../../src/generation/filtering/numeric/complex/CellFilterFXAA.js";
|
|
19
|
+
import { CellFilterMultiply } from "../../../src/generation/filtering/numeric/math/algebra/CellFilterMultiply.js";
|
|
20
|
+
import { CellFilterLerp } from "../../../src/generation/filtering/numeric/math/CellFilterLerp.js";
|
|
21
|
+
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
22
|
+
import Tag from "../../../src/engine/ecs/components/Tagjs";
|
|
23
|
+
import HeadsUpDisplay from "../../../src/engine/ecs/gui/hud/HeadsUpDisplay.js";
|
|
24
|
+
import ViewportPosition from "../../../src/engine/ecs/gui/position/ViewportPosition.js";
|
|
25
|
+
import GUIElement from "../../../src/engine/ecs/gui/GUIElementjs";
|
|
24
26
|
import {
|
|
25
27
|
MarkerNodeTransformerYRotateByFilterGradient
|
|
26
|
-
} from "
|
|
27
|
-
import { CellFilterGaussianBlur } from "
|
|
28
|
-
import { CellProcessingRule } from "
|
|
28
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js";
|
|
29
|
+
import { CellFilterGaussianBlur } from "../../../src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js";
|
|
30
|
+
import { CellProcessingRule } from "../../../src/generation/theme/cell/CellProcessingRule.js";
|
|
29
31
|
import {
|
|
30
32
|
ContinuousGridCellActionSetTerrainHeight
|
|
31
|
-
} from "
|
|
33
|
+
} from "../../../src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js";
|
|
32
34
|
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
import {
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
35
|
+
import {
|
|
36
|
+
CellFilterSampleLayerLinear
|
|
37
|
+
} from "../../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js";
|
|
38
|
+
import ClingToTerrain from "../../../src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js";
|
|
39
|
+
import {
|
|
40
|
+
MarkerNodeTransformerYRotateByFilter
|
|
41
|
+
} from "../../../src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js";
|
|
42
|
+
import { CellFilterAngleToNormal } from "../../../src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js";
|
|
43
|
+
import Vector3 from "../../../src/core/geom/Vector3js";
|
|
44
|
+
import { CellFilterClamp } from "../../../src/generation/filtering/numeric/math/CellFilterClamp.js";
|
|
45
|
+
import { CellFilterOneMinus } from "../../../src/generation/filtering/numeric/math/CellFilterOneMinus.js";
|
|
46
|
+
import { CellFilterSmoothStep } from "../../../src/generation/filtering/numeric/math/CellFilterSmoothStep.js";
|
|
47
|
+
import { CellFilterInverseLerp } from "../../../src/generation/filtering/numeric/math/CellFilterInverseLerp.js";
|
|
48
|
+
import { CellFilterAdd } from "../../../src/generation/filtering/numeric/math/algebra/CellFilterAdd.js";
|
|
49
|
+
import { CellFilterNegate } from "../../../src/generation/filtering/numeric/math/algebra/CellFilterNegate.js";
|
|
50
|
+
import {
|
|
51
|
+
MarkerNodeActionWeightedElement
|
|
52
|
+
} from "../../../src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.js";
|
|
53
|
+
import {
|
|
54
|
+
MarkerNodeActionSelectWeighted
|
|
55
|
+
} from "../../../src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.js";
|
|
56
|
+
import { ParticleEmitter } from "../../../src/engine/graphics/particles/particular/engine/emitter/ParticleEmitterjs";
|
|
57
|
+
import { CellFilterCache } from "../../../src/generation/filtering/numeric/CellFilterCache.js";
|
|
58
|
+
import { SoundEmitter } from "../../../src/engine/sound/ecs/emitter/SoundEmitter.js";
|
|
49
59
|
import { SampleGroundMoistureFilter } from "../filters/SampleGroundMoistureFilter.js";
|
|
50
|
-
import GeneratedArmy from "
|
|
51
|
-
import { MirMarkerTypes } from "
|
|
52
|
-
import { TerrainLayerDescription } from "
|
|
53
|
-
import Vector2 from "../../../core/geom/
|
|
54
|
-
import { PI_HALF } from "../../../core/math/PI_HALF.js";
|
|
60
|
+
import GeneratedArmy from "../../../../model/game/ecs/component/generator/army/GeneratedArmy.js";
|
|
61
|
+
import { MirMarkerTypes } from "../../../../generator/MirMarkerTypes.js";
|
|
62
|
+
import { TerrainLayerDescription } from "../../../src/generation/theme/TerrainLayerDescription.js";
|
|
63
|
+
import Vector2 from "../../../src/core/geom/Vector2js";
|
|
64
|
+
import { PI_HALF } from "../../../src/core/math/PI_HALF.js";
|
|
55
65
|
|
|
56
66
|
export const SampleTheme0 = new Theme();
|
|
57
67
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Theme } from "
|
|
2
|
-
import { TerrainTheme } from "
|
|
3
|
-
import { TerrainLayerRule } from "
|
|
4
|
-
import { CellFilterCellMatcher } from "
|
|
1
|
+
import { Theme } from "../../../src/generation/theme/Theme.js";
|
|
2
|
+
import { TerrainTheme } from "../../../src/generation/theme/TerrainTheme.js";
|
|
3
|
+
import { TerrainLayerRule } from "../../../src/generation/theme/TerrainLayerRule.js";
|
|
4
|
+
import { CellFilterCellMatcher } from "../../../src/generation/filtering/CellFilterCellMatcher.js";
|
|
5
5
|
import { matcher_tag_traversable } from "../rules/matcher_tag_traversable.js";
|
|
6
6
|
import { matcher_tag_not_traversable } from "../rules/matcher_tag_not_traversable.js";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Theme } from "
|
|
2
|
-
import { TerrainTheme } from "
|
|
3
|
-
import { TerrainLayerRule } from "
|
|
4
|
-
import { CellFilterCellMatcher } from "
|
|
1
|
+
import { Theme } from "../../../src/generation/theme/Theme.js";
|
|
2
|
+
import { TerrainTheme } from "../../../src/generation/theme/TerrainTheme.js";
|
|
3
|
+
import { TerrainLayerRule } from "../../../src/generation/theme/TerrainLayerRule.js";
|
|
4
|
+
import { CellFilterCellMatcher } from "../../../src/generation/filtering/CellFilterCellMatcher.js";
|
|
5
5
|
import { matcher_tag_traversable } from "../rules/matcher_tag_traversable.js";
|
|
6
6
|
import { matcher_tag_not_traversable } from "../rules/matcher_tag_not_traversable.js";
|
|
7
7
|
|
|
@@ -2,11 +2,11 @@ import { aabb3_build_corners } from "./aabb3_build_corners.js";
|
|
|
2
2
|
import { aabb_build_frustum } from "./aabb3_build_frustum.js";
|
|
3
3
|
import { aabb3_corner_edge_mapping } from "./aabb3_corner_edge_mapping.js";
|
|
4
4
|
import { aabb3_edge_corner_mapping } from "./aabb3_edge_corner_mapping.js";
|
|
5
|
-
import {
|
|
5
|
+
import { plane3_compute_convex_3_plane_intersection } from "../plane/plane3_compute_convex_3_plane_intersection.js";
|
|
6
6
|
import { is_point_within_planes } from "../plane/is_point_within_planes.js";
|
|
7
7
|
import { v3_distance_above_plane } from "../../v3_distance_above_plane.js";
|
|
8
8
|
import { EPSILON } from "../../../math/EPSILON.js";
|
|
9
|
-
import {
|
|
9
|
+
import { plane3_compute_line_segment_intersection } from "../plane/plane3_compute_line_segment_intersection.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Common piece of continuous memory for better cache coherence
|
|
@@ -205,7 +205,7 @@ export function aabb3_detailed_volume_intersection(
|
|
|
205
205
|
const nz = planes[plane_address + 2];
|
|
206
206
|
const c = planes[plane_address + 3];
|
|
207
207
|
|
|
208
|
-
const edge_intersects =
|
|
208
|
+
const edge_intersects = plane3_compute_line_segment_intersection(
|
|
209
209
|
scratch_v3_array, 0,
|
|
210
210
|
corner_0_x, corner_0_y, corner_0_z,
|
|
211
211
|
corner_1_x, corner_1_y, corner_1_z,
|
|
@@ -256,7 +256,7 @@ export function aabb3_detailed_volume_intersection(
|
|
|
256
256
|
const next_orthogonal_plane_index = (frustum_plane_index + 2) % 4;
|
|
257
257
|
const cp_1 = next_orthogonal_plane_index * 4;
|
|
258
258
|
|
|
259
|
-
const intersection_exists =
|
|
259
|
+
const intersection_exists = plane3_compute_convex_3_plane_intersection(
|
|
260
260
|
scratch_v3_array, 0,
|
|
261
261
|
aabb_plane_nx, aabb_plane_ny, aabb_plane_nz, aabb_plane_constant,
|
|
262
262
|
planes[cp_0], planes[cp_0 + 1], planes[cp_0 + 2], planes[cp_0 + 3],
|
|
@@ -3,9 +3,9 @@ import { plane3_projectPoint } from "../plane/plane3_projectPoint.js";
|
|
|
3
3
|
import { ray_computeNearestPointToPoint } from "../ray/ray_computeNearestPointToPoint.js";
|
|
4
4
|
import { v3_distance_above_plane } from "../../v3_distance_above_plane.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../plane/
|
|
8
|
-
import {
|
|
6
|
+
plane3_three_compute_convex_3_plane_intersection
|
|
7
|
+
} from "../plane/plane3_three_compute_convex_3_plane_intersection.js";
|
|
8
|
+
import { plane3_compute_plane_intersection } from "../plane/plane3_compute_plane_intersection.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
@@ -82,7 +82,7 @@ export function frustum3_computeNearestPointToPoint(result, planes, target_x, ta
|
|
|
82
82
|
const plane_0 = planes[plane_0_index];
|
|
83
83
|
const plane_1 = planes[plane_1_index];
|
|
84
84
|
|
|
85
|
-
const intersection_exists =
|
|
85
|
+
const intersection_exists = plane3_compute_plane_intersection(plane_0, plane_1, scratch_v3_0, scratch_v3_1);
|
|
86
86
|
|
|
87
87
|
if (!intersection_exists) {
|
|
88
88
|
throw new Error('Planes are parallel and do not intersect, likely an invalid frustum');
|
|
@@ -103,7 +103,7 @@ export function frustum3_computeNearestPointToPoint(result, planes, target_x, ta
|
|
|
103
103
|
const plane_1 = planes[plane_1_index];
|
|
104
104
|
const plane_2 = planes[plane_2_index];
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
plane3_three_compute_convex_3_plane_intersection(scratch_v3_array, 0, plane_0, plane_1, plane_2);
|
|
107
107
|
|
|
108
108
|
result.readFromArray(scratch_v3_array, 0)
|
|
109
109
|
}
|