@woosh/meep-engine 2.118.8 → 2.118.11
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/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +202 -410
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +202 -410
- package/editor/ecs/component/editors/Sampler2DEditor.js +2 -4
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/samples/terrain/editor.js +3 -3
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts +1 -19
- package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +10 -78
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +9 -7
- package/src/core/collection/array/isArrayEqualStrict.d.ts.map +1 -1
- package/src/core/collection/array/isArrayEqualStrict.js +2 -2
- package/src/core/collection/array/iterator/ArrayIteratorSequential.d.ts.map +1 -1
- package/src/core/collection/array/iterator/ArrayIteratorSequential.js +3 -4
- package/src/core/collection/queue/Deque.d.ts.map +1 -1
- package/src/core/collection/queue/Deque.js +1 -1
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +0 -8
- package/src/core/geom/3d/morton/{Morton.d.ts → v3_morton_encode.d.ts} +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_transformed.js +2 -2
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +7 -10
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +4 -49
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/math/sinc.d.ts +8 -0
- package/src/core/math/sinc.d.ts.map +1 -0
- package/src/core/math/sinc.js +13 -0
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/WorkerProxy.d.ts +12 -3
- package/src/core/process/worker/WorkerProxy.d.ts.map +1 -1
- package/src/core/process/worker/WorkerProxy.js +10 -1
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts +2 -17
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.d.ts.map +1 -1
- package/src/engine/ecs/terrain/BufferedGeometryArraysBuilder.js +2 -118
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts +0 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +1 -6
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts +5 -5
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSystem.js +20 -28
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
- package/src/engine/ecs/terrain/tiles/TerrainTile.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.d.ts +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +12 -12
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +14 -16
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts +17 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.d.ts.map +1 -0
- package/src/engine/graphics/geometry/buffered/build_height_field_geometry.js +118 -0
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts +2 -2
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +2 -2
- package/src/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +3 -3
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +31 -52
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts +10 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_texture.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{Sampler2D2Texture.js → sampler2d_to_texture.js} +5 -5
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.d.ts → sampler2d_transfer_data.d.ts} +2 -2
- package/src/engine/graphics/texture/sampler/sampler2d_transfer_data.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/{copy_Sampler2D_channel_data.js → sampler2d_transfer_data.js} +1 -1
- package/src/engine/graphics/texture/sampler/writeSampler2DDataToDataTexture.js +2 -2
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/simulator/RibbonXFixedPhysicsSimulator.js +0 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts +6 -3
- package/src/engine/intelligence/behavior/selector/WeightedElement.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +9 -12
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/selector/WeightedRandomBehavior.js +20 -23
- package/src/engine/intelligence/mcts/StateNode.d.ts.map +1 -1
- package/src/engine/intelligence/mcts/StateNode.js +76 -102
- package/src/engine/logging/Logger.d.ts.map +1 -1
- package/src/engine/logging/Logger.js +7 -9
- package/src/engine/logging/LoggerBackend.d.ts.map +1 -1
- package/src/engine/logging/LoggerBackend.js +7 -7
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/geom/3d/morton/Morton.d.ts.map +0 -1
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts +0 -9
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getNumVerticesOfFace.js +0 -11
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts +0 -14
- package/src/engine/graphics/geometry/MikkT/m_getPosition.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_getPosition.js +0 -20
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts +0 -21
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.d.ts.map +0 -1
- package/src/engine/graphics/geometry/MikkT/m_setTSpaceBasic.js +0 -22
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts +0 -10
- package/src/engine/graphics/texture/sampler/Sampler2D2Texture.d.ts.map +0 -1
- package/src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.d.ts.map +0 -1
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
- /package/src/core/geom/3d/morton/{Morton.js → v3_morton_encode.js} +0 -0
|
@@ -3,9 +3,6 @@ import {
|
|
|
3
3
|
} from "../../../../src/core/collection/array/typed/typedArrayConstructorByInstance.js";
|
|
4
4
|
import { FrameRunner } from "../../../../src/engine/graphics/FrameRunner.js";
|
|
5
5
|
import html_canvas_to_sampler2d from "../../../../src/engine/graphics/texture/html_canvas_to_sampler2d.js";
|
|
6
|
-
import {
|
|
7
|
-
copy_Sampler2D_channel_data
|
|
8
|
-
} from "../../../../src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.js";
|
|
9
6
|
import { downloadSampler2DAsPNG } from "../../../../src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js";
|
|
10
7
|
import { sampler2d_scale } from "../../../../src/engine/graphics/texture/sampler/resize/sampler2d_scale.js";
|
|
11
8
|
import { Sampler2D } from "../../../../src/engine/graphics/texture/sampler/Sampler2D.js";
|
|
@@ -13,6 +10,7 @@ import {
|
|
|
13
10
|
sampler2d_compute_texel_value_conversion_scale_to_uint8
|
|
14
11
|
} from "../../../../src/engine/graphics/texture/sampler/sampler2d_compute_texel_value_conversion_scale_to_uint8.js";
|
|
15
12
|
import sampler2D2Canvas from "../../../../src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.js";
|
|
13
|
+
import { sampler2d_transfer_data } from "../../../../src/engine/graphics/texture/sampler/sampler2d_transfer_data.js";
|
|
16
14
|
import { MouseEvents } from "../../../../src/engine/input/devices/events/MouseEvents.js";
|
|
17
15
|
import { CanvasView } from "../../../../src/view/elements/CanvasView.js";
|
|
18
16
|
import EmptyView from "../../../../src/view/elements/EmptyView.js";
|
|
@@ -102,7 +100,7 @@ function enable_drop(parent, element, field) {
|
|
|
102
100
|
|
|
103
101
|
sampler.resize(width, height, false);
|
|
104
102
|
|
|
105
|
-
|
|
103
|
+
sampler2d_transfer_data(file_data_sampler, sampler);
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
|
package/package.json
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import Vector3 from "../../src/core/geom/Vector3js";
|
|
2
|
+
import { NumericInterval } from "../../src/core/math/interval/NumericInterval.js";
|
|
3
|
+
import { CellFilterCellMatcher } from "../../src/generation/filtering/CellFilterCellMatcher.js";
|
|
4
|
+
import { CellFilterCache } from "../../src/generation/filtering/numeric/CellFilterCache.js";
|
|
5
|
+
import { CellFilterLiteralFloat } from "../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
6
|
+
import { CellFilterAngleToNormal } from "../../src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js";
|
|
7
|
+
import { CellFilterGaussianBlur } from "../../src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js";
|
|
8
|
+
import { CellFilterSimplexNoise } from "../../src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js";
|
|
9
|
+
import { CellFilterAdd } from "../../src/generation/filtering/numeric/math/algebra/CellFilterAdd.js";
|
|
10
|
+
import { CellFilterDivide } from "../../src/generation/filtering/numeric/math/algebra/CellFilterDivide.js";
|
|
11
|
+
import { CellFilterMultiply } from "../../src/generation/filtering/numeric/math/algebra/CellFilterMultiply.js";
|
|
12
|
+
import { CellFilterSubtract } from "../../src/generation/filtering/numeric/math/algebra/CellFilterSubtract.js";
|
|
13
|
+
import { CellFilterClamp } from "../../src/generation/filtering/numeric/math/CellFilterClamp.js";
|
|
14
|
+
import { CellFilterInverseLerp } from "../../src/generation/filtering/numeric/math/CellFilterInverseLerp.js";
|
|
15
|
+
import { CellFilterLerp } from "../../src/generation/filtering/numeric/math/CellFilterLerp.js";
|
|
16
|
+
import { CellFilterMax2 } from "../../src/generation/filtering/numeric/math/CellFilterMax2.js";
|
|
17
|
+
import { CellFilterOneMinus } from "../../src/generation/filtering/numeric/math/CellFilterOneMinus.js";
|
|
18
|
+
import { CellFilterSmoothStep } from "../../src/generation/filtering/numeric/math/CellFilterSmoothStep.js";
|
|
19
|
+
import { CellFilterStep } from "../../src/generation/filtering/numeric/math/CellFilterStep.js";
|
|
20
|
+
import { CellFilterCubicFunction } from "../../src/generation/filtering/numeric/math/poly/CellFilterCubicFunction.js";
|
|
21
|
+
import {
|
|
22
|
+
CellFilterSampleLayerLinear
|
|
23
|
+
} from "../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js";
|
|
24
|
+
import { GridTaskActionRuleSet } from "../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js";
|
|
8
25
|
import { GridTaskCellularAutomata } from "../../src/generation/grid/generation/discrete/GridTaskCellularAutomata.js";
|
|
9
|
-
import {
|
|
10
|
-
import { GridActionRuleSet } from "../../src/generation/markers/GridActionRuleSet.js";
|
|
26
|
+
import { GridTaskConnectRooms } from "../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js";
|
|
11
27
|
import {
|
|
12
28
|
GridTaskBuildSourceDistanceMap
|
|
13
29
|
} from "../../src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js";
|
|
14
|
-
import { CellMatcherAnd } from "../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
15
|
-
import { GridCellActionPlaceTags } from "../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
16
30
|
import {
|
|
17
|
-
|
|
18
|
-
} from "../../src/generation/
|
|
19
|
-
import {
|
|
20
|
-
import { mir_generator_place_bases } from "./generators/mir_generator_place_bases.js";
|
|
21
|
-
import { matcher_tag_traversable_unoccupied } from "./rules/matcher_tag_traversable_unoccupied.js";
|
|
22
|
-
import { mir_generator_place_starting_point } from "./generators/mir_generator_place_starting_point.js";
|
|
23
|
-
import { GridTaskConnectRooms } from "../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js";
|
|
24
|
-
import { matcher_tag_traversable } from "./rules/matcher_tag_traversable.js";
|
|
31
|
+
GridTaskDensityMarkerDistribution
|
|
32
|
+
} from "../../src/generation/grid/generation/GridTaskDensityMarkerDistribution.js";
|
|
33
|
+
import { GridTaskSequence } from "../../src/generation/grid/generation/GridTaskSequence.js";
|
|
25
34
|
import { GridTaskGenerateRoads } from "../../src/generation/grid/generation/road/GridTaskGenerateRoads.js";
|
|
26
|
-
import {
|
|
35
|
+
import { GridTaskGroup } from "../../src/generation/GridTaskGroup.js";
|
|
36
|
+
import { GridActionRuleSet } from "../../src/generation/markers/GridActionRuleSet.js";
|
|
37
|
+
import { GridCellActionPlaceMarker } from "../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
27
38
|
import { MarkerNodeMatcherByType } from "../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
28
39
|
import {
|
|
29
|
-
|
|
30
|
-
} from "../../src/generation/
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
import {
|
|
35
|
-
import { CellFilterLiteralFloat } from "../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
36
|
-
import { MirGridLayers } from "./grid/MirGridLayers.js";
|
|
37
|
-
import { CellFilterLerp } from "../../src/generation/filtering/numeric/math/CellFilterLerp.js";
|
|
40
|
+
MarkerNodeTransformerRecordProperty
|
|
41
|
+
} from "../../src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js";
|
|
42
|
+
import {
|
|
43
|
+
MarkerNodeTransformerYRotateByFilter
|
|
44
|
+
} from "../../src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js";
|
|
45
|
+
import { GridCellActionPlaceTags } from "../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
38
46
|
import {
|
|
39
47
|
GridCellActionWriteFilterToLayer
|
|
40
48
|
} from "../../src/generation/placement/action/GridCellActionWriteFilterToLayer.js";
|
|
41
|
-
import { CellMatcherAny } from "../../src/generation/rules/CellMatcherAny.js";
|
|
42
|
-
import { CellFilterGaussianBlur } from "../../src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js";
|
|
43
49
|
import { GridCellActionSequence } from "../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
CellFilterSampleLayerLinear
|
|
47
|
-
} from "../../src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js";
|
|
48
|
-
import { CellFilterAngleToNormal } from "../../src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js";
|
|
49
|
-
import Vector3 from "../../src/core/geom/Vector3js";
|
|
50
|
-
import { CellFilterOneMinus } from "../../src/generation/filtering/numeric/math/CellFilterOneMinus.js";
|
|
51
|
-
import { CellFilterSmoothStep } from "../../src/generation/filtering/numeric/math/CellFilterSmoothStep.js";
|
|
52
|
-
import { SampleNoise20_0 } from "./filters/SampleNoise20_0.js";
|
|
53
|
-
import { SampleGroundMoistureFilter } from "./filters/SampleGroundMoistureFilter.js";
|
|
54
|
-
import { GridTaskSequence } from "../../src/generation/grid/generation/GridTaskSequence.js";
|
|
55
|
-
import { CellFilterSubtract } from "../../src/generation/filtering/numeric/math/algebra/CellFilterSubtract.js";
|
|
56
|
-
import { CellFilterCache } from "../../src/generation/filtering/numeric/CellFilterCache.js";
|
|
57
|
-
import { CellFilterInverseLerp } from "../../src/generation/filtering/numeric/math/CellFilterInverseLerp.js";
|
|
58
|
-
import { CellFilterClamp } from "../../src/generation/filtering/numeric/math/CellFilterClamp.js";
|
|
50
|
+
import { GridCellPlacementRule } from "../../src/generation/placement/GridCellPlacementRule.js";
|
|
59
51
|
import {
|
|
60
|
-
|
|
61
|
-
} from "../../src/generation/
|
|
52
|
+
CellMatcherContainsMarkerWithinRadius
|
|
53
|
+
} from "../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
54
|
+
import { CellMatcherGridPattern } from "../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
62
55
|
import { GridPatternMatcherCell } from "../../src/generation/rules/cell/GridPatternMatcherCell.js";
|
|
63
|
-
import {
|
|
64
|
-
|
|
65
|
-
} from "../../src/generation/
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
56
|
+
import { CellMatcherAny } from "../../src/generation/rules/CellMatcherAny.js";
|
|
57
|
+
import { CellMatcherLayerBitMaskTest } from "../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
58
|
+
import { CellMatcherAnd } from "../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
59
|
+
import { CellMatcherNot } from "../../src/generation/rules/logic/CellMatcherNot.js";
|
|
60
|
+
import { SampleGroundMoistureFilter } from "./filters/SampleGroundMoistureFilter.js";
|
|
61
|
+
import { SampleNoise20_0 } from "./filters/SampleNoise20_0.js";
|
|
62
|
+
import { mir_generator_place_bases } from "./generators/mir_generator_place_bases.js";
|
|
63
|
+
import { mir_generator_place_road_decorators } from "./generators/mir_generator_place_road_decorators.js";
|
|
64
|
+
import { mir_generator_place_starting_point } from "./generators/mir_generator_place_starting_point.js";
|
|
65
|
+
import { GridTags } from "./grid/GridTags.js";
|
|
66
|
+
import { MirGridLayers } from "./grid/MirGridLayers.js";
|
|
70
67
|
import { matcher_not_play_area } from "./rules/matcher_not_play_area.js";
|
|
68
|
+
import { matcher_tag_traversable } from "./rules/matcher_tag_traversable.js";
|
|
69
|
+
import { matcher_tag_traversable_unoccupied } from "./rules/matcher_tag_traversable_unoccupied.js";
|
|
70
|
+
import { mir_matcher_attack_corridor } from "./rules/mir_matcher_attack_corridor.js";
|
|
71
71
|
|
|
72
72
|
export const SampleGenerator0 = new GridTaskGroup();
|
|
73
73
|
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 "../../grid/GridTags.js";
|
|
1
|
+
import { BuffObjectTypes } from "../../../../../../generator/BuffObjectTypes.js";
|
|
2
|
+
import { UnlockableElementsManager } from "../../../../../../model/unlocks/UnlockableElementsManager.js";
|
|
3
|
+
import { MirMarkerTypes } from "../../../../../generator/MirMarkerTypes.js";
|
|
9
4
|
import { bitwiseAnd } from "../../../../src/core/binary/operations/bitwiseAnd.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
GridTaskActionRuleSet
|
|
14
|
-
} from "../../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js";
|
|
5
|
+
import { CellFilterLiteralFloat } from "../../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
6
|
+
import { GridTaskActionRuleSet } from "../../../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js";
|
|
15
7
|
import { GridActionRuleSet } from "../../../../src/generation/markers/GridActionRuleSet.js";
|
|
8
|
+
import { GridCellActionPlaceMarker } from "../../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
16
9
|
import { GridCellActionPlaceMarkerGroup } from "../../../../src/generation/markers/GridCellActionPlaceMarkerGroup.js";
|
|
17
|
-
import {
|
|
10
|
+
import { MarkerNodeMatcherAnd } from "../../../../src/generation/markers/matcher/MarkerNodeMatcherAnd.js";
|
|
11
|
+
import { MarkerNodeMatcherByType } from "../../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
18
12
|
import {
|
|
19
13
|
MarkerNodeMatcherContainsTag
|
|
20
14
|
} from "../../../../src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js";
|
|
15
|
+
import { RuleSelectionPolicyType } from "../../../../src/generation/markers/RuleSelectionPolicyType.js";
|
|
16
|
+
import { GridCellActionPlaceTags } from "../../../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
17
|
+
import { GridCellActionSequence } from "../../../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
18
|
+
import { GridCellPlacementRule } from "../../../../src/generation/placement/GridCellPlacementRule.js";
|
|
19
|
+
import {
|
|
20
|
+
CellMatcherContainsMarkerWithinRadius
|
|
21
|
+
} from "../../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
22
|
+
import { CellMatcherGridPattern } from "../../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
23
|
+
import { GridPatternMatcherCell } from "../../../../src/generation/rules/cell/GridPatternMatcherCell.js";
|
|
21
24
|
import { CellMatcherAnd } from "../../../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
22
|
-
import {
|
|
25
|
+
import { CellMatcherNot } from "../../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
23
26
|
import { CellMatcherOr } from "../../../../src/generation/rules/logic/CellMatcherOr.js";
|
|
24
|
-
import {
|
|
25
|
-
import { MarkerNodeMatcherAnd } from "../../../../src/generation/markers/matcher/MarkerNodeMatcherAnd.js";
|
|
27
|
+
import { GridTags } from "../../grid/GridTags.js";
|
|
26
28
|
import { MirGridLayers } from "../../grid/MirGridLayers.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
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";
|
|
29
|
+
import { matcher_tag_not_traversable } from "../../rules/matcher_tag_not_traversable.js";
|
|
30
|
+
import { matcher_tag_traversable_unoccupied } from "../../rules/matcher_tag_traversable_unoccupied.js";
|
|
33
31
|
|
|
34
32
|
const TAG_MAJOR = 'Major Buff';
|
|
35
33
|
const TAG_MINOR = 'Minor Buff';
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 "../grid/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";
|
|
12
|
-
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
1
|
+
import { MirMarkerTags } from "../../../../generator/MirMarkerTags.js";
|
|
2
|
+
import { MirMarkerTypes } from "../../../../generator/MirMarkerTypes.js";
|
|
13
3
|
import { bitwiseAnd } from "../../../src/core/binary/operations/bitwiseAnd.js";
|
|
14
|
-
import {
|
|
15
|
-
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
16
|
-
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
4
|
+
import { Transform } from "../../../src/engine/ecs/transform/Transform.js";
|
|
17
5
|
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
6
|
+
import { GridTaskActionRuleSet } from "../../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js";
|
|
7
|
+
import { MarkerNodeEmitterFromAction } from "../../../src/generation/markers/emitter/MarkerNodeEmitterFromAction.js";
|
|
18
8
|
import {
|
|
19
9
|
MarkerNodeEmitterGridCellAction
|
|
20
10
|
} from "../../../src/generation/markers/emitter/MarkerNodeEmitterGridCellAction.js";
|
|
21
11
|
import { MarkerNodeEmitterPredicated } from "../../../src/generation/markers/emitter/MarkerNodeEmitterPredicated.js";
|
|
12
|
+
import { GridActionRuleSet } from "../../../src/generation/markers/GridActionRuleSet.js";
|
|
13
|
+
import { GridCellActionPlaceMarker } from "../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
14
|
+
import { GridCellActionPlaceMarkerGroup } from "../../../src/generation/markers/GridCellActionPlaceMarkerGroup.js";
|
|
15
|
+
import { MarkerNodeMatcherAny } from "../../../src/generation/markers/matcher/MarkerNodeMatcherAny.js";
|
|
16
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
22
17
|
import { GridDataNodePredicateNot } from "../../../src/generation/markers/predicate/GridDataNodePredicateNot.js";
|
|
23
18
|
import {
|
|
24
19
|
GridDataNodePredicateOverlaps
|
|
25
20
|
} 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
21
|
import {
|
|
30
22
|
MarkerNodeTransformerOffsetPosition
|
|
31
23
|
} from "../../../src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js";
|
|
32
24
|
import {
|
|
33
25
|
MarkerNodeTransformerRecordUniqueRandomEnum
|
|
34
26
|
} from "../../../src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js";
|
|
35
|
-
import {
|
|
36
|
-
import { MirMarkerTags } from "../../../../generator/MirMarkerTags.js";
|
|
27
|
+
import { GridCellActionPlaceTags } from "../../../src/generation/placement/action/GridCellActionPlaceTags.js";
|
|
37
28
|
import { GridCellActionSequence } from "../../../src/generation/placement/action/util/GridCellActionSequence.js";
|
|
29
|
+
import { GridCellPlacementRule } from "../../../src/generation/placement/GridCellPlacementRule.js";
|
|
30
|
+
import {
|
|
31
|
+
CellMatcherContainsMarkerWithinRadius
|
|
32
|
+
} from "../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
33
|
+
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
34
|
+
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
35
|
+
import { GridTags } from "../grid/GridTags.js";
|
|
36
|
+
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
37
|
+
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
38
38
|
|
|
39
39
|
const pMatcher = new CellMatcherGridPattern();
|
|
40
40
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CellFilterLiteralFloat } from "../../../src/generation/filtering/numeric/CellFilterLiteralFloat.js";
|
|
2
|
+
import { GridTaskActionRuleSet } from "../../../src/generation/grid/generation/discrete/GridTaskActionRuleSet.js";
|
|
2
3
|
import { GridActionRuleSet } from "../../../src/generation/markers/GridActionRuleSet.js";
|
|
4
|
+
import { GridCellActionPlaceMarker } from "../../../src/generation/markers/GridCellActionPlaceMarker.js";
|
|
5
|
+
import { MarkerNodeMatcherAny } from "../../../src/generation/markers/matcher/MarkerNodeMatcherAny.js";
|
|
6
|
+
import { MarkerNodeMatcherByType } from "../../../src/generation/markers/matcher/MarkerNodeMatcherByType.js";
|
|
7
|
+
import { MarkerNodeMatcherContainsTag } from "../../../src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js";
|
|
3
8
|
import { GridCellPlacementRule } from "../../../src/generation/placement/GridCellPlacementRule.js";
|
|
9
|
+
import {
|
|
10
|
+
CellMatcherContainsMarkerWithinRadius
|
|
11
|
+
} from "../../../src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js";
|
|
4
12
|
import { CellMatcherGridPattern } from "../../../src/generation/rules/cell/CellMatcherGridPattern.js";
|
|
5
13
|
import { CellMatcherLayerBitMaskTest } from "../../../src/generation/rules/CellMatcherLayerBitMaskTest.js";
|
|
6
|
-
import { GridTags } from "../grid/GridTags.js";
|
|
7
14
|
import { CellMatcherAnd } from "../../../src/generation/rules/logic/CellMatcherAnd.js";
|
|
8
15
|
import { CellMatcherNot } from "../../../src/generation/rules/logic/CellMatcherNot.js";
|
|
9
|
-
import {
|
|
10
|
-
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
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";
|
|
16
|
+
import { GridTags } from "../grid/GridTags.js";
|
|
17
17
|
import { MirGridLayers } from "../grid/MirGridLayers.js";
|
|
18
|
-
import {
|
|
18
|
+
import { matcher_tag_traversable_unoccupied } from "../rules/matcher_tag_traversable_unoccupied.js";
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
const matcher_tag_road = CellMatcherLayerBitMaskTest.from(GridTags.Road, MirGridLayers.Tags);
|
|
@@ -16,10 +16,10 @@ import { EngineConfiguration } from "../../src/engine/EngineConfiguration.js";
|
|
|
16
16
|
import { EngineHarness } from "../../src/engine/EngineHarness.js";
|
|
17
17
|
import { load_and_set_cubemap_v0 } from "../../src/engine/graphics/load_and_set_cubemap_v0.js";
|
|
18
18
|
import CheckersTextureURI from "../../src/engine/graphics/texture/CheckersTextureURI.js";
|
|
19
|
-
import { copy_Sampler2D_channel_data } from "../../src/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.js";
|
|
20
19
|
import { sampler2d_scale } from "../../src/engine/graphics/texture/sampler/resize/sampler2d_scale.js";
|
|
21
20
|
import { Sampler2D } from "../../src/engine/graphics/texture/sampler/Sampler2D.js";
|
|
22
21
|
import sampler2d_to_html_canvas from "../../src/engine/graphics/texture/sampler/sampler2d_to_html_canvas.js";
|
|
22
|
+
import { sampler2d_transfer_data } from "../../src/engine/graphics/texture/sampler/sampler2d_transfer_data.js";
|
|
23
23
|
import { NativeListController } from "../../src/view/controller/controls/NativeListController.js";
|
|
24
24
|
import { CanvasView } from "../../src/view/elements/CanvasView.js";
|
|
25
25
|
import EmptyView from "../../src/view/elements/EmptyView.js";
|
|
@@ -120,12 +120,12 @@ class TextureLayerEditor {
|
|
|
120
120
|
const layer = layers.get(this.index);
|
|
121
121
|
|
|
122
122
|
target.resize(layer.diffuse.width, layer.diffuse.height);
|
|
123
|
-
|
|
123
|
+
sampler2d_transfer_data(layer.diffuse, target);
|
|
124
124
|
},
|
|
125
125
|
write: (source) => {
|
|
126
126
|
const layer = this.__terrain.layers.get(this.index);
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
sampler2d_transfer_data(source, layer.diffuse);
|
|
129
129
|
|
|
130
130
|
this.__terrain.layers.writeLayerDataIntoTexture(this.index);
|
|
131
131
|
},
|
|
@@ -110,31 +110,13 @@ export class BinaryUint32BVH {
|
|
|
110
110
|
*/
|
|
111
111
|
readLeafPayload(leaf_index: number): number;
|
|
112
112
|
compute_total_surface_area(): number;
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
* @param {number} a address
|
|
116
|
-
* @param {number} b address
|
|
117
|
-
* @param {number} c address
|
|
118
|
-
* @returns {number}
|
|
119
|
-
* @private
|
|
120
|
-
*/
|
|
121
|
-
private __compute_bounds_area_of_3_boxes;
|
|
122
|
-
/**
|
|
123
|
-
*
|
|
124
|
-
* @param {number} a
|
|
125
|
-
* @param {number} b
|
|
126
|
-
* @returns {number}
|
|
127
|
-
* @private
|
|
128
|
-
*/
|
|
129
|
-
private __fitness_function_should_swap_leaves_sah;
|
|
130
|
-
sort_bubble_sah(): void;
|
|
131
113
|
/**
|
|
132
114
|
* Sort leaf nodes according to their morton codes
|
|
133
115
|
* @param {number[]} bounds
|
|
134
116
|
*/
|
|
135
117
|
sort_morton(bounds: number[]): void;
|
|
136
118
|
/**
|
|
137
|
-
*
|
|
119
|
+
* Does not update intermediate node bounds
|
|
138
120
|
* @param {number} i
|
|
139
121
|
* @param {number} j
|
|
140
122
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BinaryUint32BVH.d.ts","sourceRoot":"","sources":["../../../../../../src/core/bvh2/binary/2/BinaryUint32BVH.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BinaryUint32BVH.d.ts","sourceRoot":"","sources":["../../../../../../src/core/bvh2/binary/2/BinaryUint32BVH.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;;GAIG;AACH,mCAFU,MAAM,CAEsB;AACtC;;;GAGG;AACH,iCAFU,MAAM,CAEoB;AAiDpC;IACI;;;;OAIG;IACH,sBAAc;IAEd;;;;OAIG;IACH,gCAAe;IAEf;;;;OAIG;IACH,+BAAc;IAEd;;;;OAIG;IACH,4BAAwB;IAExB;;;;OAIG;IACH,0BAAsB;IA0CtB;;;OAGG;IACH,2BAOC;IAED,wBAEC;IAnDD;;;OAGG;IACH,oBAFa,MAAM,CAIlB;IAED,2BAEC;IAED,gCAEC;IAED,8BAEC;IAED;;;OAGG;IACH,uBAFa,MAAM,CAIlB;IAED,4BAEC;IAED,0BAEC;IAmBD;;;;OAIG;IACH,2BAHW,MAAM,GACJ,MAAM,CAalB;IAED,6BASC;IAED;;;OAGG;IACH,oBAFW,MAAM,QAgBhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACL,MAAM,CASjB;IAED;;;;;;;;;;OAUG;IACH,mBATW,MAAM,WACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAoChB;IAED;;;;;OAKG;IACH,oBAJW,MAAM,eACN,MAAM,EAAE,GAAC,YAAY,sBACrB,MAAM,QAIhB;IAED;;;;OAIG;IACH,4BAHW,MAAM,GACJ,MAAM,CAQlB;IAED,qCAoBC;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,QAqElB;IAED;;;;;OAKG;IACH,sBAUC;IAED;;OAEG;IACH,cAsEC;CACJ"}
|
|
@@ -7,10 +7,6 @@ import { aabb3_array_combine } from "../../../geom/3d/aabb/aabb3_array_combine.j
|
|
|
7
7
|
import { aabb3_array_set } from "../../../geom/3d/aabb/aabb3_array_set.js";
|
|
8
8
|
import { aabb3_compute_half_surface_area } from "../../../geom/3d/aabb/aabb3_compute_half_surface_area.js";
|
|
9
9
|
import { v3_morton_encode_bounded } from "../../../geom/3d/morton/v3_morton_encode_bounded.js";
|
|
10
|
-
import { max2 } from "../../../math/max2.js";
|
|
11
|
-
import { max3 } from "../../../math/max3.js";
|
|
12
|
-
import { min2 } from "../../../math/min2.js";
|
|
13
|
-
import { min3 } from "../../../math/min3.js";
|
|
14
10
|
|
|
15
11
|
/**
|
|
16
12
|
* @readonly
|
|
@@ -325,73 +321,6 @@ export class BinaryUint32BVH {
|
|
|
325
321
|
return result;
|
|
326
322
|
}
|
|
327
323
|
|
|
328
|
-
/**
|
|
329
|
-
*
|
|
330
|
-
* @param {number} a address
|
|
331
|
-
* @param {number} b address
|
|
332
|
-
* @param {number} c address
|
|
333
|
-
* @returns {number}
|
|
334
|
-
* @private
|
|
335
|
-
*/
|
|
336
|
-
__compute_bounds_area_of_3_boxes(a, b, c) {
|
|
337
|
-
const float32 = this.__data_float32;
|
|
338
|
-
|
|
339
|
-
const x0 = min3(float32[a + 0], float32[b + 0], float32[c + 0]);
|
|
340
|
-
const y0 = min3(float32[a + 1], float32[b + 1], float32[c + 1]);
|
|
341
|
-
const z0 = min3(float32[a + 2], float32[b + 2], float32[c + 2]);
|
|
342
|
-
|
|
343
|
-
const x1 = max3(float32[a + 3], float32[b + 3], float32[c + 3]);
|
|
344
|
-
const y1 = max3(float32[a + 4], float32[b + 4], float32[c + 4]);
|
|
345
|
-
const z1 = max3(float32[a + 5], float32[b + 5], float32[c + 5]);
|
|
346
|
-
|
|
347
|
-
return aabb3_compute_half_surface_area(x0, y0, z0, x1, y1, z1);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
*
|
|
352
|
-
* @param {number} a
|
|
353
|
-
* @param {number} b
|
|
354
|
-
* @returns {number}
|
|
355
|
-
* @private
|
|
356
|
-
*/
|
|
357
|
-
__fitness_function_should_swap_leaves_sah(a, b) {
|
|
358
|
-
const a_0 = max2(a - 1, 0);
|
|
359
|
-
const a_1 = min2(a + 1, this.__node_count_leaf - 1);
|
|
360
|
-
|
|
361
|
-
const leaf_block_offset = this.getLeafBlockAddress();
|
|
362
|
-
|
|
363
|
-
const a_c_address = a * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
364
|
-
const a_0_address = a_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
365
|
-
const a_1_address = a_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const b_0 = max2(b - 1, 0);
|
|
369
|
-
const b_1 = min2(b + 1, this.__node_count_leaf - 1);
|
|
370
|
-
|
|
371
|
-
const b_c_address = b * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
372
|
-
const b_0_address = b_0 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
373
|
-
const b_1_address = b_1 * BVH_LEAF_NODE_SIZE + leaf_block_offset;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const current_area = this.__compute_bounds_area_of_3_boxes(a_0_address, a_c_address, a_1_address) + this.__compute_bounds_area_of_3_boxes(b_0_address, b_c_address, b_1_address);
|
|
377
|
-
const swap_area = this.__compute_bounds_area_of_3_boxes(a_0_address, b_c_address, a_1_address) + this.__compute_bounds_area_of_3_boxes(b_0_address, a_c_address, b_1_address);
|
|
378
|
-
|
|
379
|
-
return current_area - swap_area;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
sort_bubble_sah() {
|
|
383
|
-
const n = this.__node_count_leaf;
|
|
384
|
-
|
|
385
|
-
for (let i = 0; i < n; i++) {
|
|
386
|
-
for (let j = i + 1; j < n; j++) {
|
|
387
|
-
if (this.__fitness_function_should_swap_leaves_sah(i, j) > 0) {
|
|
388
|
-
this.__swap_leaves(i, j);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
324
|
/**
|
|
396
325
|
* Sort leaf nodes according to their morton codes
|
|
397
326
|
* @param {number[]} bounds
|
|
@@ -405,15 +334,17 @@ export class BinaryUint32BVH {
|
|
|
405
334
|
return;
|
|
406
335
|
}
|
|
407
336
|
|
|
408
|
-
|
|
337
|
+
const stack_top = stack.pointer;
|
|
338
|
+
|
|
339
|
+
let stackPointer = stack_top;
|
|
409
340
|
let i, j;
|
|
410
341
|
|
|
411
|
-
stack[
|
|
412
|
-
stack[
|
|
342
|
+
stack[stackPointer++] = 0; // first node
|
|
343
|
+
stack[stackPointer++] = this.__node_count_leaf - 1; // last node
|
|
413
344
|
|
|
414
345
|
const data = this.__data_float32;
|
|
415
346
|
|
|
416
|
-
while (stackPointer >
|
|
347
|
+
while (stackPointer > stack_top) {
|
|
417
348
|
stackPointer -= 2;
|
|
418
349
|
|
|
419
350
|
const right = stack[stackPointer + 1];
|
|
@@ -422,14 +353,15 @@ export class BinaryUint32BVH {
|
|
|
422
353
|
i = left;
|
|
423
354
|
j = right;
|
|
424
355
|
|
|
425
|
-
const
|
|
356
|
+
const pivot_index = (left + right) >> 1;
|
|
426
357
|
|
|
427
|
-
const pivot_address =
|
|
358
|
+
const pivot_address = pivot_index * BVH_LEAF_NODE_SIZE + leaf_block_address;
|
|
428
359
|
|
|
429
360
|
const pivot = build_morton(data, pivot_address, bounds);
|
|
430
361
|
|
|
431
362
|
/* partition */
|
|
432
363
|
while (i <= j) {
|
|
364
|
+
|
|
433
365
|
while (build_morton(data, i * BVH_LEAF_NODE_SIZE + leaf_block_address, bounds) < pivot) {
|
|
434
366
|
i++;
|
|
435
367
|
}
|
|
@@ -463,7 +395,7 @@ export class BinaryUint32BVH {
|
|
|
463
395
|
}
|
|
464
396
|
|
|
465
397
|
/**
|
|
466
|
-
*
|
|
398
|
+
* Does not update intermediate node bounds
|
|
467
399
|
* @param {number} i
|
|
468
400
|
* @param {number} j
|
|
469
401
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ebvh_build_for_geometry_morton.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,sEANW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,kBAChC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,WAAW,WACX,KAAK,YACL,MAAM,
|
|
1
|
+
{"version":3,"file":"ebvh_build_for_geometry_morton.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,sEANW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,kBAChC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,WAAW,WACX,KAAK,YACL,MAAM,QAmHhB;sBAnIqB,6BAA6B"}
|
|
@@ -50,16 +50,11 @@ export function ebvh_build_for_geometry_morton(
|
|
|
50
50
|
|
|
51
51
|
const node_total_count = node_leaf_count + node_bin_count;
|
|
52
52
|
|
|
53
|
-
const nodes = new Uint32Array(node_total_count);
|
|
54
53
|
|
|
55
54
|
// skip allocation calls, allocate exactly as many nodes as we need
|
|
56
55
|
bvh.node_capacity = node_total_count;
|
|
57
56
|
bvh.__size = node_total_count;
|
|
58
57
|
|
|
59
|
-
for (let i = 0; i < node_total_count; i++) {
|
|
60
|
-
// store nodes in reverse order so that top-level nodes end up on top
|
|
61
|
-
nodes[i] = (node_total_count - 1) - i;
|
|
62
|
-
}
|
|
63
58
|
|
|
64
59
|
|
|
65
60
|
// indices of triangles, but sorted by morton codes
|
|
@@ -102,7 +97,7 @@ export function ebvh_build_for_geometry_morton(
|
|
|
102
97
|
|
|
103
98
|
// assign leaves
|
|
104
99
|
for (let i = 0; i < tri_count; i++) {
|
|
105
|
-
const
|
|
100
|
+
const node_id = (node_total_count - 1) - i;
|
|
106
101
|
|
|
107
102
|
const triangle_index = sorted_triangle_order[i];
|
|
108
103
|
|
|
@@ -112,7 +107,7 @@ export function ebvh_build_for_geometry_morton(
|
|
|
112
107
|
const b_index = index_array[triangle_index3 + 1];
|
|
113
108
|
const c_index = index_array[triangle_index3 + 2];
|
|
114
109
|
|
|
115
|
-
const node_address = ELEMENT_WORD_COUNT *
|
|
110
|
+
const node_address = ELEMENT_WORD_COUNT * node_id;
|
|
116
111
|
|
|
117
112
|
aabb3_compute_from_triangle(
|
|
118
113
|
bvh_float32, node_address,
|
|
@@ -124,6 +119,13 @@ export function ebvh_build_for_geometry_morton(
|
|
|
124
119
|
bvh_uint32[node_address + COLUMN_HEIGHT] = 0;
|
|
125
120
|
}
|
|
126
121
|
|
|
122
|
+
|
|
123
|
+
const nodes = new Uint32Array(node_total_count);
|
|
124
|
+
for (let i = 0; i < node_total_count; i++) {
|
|
125
|
+
// store nodes in reverse order so that top-level nodes end up on top
|
|
126
|
+
nodes[i] = (node_total_count - 1) - i;
|
|
127
|
+
}
|
|
128
|
+
|
|
127
129
|
// record newly generated nodes as "unprocessed"
|
|
128
130
|
const unprocessed_nodes = new Uint32Array(tri_count);
|
|
129
131
|
array_copy(nodes, 0, unprocessed_nodes, 0, tri_count);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isArrayEqualStrict.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/isArrayEqualStrict.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sCAJW,QAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"isArrayEqualStrict.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/array/isArrayEqualStrict.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,sCAJW,QAAM,UAAU,GAAC,YAAY,KAC7B,QAAM,UAAU,GAAC,YAAY,GAC3B,OAAO,CAoBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayIteratorSequential.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/iterator/ArrayIteratorSequential.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"ArrayIteratorSequential.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/iterator/ArrayIteratorSequential.js"],"names":[],"mappings":"AAEA;;IAGI,YAAQ;IAGR,4BAIC;IAED,wBAcC;CACJ;sCA7BqC,4BAA4B"}
|