@woosh/meep-engine 2.54.0 → 2.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/editor/view/node-graph/PortView.js +2 -2
- package/package.json +1 -1
- package/src/core/__module.js +1 -1
- package/src/core/binary/BinaryBuffer.js +2 -1
- package/src/core/cache/Cache.js +1 -1
- package/src/core/cache/LoadingCache.js +10 -5
- package/src/core/collection/Stack.js +11 -14
- package/src/core/collection/array/array_contains_duplicates.js +5 -2
- package/src/core/collection/array/array_contains_duplicates.spec.js +14 -0
- package/src/core/collection/array/array_copy_entire.js +6 -11
- package/src/core/collection/array/array_get_index_in_range.js +5 -0
- package/src/core/collection/array/array_get_index_in_range.spec.js +16 -0
- package/src/core/collection/array/array_remove_element.js +6 -9
- package/src/core/collection/array/array_remove_first.js +13 -6
- package/src/core/collection/array/array_remove_first.spec.js +39 -0
- package/src/core/collection/array/binarySearchHighIndex.spec.js +10 -9
- package/src/core/collection/array/groupArrayBy.js +1 -1
- package/src/core/collection/array/isArrayEqual.js +4 -1
- package/src/core/collection/array/randomizeArrayElementOrder.js +1 -0
- package/src/core/collection/array/randomizeArrayElementOrder.spec.js +27 -0
- package/src/core/collection/heap/Uin32Heap.spec.js +100 -0
- package/src/core/collection/heap/Uint32Heap.js +16 -7
- package/src/core/collection/list/List.js +1 -0
- package/src/core/collection/{HashMap.js → map/HashMap.js} +10 -10
- package/src/core/collection/{HashMap.spec.js → map/HashMap.spec.js} +1 -1
- package/src/core/collection/{ObservedMap.js → map/ObservedMap.js} +1 -1
- package/src/core/collection/{HashSet.js → set/HashSet.js} +4 -3
- package/src/core/collection/{Set.d.ts → set/Set.d.ts} +1 -1
- package/src/core/collection/{Set.js → set/Set.js} +17 -14
- package/src/core/function/FunctionCompiler.js +4 -4
- package/src/core/function/Functions.js +0 -19
- package/src/core/geom/2d/aabb/AABB2.js +1 -1
- package/src/core/geom/3d/SurfacePoint3.js +30 -20
- package/src/core/geom/3d/SurfacePoint3.spec.js +116 -0
- package/src/core/geom/3d/aabb/AABB3.js +13 -10
- package/src/core/geom/3d/aabb/{aabb3_array_contains_point.js → aabb3_array_intersects_point.js} +4 -1
- package/src/core/geom/3d/aabb/aabb3_from_min_max.js +25 -1
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js +2 -25
- package/src/core/geom/3d/aabb/aabb3_signed_distance_sqr_to_point.js +5 -1
- package/src/core/geom/3d/apply_mat4_transform_to_direction_v3_array.js +5 -1
- package/src/core/geom/3d/apply_mat4_transform_to_v3_array.js +5 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_calc_edges.js +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.spec.js +26 -0
- package/src/core/geom/3d/v3_compute_triangle_normal.spec.js +18 -0
- package/src/core/geom/Vector2.js +1 -1
- package/src/core/geom/Vector3.js +1 -1
- package/src/core/geom/packing/miniball/Miniball.spec.js +24 -0
- package/src/core/math/statistics/computeStatisticalPartialMedian.js +2 -2
- package/src/core/model/ObservedInteger.js +12 -7
- package/src/core/model/ObservedString.js +10 -8
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +1 -1
- package/src/core/model/object/ImmutableObjectPool.js +1 -1
- package/src/core/model/object/read_property.js +2 -2
- package/src/core/model/object/write_property.js +3 -3
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +1 -1
- package/src/core/primitives/numbers/compareNumbers.js +4 -4
- package/src/core/primitives/numbers/number_compare_ascending.js +9 -0
- package/src/core/primitives/numbers/number_compare_ascending.spec.js +9 -0
- package/src/core/primitives/numbers/number_compare_descending.js +9 -0
- package/src/core/primitives/numbers/number_compare_descending.spec.js +9 -0
- package/src/core/primitives/numbers/number_format_by_thousands.spec.js +12 -0
- package/src/core/primitives/numbers/number_pretty_print.js +1 -1
- package/src/core/primitives/strings/compareStrings.spec.js +12 -0
- package/src/core/primitives/strings/string_capitalize.js +15 -0
- package/src/core/primitives/strings/string_capitalize.spec.js +13 -0
- package/src/core/primitives/strings/string_compute_byte_size.js +21 -0
- package/src/core/primitives/strings/string_compute_common_prefix.js +44 -0
- package/src/core/primitives/strings/string_compute_common_prefix.spec.js +23 -0
- package/src/core/primitives/strings/string_format_camel_to_kebab.js +9 -0
- package/src/core/primitives/strings/string_format_camel_to_kebab.spec.js +8 -0
- package/src/core/primitives/strings/string_format_kebab_to_underscore.js +8 -0
- package/src/core/time/current_time_in_seconds.js +11 -0
- package/src/engine/Clock.js +3 -13
- package/src/engine/animation/curve/AnimationCurve.spec.js +27 -0
- package/src/engine/asset/AssetManager.js +5 -5
- package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
- package/src/engine/ecs/EntityBlueprint.js +8 -10
- package/src/engine/ecs/EntityManager.js +8 -1
- package/src/engine/ecs/EntityManager.spec.js +56 -6
- package/src/engine/ecs/animation/Animation.spec.js +22 -0
- package/src/engine/ecs/animation/AnimationSerializationAdapter.js +2 -5
- package/src/engine/ecs/attachment/Attachment.js +24 -25
- package/src/engine/ecs/attachment/AttachmentBinding.js +27 -30
- package/src/engine/ecs/attachment/AttachmentSystem.js +21 -24
- package/src/engine/ecs/attachment/BoneAttachmentBinding.js +6 -9
- package/src/engine/ecs/attachment/TransformAttachmentBinding.js +0 -3
- package/src/engine/ecs/components/CharacterController.js +24 -18
- package/src/engine/ecs/components/Motion.js +0 -27
- package/src/engine/ecs/components/MotionSerializationAdapter.js +26 -0
- package/src/engine/ecs/components/PropertySet.js +0 -29
- package/src/engine/ecs/components/PropertySetSerializationAdapter.js +29 -0
- package/src/engine/ecs/components/SerializationMetadata.js +0 -28
- package/src/engine/ecs/components/SerializationMetadataSerializationAdapter.js +26 -0
- package/src/engine/ecs/components/Steering.js +0 -35
- package/src/engine/ecs/components/SteeringSerializationAdapter.js +34 -0
- package/src/engine/ecs/components/Tag.js +6 -102
- package/src/engine/ecs/components/TagSerializationAdapter.js +44 -0
- package/src/engine/ecs/components/TagSerializationUpgrader_0_1.js +18 -0
- package/src/engine/ecs/components/Timer.js +1 -1
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +4 -3
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleCooldownDescription.js +10 -14
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +31 -39
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescriptionTable.js +1 -1
- package/src/engine/ecs/dynamic_actions/{DynamicRuleDescriptionTable.spec.js → rules/DynamicRuleDescriptionTable.spec.js} +12 -12
- package/src/engine/ecs/foliage/ecs/InstancedMeshSerializationAdapter.js +2 -5
- package/src/engine/ecs/fow/FogOfWarRevealer.js +2 -3
- package/src/engine/ecs/fow/serialization/FogOfWarRevealerSerializationAdapter.js +2 -5
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationAdapter.js +5 -8
- package/src/engine/ecs/gui/GUIElementSerializationAdapter.js +2 -5
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySerializationAdapter.js +3 -6
- package/src/engine/ecs/gui/position/ViewportPosition.js +2 -5
- package/src/engine/ecs/ik/IKConstraint.js +95 -0
- package/src/engine/ecs/ik/IKMath.js +6 -1
- package/src/engine/ecs/ik/IKProblem.js +17 -17
- package/src/engine/ecs/ik/InverseKinematics.js +14 -174
- package/src/engine/ecs/ik/InverseKinematicsSerializationAdapter.js +72 -0
- package/src/engine/ecs/ik/InverseKinematicsSystem.js +24 -26
- package/src/engine/ecs/speaker/Voice.js +5 -8
- package/src/engine/ecs/speaker/VoiceSystem.js +15 -19
- package/src/engine/ecs/speaker/lines/LineDescription.js +20 -25
- package/src/engine/ecs/speaker/lines/sets/LineSetDescription.js +15 -19
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +3 -3
- package/src/engine/ecs/storage/binary/BinaryClassSerializationAdapter.js +7 -0
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +1 -1
- package/src/engine/ecs/storage/binary/object/ObjectBasedClassSerializationAdapter.js +6 -9
- package/src/engine/ecs/systems/TagSystem.js +1 -6
- package/src/engine/ecs/team/TeamSerializationAdapter.js +2 -5
- package/src/engine/ecs/terrain/ecs/Terrain.spec.js +5 -0
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrain.js +23 -21
- package/src/engine/ecs/terrain/ecs/cling/ClingToTerrainSerializationAdapter.js +2 -5
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayer.js +2 -2
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +2 -40
- package/src/engine/ecs/terrain/serialization/TerrainSerializationAdapter.js +7 -10
- package/src/engine/ecs/tooltip/TooltipComponent.spec.js +47 -0
- package/src/engine/ecs/tooltip/TooltipComponentSerializationAdapter.js +2 -5
- package/src/engine/ecs/transform/Transform.spec.js +52 -0
- package/src/engine/ecs/transform/TransformSerializationAdapter.js +2 -5
- package/src/engine/ecs/transform-attachment/TransformAttachment.js +18 -19
- package/src/engine/graphics/ecs/animation/AnimationController.js +20 -129
- package/src/engine/graphics/ecs/animation/AnimationControllerSerializationAdapter.js +27 -0
- package/src/engine/graphics/ecs/animation/AnimationRule.js +79 -0
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraphSerializationAdapter.js +9 -11
- package/src/engine/graphics/ecs/animation/animator/graph/definition/serialization/AnimationGraphDefinitionSerializationAdapter.js +3 -5
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationAdapter.js +2 -6
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLander.js +3 -15
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +2 -4
- package/src/engine/graphics/ecs/highlight/HighlightSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +1 -1
- package/src/engine/graphics/ecs/light/LightSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/mesh/serialization/MeshSerializationAdapter.js +2 -5
- package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +3 -0
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.spec.js +14 -0
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/InstancedRendererAdapter.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.js +21 -9
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/SGCacheKey.spec.js +79 -0
- package/src/engine/graphics/ecs/water/WaterSerializationAdapter.js +2 -5
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
- package/src/engine/graphics/material/manager/MaterialManager.js +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +1 -1
- package/src/engine/graphics/particles/node-based/codegen/CodeContext.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +2 -5
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationAdapter.js +2 -5
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +1 -1
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.spec.js +7 -6
- package/src/engine/graphics/texture/atlas/ManagedTextureAtlas.js +1 -1
- package/src/engine/graphics/texture/sampler/serialization/Sampler2DSerializationAdapter.js +2 -5
- package/src/engine/grid/grid2transform/GridPosition2Transform.js +11 -13
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationAdapter.js +3 -5
- package/src/engine/grid/obstacle/GridObstacleSerializationAdapter.js +2 -5
- package/src/engine/grid/position/GridPositionSerializationAdapter.js +2 -5
- package/src/engine/grid/transform2grid/Transform2GridPosition.js +10 -13
- package/src/engine/input/devices/KeyboardDevice.js +5 -2
- package/src/engine/input/devices/KeyboardDevice.spec.js +12 -0
- package/src/engine/input/devices/PointerDevice.js +5 -1
- package/src/engine/input/ecs/components/Input.js +37 -11
- package/src/engine/input/ecs/ism/InputBinding.js +30 -12
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +7 -10
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehaviorSerializationAdapter.js +2 -5
- package/src/engine/intelligence/behavior/primitive/FailingBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/primitive/SucceedingBehaviorSerializationAdapter.js +2 -5
- package/src/engine/intelligence/blackboard/BlackboardSerializationAdapter.js +2 -5
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.js +12 -13
- package/src/engine/knowledge/database/StaticKnowledgeDatabase.spec.js +23 -0
- package/src/engine/navigation/ecs/components/PathSerializationAdapter.js +2 -5
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationAdapter.js +2 -5
- package/src/engine/navigation/grid/find_path_on_grid_astar.spec.js +25 -0
- package/src/engine/options/OptionAbstract.js +6 -5
- package/src/engine/options/OptionGroup.js +13 -25
- package/src/engine/options/OptionGroup.spec.js +61 -0
- package/src/engine/save/storage/InMemoryStorage.js +3 -2
- package/src/engine/simulation/Ticker.js +17 -20
- package/src/engine/sound/ecs/SoundController.js +2 -6
- package/src/engine/sound/ecs/SoundListener.js +3 -21
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationAdapter.js +2 -6
- package/src/generation/GridTaskGroup.js +5 -9
- package/src/generation/filtering/numeric/CellFilterCache.js +12 -16
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.js +31 -32
- package/src/generation/filtering/numeric/complex/CellFilterLookupTable.js +6 -9
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +7 -10
- package/src/generation/filtering/numeric/complex/CellFilterSobel.js +6 -9
- package/src/generation/filtering/numeric/math/CellFilterMembershipGeneralizedBell.js +18 -21
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +24 -25
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +1 -1
- package/src/generation/grid/GridData.js +23 -22
- package/src/generation/grid/GridData.spec.js +41 -0
- package/src/generation/grid/GridTaskGenerator.js +7 -8
- package/src/generation/grid/layers/GridDataLayer.js +23 -25
- package/src/generation/markers/GridActionRuleSet.js +20 -22
- package/src/generation/markers/GridCellActionPlaceMarker.js +40 -43
- package/src/generation/markers/GridCellActionPlaceMarkerGroup.js +7 -9
- package/src/generation/markers/MarkerNode.js +44 -44
- package/src/generation/markers/actions/MarkerNodeActionEntityPlacement.js +15 -18
- package/src/generation/markers/actions/MarkerNodeActionSequence.js +6 -9
- package/src/generation/markers/actions/MarkerNodeProcessingRuleSet.js +5 -7
- package/src/generation/markers/actions/MarkerProcessingRule.js +25 -26
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorClingToTerrain.js +12 -15
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorRandomRotation.js +2 -5
- package/src/generation/markers/actions/placement/MarkerNodeEntityProcessorSequence.js +6 -9
- package/src/generation/markers/actions/probability/MarkerNodeActionSelectWeighted.js +8 -11
- package/src/generation/markers/actions/probability/MarkerNodeActionWeightedElement.js +13 -13
- package/src/generation/markers/actions/util/GridCellActionDebugBreak.js +5 -8
- package/src/generation/markers/actions/util/GridCellActionLogToConsole.js +1 -4
- package/src/generation/markers/emitter/MarkerNodeConsumerBuffer.js +10 -13
- package/src/generation/markers/emitter/MarkerNodeEmitterFromAction.js +5 -9
- package/src/generation/markers/emitter/MarkerNodeEmitterGridCellAction.js +12 -15
- package/src/generation/markers/emitter/MarkerNodeEmitterGroup.js +5 -8
- package/src/generation/markers/emitter/MarkerNodeEmitterPredicated.js +18 -21
- package/src/generation/markers/matcher/MarkerNodeMatcher.js +2 -1
- package/src/generation/markers/matcher/MarkerNodeMatcherBinary.js +12 -13
- package/src/generation/markers/matcher/MarkerNodeMatcherContainsTag.js +7 -9
- package/src/generation/markers/matcher/MarkerNodeMatcherNot.js +7 -9
- package/src/generation/markers/predicate/GridDataNodePredicateBinary.js +10 -14
- package/src/generation/markers/predicate/GridDataNodePredicateNot.js +9 -11
- package/src/generation/markers/predicate/GridDataNodePredicateOverlaps.js +6 -9
- package/src/generation/markers/transform/MarkerNodeTransformRotateRandom.js +2 -6
- package/src/generation/markers/transform/MarkerNodeTransformerAddPositionYFromFilter.js +6 -9
- package/src/generation/markers/transform/MarkerNodeTransformerOffsetPosition.js +1 -4
- package/src/generation/markers/transform/MarkerNodeTransformerRecordProperty.js +12 -15
- package/src/generation/markers/transform/MarkerNodeTransformerRecordPropertyClosure.js +14 -17
- package/src/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js +21 -23
- package/src/generation/markers/transform/MarkerNodeTransformerRemoveTag.js +1 -4
- package/src/generation/markers/transform/MarkerNodeTransformerSequence.js +6 -9
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilter.js +13 -17
- package/src/generation/markers/transform/MarkerNodeTransformerYRotateByFilterGradient.js +12 -16
- package/src/generation/placement/GridCellActionTransformNearbyMarkers.js +26 -29
- package/src/generation/placement/GridCellPlacementRule.js +30 -32
- package/src/generation/placement/action/GridCellActionPlaceTags.js +26 -28
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +16 -20
- package/src/generation/placement/action/random/weighted/CellActionSelectWeightedRandom.js +13 -16
- package/src/generation/placement/action/random/weighted/WeightedGridCellAction.js +11 -14
- package/src/generation/placement/action/util/CellMatcherWithinAABB.js +2 -6
- package/src/generation/placement/action/util/GridCellActionSequence.js +7 -9
- package/src/generation/placement/action/util/GridCellDisplacedAction.js +9 -12
- package/src/generation/rules/CellMatcherFromFilter.js +6 -9
- package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -9
- package/src/generation/rules/GridLayerCellMatcher.js +11 -14
- package/src/generation/rules/cell/CellMatcherContainsMarkerWithinRadius.js +11 -14
- package/src/generation/rules/cell/CellMatcherGridPattern.js +6 -8
- package/src/generation/rules/cell/GridPatternMatcherCell.js +11 -12
- package/src/generation/rules/logic/CellMatcherBinary.js +10 -14
- package/src/generation/rules/logic/CellMatcherDecorator.js +5 -8
- package/src/generation/theme/AreaMask.js +15 -17
- package/src/generation/theme/AreaTheme.js +7 -8
- package/src/generation/theme/TerrainLayerDescription.js +10 -12
- package/src/generation/theme/TerrainLayerRule.js +11 -13
- package/src/generation/theme/TerrainTheme.js +6 -7
- package/src/generation/theme/Theme.js +15 -17
- package/src/generation/theme/ThemeEngine.js +17 -19
- package/src/view/string_tag_to_css_class_name.js +2 -2
- package/src/view/tooltip/gml/TooltipParser.js +2 -2
- package/src/core/cache/PersistentCacheAdapter.js +0 -378
- package/src/core/collection/LazyStream.js +0 -23
- package/src/core/collection/LazyStream.spec.js +0 -13
- package/src/core/collection/heap/BinaryHeap.js +0 -153
- package/src/core/primitives/strings/StringUtils.js +0 -105
- package/src/core/primitives/strings/StringUtils.spec.js +0 -42
- package/src/engine/ecs/components/GeometryBVH.js +0 -44
- package/src/engine/ecs/components/MonsterAI.js +0 -15
- package/src/engine/ecs/systems/GeometryBVHSystem.js +0 -36
- package/src/generation/markers/MarkerRelation.js +0 -13
- /package/src/core/collection/{HashMap.d.ts → map/HashMap.d.ts} +0 -0
- /package/src/core/collection/{HashSet.d.ts → set/HashSet.d.ts} +0 -0
|
@@ -11,22 +11,19 @@ import { binarySearchHighIndex } from "../../../../../core/collection/array/bina
|
|
|
11
11
|
const evaluatedWeights = [];
|
|
12
12
|
|
|
13
13
|
export class CellActionSelectWeightedRandom extends GridCellAction {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
|
-
this.options = [];
|
|
29
|
-
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @type {function}
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
__random = seededRandom(0);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {WeightedGridCellAction[]}
|
|
25
|
+
*/
|
|
26
|
+
options = [];
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
/**
|
|
@@ -2,20 +2,17 @@ import { assert } from "../../../../../core/assert.js";
|
|
|
2
2
|
|
|
3
3
|
export class WeightedGridCellAction {
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
this.weight = null;
|
|
18
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {GridCellAction}
|
|
8
|
+
*/
|
|
9
|
+
action = null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {CellFilter}
|
|
14
|
+
*/
|
|
15
|
+
weight = null;
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
*
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { CellMatcher } from "../../../rules/CellMatcher.js";
|
|
2
|
-
import AABB2 from "../../../../core/geom/AABB2.js";
|
|
2
|
+
import AABB2 from "../../../../core/geom/2d/aabb/AABB2.js";
|
|
3
3
|
|
|
4
4
|
export class CellMatcherWithinAABB extends CellMatcher {
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
super();
|
|
8
|
-
|
|
9
|
-
this.area = new AABB2();
|
|
10
|
-
}
|
|
6
|
+
area = new AABB2();
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
9
|
*
|
|
@@ -5,15 +5,13 @@ import { assert } from "../../../../core/assert.js";
|
|
|
5
5
|
* Wrapper around multiple actions
|
|
6
6
|
*/
|
|
7
7
|
export class GridCellActionSequence extends GridCellAction {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.elements = [];
|
|
16
|
-
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {GridCellAction[]}
|
|
12
|
+
*/
|
|
13
|
+
elements = [];
|
|
14
|
+
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
17
|
*
|
|
@@ -3,17 +3,14 @@ import Vector2 from "../../../../core/geom/Vector2.js";
|
|
|
3
3
|
import { assert } from "../../../../core/assert.js";
|
|
4
4
|
|
|
5
5
|
export class GridCellDisplacedAction extends GridCellAction {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
offset = new Vector2();
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @type {GridCellAction}
|
|
12
|
+
*/
|
|
13
|
+
action = null;
|
|
17
14
|
|
|
18
15
|
/**
|
|
19
16
|
*
|
|
@@ -22,13 +19,13 @@ export class GridCellDisplacedAction extends GridCellAction {
|
|
|
22
19
|
* @param {number} y
|
|
23
20
|
* @returns {GridCellDisplacedAction}
|
|
24
21
|
*/
|
|
25
|
-
static from(source, x,y){
|
|
22
|
+
static from(source, x, y) {
|
|
26
23
|
|
|
27
|
-
assert.equal(source.isGridCellAction, true,'source.isGridCellAction !== true');
|
|
24
|
+
assert.equal(source.isGridCellAction, true, 'source.isGridCellAction !== true');
|
|
28
25
|
|
|
29
26
|
const r = new GridCellDisplacedAction();
|
|
30
27
|
|
|
31
|
-
r.offset.set(x,y);
|
|
28
|
+
r.offset.set(x, y);
|
|
32
29
|
r.action = source;
|
|
33
30
|
|
|
34
31
|
return r;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { CellMatcher } from "./CellMatcher.js";
|
|
2
2
|
|
|
3
3
|
export class CellMatcherFromFilter extends CellMatcher {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
this.filter = null;
|
|
12
|
-
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {CellFilter|null}
|
|
8
|
+
*/
|
|
9
|
+
filter = null;
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
*
|
|
@@ -3,15 +3,12 @@ import { GridLayerCellMatcher } from "./GridLayerCellMatcher.js";
|
|
|
3
3
|
import { clamp01 } from "../../core/math/clamp01.js";
|
|
4
4
|
|
|
5
5
|
export class CellMatcherLayerBitMaskTest extends GridLayerCellMatcher {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
this.mask = 0;
|
|
14
|
-
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Mask
|
|
9
|
+
* @type {number}
|
|
10
|
+
*/
|
|
11
|
+
mask = 0;
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
match(grid, x, y, rotation) {
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { CellMatcher } from "./CellMatcher.js";
|
|
2
2
|
|
|
3
3
|
export class GridLayerCellMatcher extends CellMatcher {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {string}
|
|
8
|
+
*/
|
|
9
|
+
layerId = null;
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {GridDataLayer}
|
|
14
|
+
* @protected
|
|
15
|
+
*/
|
|
16
|
+
__layer = null;
|
|
20
17
|
|
|
21
18
|
|
|
22
19
|
initialize(grid, seed) {
|
|
@@ -2,20 +2,17 @@ import { CellMatcher } from "../CellMatcher.js";
|
|
|
2
2
|
import { assert } from "../../../core/assert.js";
|
|
3
3
|
|
|
4
4
|
export class CellMatcherContainsMarkerWithinRadius extends CellMatcher {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
this.radius = 1;
|
|
18
|
-
}
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @type {MarkerNodeMatcher}
|
|
8
|
+
*/
|
|
9
|
+
matcher = null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Search radius
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
radius = 1;
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
*
|
|
@@ -3,14 +3,12 @@ import { GridPatternMatcherCell } from "./GridPatternMatcherCell.js";
|
|
|
3
3
|
import { CellMatcher } from "../CellMatcher.js";
|
|
4
4
|
|
|
5
5
|
export class CellMatcherGridPattern extends CellMatcher {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.rules = [];
|
|
13
|
-
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* NOTE: All rules have local coordinates
|
|
9
|
+
* @type {GridPatternMatcherCell[]}
|
|
10
|
+
*/
|
|
11
|
+
rules = [];
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
*
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import Vector2 from "../../../core/geom/Vector2.js";
|
|
2
2
|
|
|
3
3
|
export class GridPatternMatcherCell {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @type {CellMatcher}
|
|
7
|
+
*/
|
|
8
|
+
rule = null;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @type {Vector2}
|
|
13
|
+
*/
|
|
14
|
+
position = new Vector2();
|
|
10
15
|
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @type {Vector2}
|
|
14
|
-
*/
|
|
15
|
-
this.position = new Vector2();
|
|
16
|
-
}
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
*
|
|
@@ -2,20 +2,16 @@ import { CellMatcher } from "../CellMatcher.js";
|
|
|
2
2
|
|
|
3
3
|
export class CellMatcherBinary extends CellMatcher {
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* @type {CellMatcher}
|
|
16
|
-
*/
|
|
17
|
-
this.right = null;
|
|
18
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {CellMatcher}
|
|
8
|
+
*/
|
|
9
|
+
left = null;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @type {CellMatcher}
|
|
13
|
+
*/
|
|
14
|
+
right = null;
|
|
19
15
|
|
|
20
16
|
initialize(grid, seed) {
|
|
21
17
|
this.left.initialize(grid, seed);
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { CellMatcher } from "../CellMatcher.js";
|
|
2
2
|
|
|
3
3
|
export class CellMatcherDecorator extends CellMatcher {
|
|
4
|
-
constructor() {
|
|
5
|
-
super();
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {CellMatcher}
|
|
8
|
+
*/
|
|
9
|
+
source = null;
|
|
13
10
|
|
|
14
11
|
initialize(grid, seed) {
|
|
15
12
|
this.source.initialize(grid, seed);
|
|
@@ -5,23 +5,21 @@ import {
|
|
|
5
5
|
} from "../../engine/graphics/texture/sampler/distance/computeUnsignedDistanceField.js";
|
|
6
6
|
|
|
7
7
|
export class AreaMask {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.bounds = new AABB2(0, 0, 0, 0);
|
|
24
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {Sampler2D}
|
|
11
|
+
*/
|
|
12
|
+
mask = Sampler2D.uint8(1, 1, 1);
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @type {Sampler2D}
|
|
16
|
+
*/
|
|
17
|
+
distanceField = Sampler2D.uint8(1, 1, 1);
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {AABB2}
|
|
21
|
+
*/
|
|
22
|
+
bounds = new AABB2(0, 0, 0, 0);
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
25
|
*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { AreaMask } from "./AreaMask.js";
|
|
2
2
|
|
|
3
3
|
export class AreaTheme {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mask = new AreaMask();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @type {Theme}
|
|
9
|
+
*/
|
|
10
|
+
theme = null;
|
|
6
11
|
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @type {Theme}
|
|
10
|
-
*/
|
|
11
|
-
this.theme = null;
|
|
12
|
-
}
|
|
13
12
|
}
|
|
@@ -2,19 +2,17 @@ import { computeStringHash } from "../../core/primitives/strings/computeStringHa
|
|
|
2
2
|
import Vector2 from "../../core/geom/Vector2.js";
|
|
3
3
|
|
|
4
4
|
export class TerrainLayerDescription {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.diffuse = '';
|
|
5
|
+
/**
|
|
6
|
+
* URL to diffuse texture
|
|
7
|
+
* @type {string}
|
|
8
|
+
*/
|
|
9
|
+
diffuse = '';
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {Vector2}
|
|
14
|
+
*/
|
|
15
|
+
size = new Vector2(1, 1);
|
|
18
16
|
|
|
19
17
|
hash() {
|
|
20
18
|
return computeStringHash(this.diffuse) ^ this.size.hash();
|
|
@@ -2,20 +2,18 @@ import { assert } from "../../core/assert.js";
|
|
|
2
2
|
import { TerrainLayerDescription } from "./TerrainLayerDescription.js";
|
|
3
3
|
|
|
4
4
|
export class TerrainLayerRule {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.layer = new TerrainLayerDescription();
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {CellFilter}
|
|
8
|
+
*/
|
|
9
|
+
filter = null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @type {TerrainLayerDescription}
|
|
14
|
+
*/
|
|
15
|
+
layer = new TerrainLayerDescription();
|
|
17
16
|
|
|
18
|
-
}
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
*
|
|
@@ -2,13 +2,12 @@ import { assert } from "../../core/assert.js";
|
|
|
2
2
|
import { seededRandom } from "../../core/math/random/seededRandom.js";
|
|
3
3
|
|
|
4
4
|
export class TerrainTheme {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @type {TerrainLayerRule[]}
|
|
8
|
+
*/
|
|
9
|
+
rules = [];
|
|
10
|
+
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
@@ -4,26 +4,24 @@ import { CellProcessingRuleSet } from "./cell/CellProcessingRuleSet.js";
|
|
|
4
4
|
import { assert } from "../../core/assert.js";
|
|
5
5
|
|
|
6
6
|
export class Theme {
|
|
7
|
-
constructor() {
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @type {TerrainTheme}
|
|
11
|
+
*/
|
|
12
|
+
terrain = new TerrainTheme();
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {MarkerNodeProcessingRuleSet}
|
|
17
|
+
*/
|
|
18
|
+
nodes = new MarkerNodeProcessingRuleSet();
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @type {CellProcessingRuleSet}
|
|
23
|
+
*/
|
|
24
|
+
cells = new CellProcessingRuleSet();
|
|
27
25
|
|
|
28
26
|
/**
|
|
29
27
|
*
|
|
@@ -10,7 +10,7 @@ import TaskGroup from "../../core/process/task/TaskGroup.js";
|
|
|
10
10
|
import Future from "../../core/process/Future.js";
|
|
11
11
|
import { optimizeIndividualMeshesEntitiesToInstances } from "../../engine/ecs/foliage/ecs/InstancedMeshUtils.js";
|
|
12
12
|
import TaskState from "../../core/process/task/TaskState.js";
|
|
13
|
-
import { HashMap } from "../../core/collection/HashMap.js";
|
|
13
|
+
import { HashMap } from "../../core/collection/map/HashMap.js";
|
|
14
14
|
import { TerrainLayer } from "../../engine/ecs/terrain/ecs/layers/TerrainLayer.js";
|
|
15
15
|
import { TerrainFlags } from "../../engine/ecs/terrain/ecs/TerrainFlags.js";
|
|
16
16
|
import { binarySearchLowIndex } from "../../core/collection/array/binarySearchLowIndex.js";
|
|
@@ -55,27 +55,25 @@ function prepare_terrain_for_themes(layer_mapping, themes) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export class ThemeEngine {
|
|
58
|
-
constructor() {
|
|
59
58
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {QuadTreeNode<AreaTheme>}
|
|
62
|
+
*/
|
|
63
|
+
areas = new QuadTreeNode();
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {function():number}
|
|
68
|
+
*/
|
|
69
|
+
random = seededRandom(1);
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @type {AssetManager}
|
|
74
|
+
* @private
|
|
75
|
+
*/
|
|
76
|
+
__assetManager = null;
|
|
79
77
|
|
|
80
78
|
set assetManager(v) {
|
|
81
79
|
this.__assetManager = v;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { string_format_camel_to_kebab } from "../core/primitives/strings/string_format_camel_to_kebab.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ import { camelToKebab } from "../core/primitives/strings/StringUtils.js";
|
|
|
6
6
|
* @returns {string}
|
|
7
7
|
*/
|
|
8
8
|
export function string_tag_to_css_class_name(a) {
|
|
9
|
-
const name =
|
|
9
|
+
const name = string_format_camel_to_kebab(a);
|
|
10
10
|
|
|
11
11
|
return `tag-${name}`;
|
|
12
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Cache } from "../../../core/cache/Cache.js";
|
|
2
|
-
import { computeUTF8StringByteSize } from "../../../core/primitives/strings/StringUtils.js";
|
|
3
2
|
import { strictEquals } from "../../../core/function/Functions.js";
|
|
4
3
|
import { parseTooltipString } from "./parser/parseTooltipString.js";
|
|
5
4
|
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
|
|
5
|
+
import { string_compute_byte_size } from "../../../core/primitives/strings/string_compute_byte_size.js";
|
|
6
6
|
|
|
7
7
|
export class TooltipParser {
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@ export class TooltipParser {
|
|
|
15
15
|
*/
|
|
16
16
|
this.__cache = new Cache({
|
|
17
17
|
maxWeight: 1048576,
|
|
18
|
-
keyWeigher:
|
|
18
|
+
keyWeigher: string_compute_byte_size,
|
|
19
19
|
valueWeigher(tokens) {
|
|
20
20
|
return tokens.length * 256;
|
|
21
21
|
},
|