@woosh/meep-engine 2.33.20 → 2.33.24
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/core/assert.js +3 -1
- package/core/bvh2/BinaryNode.js +1 -1
- package/core/bvh2/aabb3/AABB3.js +18 -0
- package/core/bvh2/aabb3/AABB3Math.js +1 -1
- package/core/bvh2/binary/2/BinaryUint32BVH.js +498 -0
- package/core/bvh2/binary/2/BinaryUint32BVH.spec.js +54 -0
- package/core/bvh2/binary/IndexedBinaryBVH.js +22 -26
- package/core/bvh2/traversal/__detailed_box_volume_intersection.js +11 -8
- package/core/collection/ArrayUtils.js +1 -1
- package/core/collection/HashMap.js +66 -22
- package/core/collection/array/arrayQuickSort.js +9 -6
- package/core/collection/array/array_swap.js +22 -0
- package/core/collection/array/computeHashArray.js +22 -0
- package/core/collection/array/computeHashIntegerArray.js +15 -0
- package/core/collection/table/DataType2TypedArrayConstructorMapping.js +15 -0
- package/core/color/Color.js +2 -1
- package/core/function/FunctionCompiler.js +2 -1
- package/core/geom/3d/CircleMath.js +4 -4
- package/core/geom/3d/aabb/aabb3_computeDistanceAbovePlane.js +9 -33
- package/core/geom/3d/cone/computeConeBoundingBox.js +4 -4
- package/core/geom/3d/{compute_bounding_cone_of_2_cones.js → cone/compute_bounding_cone_of_2_cones.js} +3 -3
- package/core/geom/3d/{compute_bounding_cone_of_2_cones.spec.js → cone/compute_bounding_cone_of_2_cones.spec.js} +1 -1
- package/core/geom/3d/frustum/array_setFromProjectionMatrix.js +1 -1
- package/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +11 -3
- package/core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js +41 -0
- package/core/geom/3d/morton/mortonEncode_magicbits.js +2 -1
- package/core/geom/3d/morton/reinterpret_float32_as_int32.js +13 -0
- package/core/geom/3d/morton/v3_morton_encode_transformed.js +33 -0
- package/core/geom/3d/{encode_unit3_hemioct.js → normal/hemioct/encode_unit3_hemioct.js} +0 -0
- package/core/geom/3d/{unit_hemioct.spec.js → normal/hemioct/unit_hemioct.spec.js} +1 -1
- package/core/geom/3d/normal/lamber_azimuth/transform.js +61 -0
- package/core/geom/3d/normal/spherical/sphere_map_transform.js +77 -0
- package/core/geom/3d/{lerp_planes_to_array.js → plane/lerp_planes_to_array.js} +1 -3
- package/core/geom/3d/plane/plane3_lerp.js +3 -1
- package/core/geom/3d/plane/plane3_slerp.js +4 -1
- package/core/geom/3d/{plane_computeConvex3PlaneIntersection.js → plane/plane_computeConvex3PlaneIntersection.js} +14 -16
- package/core/geom/3d/ray/ray_computeNearestPointToPoint.js +37 -0
- package/core/geom/3d/shape/AbstractShape3D.js +29 -0
- package/core/geom/3d/shape/CompositeShape.js +60 -0
- package/core/geom/3d/shape/TransformedShape3D.js +70 -0
- package/core/geom/3d/shape/UnitCubeShape3D.js +13 -0
- package/core/geom/3d/shape/UnitSphereShape3D.js +16 -0
- package/core/geom/3d/topology/TopoTriangle.js +1 -1
- package/core/geom/3d/topology/TopoVertex.js +1 -1
- package/core/geom/3d/topology/bounds/computeTraingleClusterNormalBoundingCone.js +2 -2
- package/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +1 -1
- package/core/geom/3d/topology/simplify/quadratic/Quadratic3.js +1 -1
- package/core/geom/3d/triangle/computeTrianglePlaneSide.js +1 -1
- package/core/geom/3d/triangle/computeTriangleRayIntersection.js +1 -1
- package/core/geom/3d/voxel/DenseBitVolume3D.js +87 -0
- package/core/geom/3d/voxel/buildVolumeFromProjectedGeometry.js +23 -0
- package/core/geom/AABB2.js +1 -1
- package/core/geom/ConicRay.js +3 -1
- package/core/geom/LineSegment.js +1 -77
- package/core/geom/Matrix4.js +8 -8
- package/core/geom/Plane.js +15 -10
- package/core/geom/Quaternion.js +2 -1
- package/core/geom/Rectangle.js +2 -1
- package/core/geom/Vector1.js +1 -1
- package/core/geom/Vector3.d.ts +2 -0
- package/core/geom/Vector3.js +35 -159
- package/core/geom/Vector3.spec.js +2 -1
- package/core/geom/Vector4.js +2 -1
- package/core/geom/random/randomPointInBox.js +7 -3
- package/core/geom/random/randomPointInPoint.js +6 -3
- package/core/geom/random/randomPointInSphere.js +6 -3
- package/core/geom/random/randomPointOnBox.js +7 -3
- package/core/geom/random/randomPointOnSphere.js +6 -3
- package/core/geom/v3_angle_between.js +31 -0
- package/core/geom/v3_distance.js +16 -0
- package/core/geom/v3_distance_sqr.js +17 -0
- package/core/geom/v3_dot.js +13 -0
- package/core/geom/v3_length.js +10 -0
- package/core/geom/v3_length_sqr.js +10 -0
- package/core/geom/v3_lerp.js +21 -0
- package/core/geom/v3_slerp.js +48 -0
- package/core/graph/graph_k_means_cluster.js +1 -1
- package/core/math/MathUtils.js +0 -354
- package/core/math/MathUtils.spec.js +7 -1
- package/core/math/gaussian.js +9 -0
- package/core/math/hash/computeHashFloat.js +17 -0
- package/core/math/hash/computeHashFloatArray.js +34 -0
- package/core/math/hash/computeObjectHash.js +54 -0
- package/core/math/intersects1D.js +19 -0
- package/core/math/interval/NumericInterval.js +2 -2
- package/core/math/isValueBetween.js +10 -0
- package/core/math/isValueBetweenInclusive.js +10 -0
- package/core/math/noise/curl_noise_3dt.js +1 -1
- package/core/math/noise/sdnoise.js +10 -10
- package/core/math/overlap1D.js +19 -0
- package/core/math/pingpong.js +17 -0
- package/core/math/random/makeRangedRandom.js +19 -0
- package/core/math/random/randomFloatBetween.js +14 -0
- package/core/math/random/randomFromArray.js +19 -0
- package/core/math/random/randomGaussian.js +15 -0
- package/core/math/random/randomIntegerBetween.js +14 -0
- package/core/math/random/roundFair.js +15 -0
- package/core/math/separation1D.js +21 -0
- package/core/math/solveQuadratic.js +25 -0
- package/core/model/BoundedValue.js +1 -1
- package/core/model/node-graph/node/NodeInstancePortReference.js +1 -1
- package/core/model/node-graph/node/Port.js +1 -1
- package/core/model/reactive/evaluation/MultiPredicateEvaluator.spec.js +3 -1
- package/core/model/reactive/model/ReactiveBinaryExpression.js +1 -1
- package/core/model/reactive/model/terminal/ReactiveLiteralNumber.js +1 -1
- package/core/model/reactive/model/terminal/ReactiveReference.js +1 -1
- package/core/model/reactive/model/util/createRandomReactiveExpression.js +1 -1
- package/core/model/stat/LinearModifier.js +1 -1
- package/core/primitives/array/computeIntegerArrayHash.js +6 -1
- package/engine/animation/curve/AnimationCurve.js +72 -0
- package/engine/animation/curve/Keyframe.js +27 -0
- package/engine/animation/keyed2/AnimationTrack.js +27 -3
- package/engine/asset/Asset.js +1 -1
- package/engine/asset/loaders/GLTFAssetLoader.d.ts +1 -1
- package/engine/asset/loaders/GLTFAssetLoader.js +10 -0
- package/engine/asset/loaders/image/ImageRGBADataAsset.js +8 -1
- package/engine/asset/loaders/material/computeImageBitmapEquality.js +11 -0
- package/engine/asset/loaders/material/computeImageBitmapHash.js +22 -28
- package/engine/asset/loaders/material/computeMaterialHash.js +4 -3
- package/engine/asset/loaders/material/computeTextureEquality.js +13 -5
- package/engine/asset/loaders/material/computeTextureHash.js +2 -1
- package/engine/ecs/animation/Animation.js +2 -1
- package/engine/ecs/animation/InverseKinematics.js +2 -1
- package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +3 -1
- package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +3 -1
- package/engine/ecs/dynamic_actions/DynamicActorSystem.js +2 -1
- package/engine/ecs/dynamic_actions/DynamicRuleDescriptionTable.spec.js +3 -5
- package/engine/ecs/dynamic_actions/actions/definition/WeightedRandomActionDescription.js +1 -1
- package/engine/ecs/evaluation/complex/PointFitnessGaussianBlur.js +1 -1
- package/engine/ecs/foliage/ecs/Foliage2.js +1 -1
- package/engine/ecs/fow/FogOfWar.js +2 -3
- package/engine/ecs/fow/shader/FogOfWarRenderer.js +1 -1
- package/engine/ecs/gui/GUIElement.js +1 -1
- package/engine/ecs/gui/hud/HeadsUpDisplay.js +1 -1
- package/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +1 -1
- package/engine/ecs/gui/position/ViewportPosition.js +2 -1
- package/engine/ecs/systems/RangedAttackSystem.js +1 -1
- package/engine/ecs/systems/SteeringSystem.js +3 -2
- package/engine/ecs/terrain/ecs/Terrain.js +6 -0
- package/engine/ecs/terrain/ecs/layers/TerrainLayers.js +5 -0
- package/engine/ecs/terrain/ecs/splat/SplatMapping.js +5 -0
- package/engine/ecs/terrain/tiles/TerrainTileManager.js +1 -1
- package/engine/ecs/tooltip/TooltipComponent.js +15 -0
- package/engine/ecs/util/hideEntityGracefully.js +18 -0
- package/engine/graphics/GraphicsEngine.js +1 -0
- package/engine/graphics/camera/testClippingPlaneComputation.js +2 -2
- package/engine/graphics/ecs/animation/animator/AnimationClip.js +2 -1
- package/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -1
- package/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -1
- package/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -1
- package/engine/graphics/ecs/animation/animator/graph/AnimationGraph.js +2 -1
- package/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -1
- package/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +1 -1
- package/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +2 -1
- package/engine/graphics/ecs/camera/CameraClippingPlaneComputer.js +2 -2
- package/engine/graphics/ecs/highlight/HighlightDefinition.js +2 -1
- package/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +0 -53
- package/engine/graphics/ecs/light/Light.d.ts +1 -1
- package/engine/graphics/ecs/light/Light.js +3 -0
- package/engine/graphics/ecs/mesh/Mesh.js +2 -1
- package/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +13 -0
- package/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +6 -0
- package/engine/graphics/ecs/path/testPathDisplaySystem.js +98 -98
- package/engine/graphics/ecs/trail2d/Trail2D.js +17 -4
- package/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +2 -3
- package/engine/graphics/ecs/trail2d/Trail2DSystem.js +34 -118
- package/engine/graphics/geometry/AttributeSpec.js +105 -0
- package/engine/graphics/{micron/format/MicronVertexDataSpec.js → geometry/VertexDataSpec.js} +56 -25
- package/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +2 -1
- package/engine/graphics/micron/build/buildMicronGeometryFromBufferGeometry.js +7 -7
- package/engine/graphics/micron/build/clustering/computeFaceCurvatureScore.js +1 -1
- package/engine/graphics/micron/build/clustering/compute_face_connection_weight.js +1 -1
- package/engine/graphics/micron/build/fill_patch_geometry_data.js +1 -1
- package/engine/graphics/micron/build/hierarchy/computePatchMergeScore.js +1 -1
- package/engine/graphics/micron/build/hierarchy/patch_combine.js +1 -1
- package/engine/graphics/micron/buildPatchwork.js +1 -1
- package/engine/graphics/micron/format/MicronGeometry.js +3 -3
- package/engine/graphics/micron/format/serialization/MicronGeometryBinarySerializationAdapter.js +2 -2
- package/engine/graphics/micron/format/serialization/deserialize_attribute_spec.js +1 -1
- package/engine/graphics/micron/format/serialization/serialize_attribute_spec.js +1 -1
- package/engine/graphics/micron/render/PatchCacheKey.js +1 -1
- package/engine/graphics/micron/render/instanced/AttributeDataTexture.js +5 -5
- package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +2 -2
- package/engine/graphics/micron/render/v1/ThreeVirtualGeometryAdapter.js +1 -1
- package/engine/graphics/particles/particular/engine/ParticularEngine.js +4 -2
- package/engine/graphics/particles/particular/engine/emitter/PARTICULAR_PARTICLE_SPECIFICATION.js +84 -0
- package/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +92 -144
- package/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +14 -3
- package/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +51 -12
- package/engine/graphics/particles/particular/engine/emitter/ParticlePool.spec.js +3 -2
- package/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.js +37 -0
- package/engine/graphics/particles/particular/engine/emitter/distance_to_camera.js +25 -0
- package/engine/graphics/particles/particular/engine/emitter/serde/ParameterLookupTableSerializationAdapter.js +8 -2
- package/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +2 -1
- package/engine/graphics/particles/particular/engine/parameter/ParameterTrack.js +1 -1
- package/engine/graphics/particles/particular/engine/parameter/ParticleParameter.js +1 -1
- package/engine/graphics/particles/particular/engine/renderers/billboard/BILLBOARD_PARTICLE_SPECIFICATION.js +21 -0
- package/engine/graphics/particles/particular/engine/renderers/billboard/ParticleBillboardMaterial.js +0 -20
- package/engine/graphics/particles/particular/engine/renderers/billboard/prototypeBillboardRenderer.js +9 -9
- package/engine/graphics/particles/particular/engine/shader/ShaderManager.js +7 -25
- package/engine/graphics/particles/particular/engine/simulator/SimulationStepApplyForce.js +2 -5
- package/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseAcceleration.js +2 -6
- package/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.js +2 -7
- package/engine/graphics/particles/particular/engine/simulator/SimulationStepFixedPhysics.js +2 -5
- package/engine/graphics/particles/particular/engine/simulator/update_parameters.js +1 -1
- package/engine/graphics/particles/particular/engine/utils/distributeParticlesOnObject3D.js +1 -1
- package/engine/graphics/particles/particular/engine/utils/distrubuteParticlesOnMesh.js +1 -1
- package/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +384 -0
- package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +558 -0
- package/engine/graphics/particles/particular/group/Operation.js +18 -0
- package/engine/graphics/particles/particular/group/OperationType.js +9 -0
- package/engine/graphics/particles/particular/group/ParticleAttribute.js +2 -1
- package/engine/graphics/particles/particular/group/ParticleAttributeType.js +11 -0
- package/engine/graphics/particles/particular/group/ParticleDataType.js +10 -0
- package/engine/graphics/particles/particular/group/ParticleGroup.js +7 -245
- package/engine/graphics/particles/particular/group/ParticleGroup.spec.js +3 -1
- package/engine/graphics/particles/particular/group/ParticleSpecification.js +21 -14
- package/engine/graphics/particles/particular/group/itemSizeFromAttributeType.js +20 -0
- package/engine/graphics/particles/particular/group/optimizeCommandQueue.js +162 -0
- package/engine/graphics/particles/particular/group/typedArrayConstructorFromDataType.js +19 -0
- package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +2 -2
- package/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js +1 -1
- package/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameter.js +2 -1
- package/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameterSet.js +1 -1
- package/engine/graphics/render/forward_plus/LightManager.js +126 -95
- package/engine/graphics/render/forward_plus/PointLight.js +9 -0
- package/engine/graphics/render/forward_plus/PointLightData.js +1 -1
- package/engine/graphics/render/forward_plus/SpotLight.js +9 -0
- package/engine/graphics/render/forward_plus/cluster/compute_light_data_hash_0.js +2 -2
- package/engine/graphics/render/forward_plus/computeFrustumCorners.js +15 -33
- package/engine/graphics/render/forward_plus/plugin/ForwardPlusRenderingPlugin.js +1 -1
- package/engine/graphics/render/forward_plus/plugin/MaterialTransformer.js +12 -2
- package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +6 -6
- package/engine/graphics/render/forward_plus/prototypeLightManager.js +231 -136
- package/engine/graphics/render/forward_plus/query/analytical_triplanar_corner_mapping.js +8 -0
- package/engine/graphics/render/forward_plus/query/cube_mapping.js +38 -0
- package/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.js +86 -0
- package/engine/graphics/render/forward_plus/query/point_light_inside_volume.js +73 -0
- package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_objects.js +131 -0
- package/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +129 -0
- package/engine/graphics/render/forward_plus/query/spot_light_inside_volume.js +33 -0
- package/engine/graphics/render/forward_plus/read_frustum_corner.js +14 -0
- package/engine/graphics/render/forward_plus/testClusterEquality.js +22 -0
- package/engine/graphics/render/layers/RenderLayerUtils.js +8 -5
- package/engine/graphics/render/visibility/IncrementalDeltaSet.js +11 -0
- package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +2 -2
- package/engine/graphics/texture/atlas/AtlasPatch.js +7 -2
- package/engine/graphics/texture/atlas/TextureAtlas.js +18 -14
- package/engine/graphics/texture/sampler/HarmonicDiffusionGrid.spec.js +1 -1
- package/engine/graphics/texture/sampler/SampleTraverser.js +1 -1
- package/engine/graphics/texture/sampler/Sampler2D.js +8 -7
- package/engine/graphics/texture/sampler/distanceField.spec.js +1 -1
- package/engine/graphics/texture/sampler/scaleSampler2D.js +7 -10
- package/engine/graphics/trail/x/RibbonMaterialX.js +3 -3
- package/engine/graphics/trail/x/RibbonX.js +17 -2
- package/engine/graphics/trail/x/RibbonXPlugin.js +51 -1
- package/engine/graphics/util/projectSphere.js +1 -1
- package/engine/grid/components/GridObstacle.js +3 -10
- package/engine/intelligence/behavior/selector/WeightedElement.js +2 -1
- package/engine/intelligence/optimization/RandomOptimizer.js +1 -1
- package/engine/navigation/ecs/components/Path.js +3 -2
- package/engine/navigation/grid/FastBinaryHeap.spec.js +1 -1
- package/engine/reference/v2/Reference.js +6 -0
- package/engine/sound/ecs/emitter/SoundEmitter.js +2 -1
- package/engine/sound/ecs/emitter/SoundTrack.js +2 -1
- package/engine/sound/material/concrete/RandomSoundMaterial.js +1 -1
- package/engine/ui/notification/notificationGenerator.js +1 -1
- package/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +3 -2
- package/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +1 -1
- package/generation/grid/generation/GridTaskExecuteRuleTimes.js +2 -1
- package/generation/markers/GridCellActionPlaceMarker.js +13 -1
- package/generation/markers/MarkerNode.js +6 -0
- package/generation/markers/actions/MarkerNodeActionSelectRandom.js +1 -1
- package/generation/markers/transform/MarkerNodeTransformerRecordUniqueRandomEnum.js +1 -1
- package/generation/placement/action/random/CellActionSelectRandom.js +1 -1
- package/generation/theme/ThemeEngine.js +5 -2
- package/misc/makeMaterialIconCached.js +2 -2
- package/package.json +3 -3
- package/view/View.js +4 -2
- package/view/elements/image/HTMLElementCacheKey.js +2 -1
- package/view/elements/radial/RadialText.js +2 -1
- package/view/minimap/gl/MinimapMarkersGL.js +19 -101
- package/view/minimap/gl/buildMaterial.js +94 -0
- package/engine/graphics/micron/format/MicronGeometryBufferAttributeSpec.js +0 -71
- package/engine/graphics/render/forward_plus/queryBVH_Frustum.js +0 -345
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import QuadTree from '../../../../core/geom/2d/quad-tree/PointQuadTree.js';
|
|
5
5
|
import AABB2 from '../../../../core/geom/AABB2.js';
|
|
6
|
-
import { makeRangedRandom} from '../../../../core/math/MathUtils.js';
|
|
7
6
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
7
|
+
import { makeRangedRandom } from "../../../../core/math/random/makeRangedRandom.js";
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
const Point2 = function (x, y) {
|
|
@@ -493,7 +493,7 @@ Sampler2D.prototype.get = function (x, y, result) {
|
|
|
493
493
|
|
|
494
494
|
const t = [];
|
|
495
495
|
|
|
496
|
-
this.sampleBilinear(x, y, t);
|
|
496
|
+
this.sampleBilinear(x, y, t, 0);
|
|
497
497
|
|
|
498
498
|
if (result !== undefined) {
|
|
499
499
|
result.readFromArray(t, 0);
|
|
@@ -655,14 +655,15 @@ Sampler2D.prototype.sampleChannelBicubic = function (x, y, channel) {
|
|
|
655
655
|
* @param {number} x
|
|
656
656
|
* @param {number} y
|
|
657
657
|
* @param {number[]} result
|
|
658
|
+
* @param {number} result_offset
|
|
658
659
|
*/
|
|
659
|
-
Sampler2D.prototype.sampleBilinear = function (x, y, result) {
|
|
660
|
+
Sampler2D.prototype.sampleBilinear = function (x, y, result, result_offset) {
|
|
660
661
|
|
|
661
662
|
const itemSize = this.itemSize;
|
|
662
663
|
|
|
663
664
|
for (let i = 0; i < itemSize; i++) {
|
|
664
665
|
//TODO this can be optimized greatly
|
|
665
|
-
result[i] = this.sampleChannelBilinear(x, y, i);
|
|
666
|
+
result[i + result_offset] = this.sampleChannelBilinear(x, y, i);
|
|
666
667
|
|
|
667
668
|
}
|
|
668
669
|
};
|
|
@@ -809,7 +810,7 @@ Sampler2D.prototype.sample = function (u, v, result) {
|
|
|
809
810
|
|
|
810
811
|
const temp = [];
|
|
811
812
|
|
|
812
|
-
this.sampleBilinear(u * (this.width - 1), v * (this.height - 1), temp);
|
|
813
|
+
this.sampleBilinear(u * (this.width - 1), v * (this.height - 1), temp, 0);
|
|
813
814
|
|
|
814
815
|
result.readFromArray(temp);
|
|
815
816
|
|
|
@@ -888,7 +889,7 @@ Sampler2D.prototype.makeArrayFiller = function (scale, offset) {
|
|
|
888
889
|
}
|
|
889
890
|
|
|
890
891
|
function fillDD2(index, array, x, y) {
|
|
891
|
-
sampler.sampleBilinear(x, y, v4);
|
|
892
|
+
sampler.sampleBilinear(x, y, v4, 0);
|
|
892
893
|
const val = (v4[0] + offset) * scale | 0;
|
|
893
894
|
array.fill(val, index, index + 3);
|
|
894
895
|
array[index + 3] = (v4[1] + offset) * scale | 0;
|
|
@@ -896,7 +897,7 @@ Sampler2D.prototype.makeArrayFiller = function (scale, offset) {
|
|
|
896
897
|
|
|
897
898
|
function fillDD3(index, array, x, y) {
|
|
898
899
|
|
|
899
|
-
sampler.sampleBilinear(x, y, v4);
|
|
900
|
+
sampler.sampleBilinear(x, y, v4, 0);
|
|
900
901
|
|
|
901
902
|
array[index] = (v4[0] + offset) * scale | 0;
|
|
902
903
|
array[index + 1] = (v4[1] + offset) * scale | 0;
|
|
@@ -905,7 +906,7 @@ Sampler2D.prototype.makeArrayFiller = function (scale, offset) {
|
|
|
905
906
|
}
|
|
906
907
|
|
|
907
908
|
function fillDD4(index, array, x, y) {
|
|
908
|
-
sampler.sampleBilinear(x, y, v4);
|
|
909
|
+
sampler.sampleBilinear(x, y, v4, 0);
|
|
909
910
|
array[index] = (v4[0] + offset) * scale | 0;
|
|
910
911
|
array[index + 1] = (v4[1] + offset) * scale | 0;
|
|
911
912
|
array[index + 2] = (v4[2] + offset) * scale | 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
2
|
import { Sampler2D } from "./Sampler2D.js";
|
|
3
3
|
import { computeUnsignedDistanceField } from "./distanceField.js";
|
|
4
|
-
import { randomIntegerBetween} from "../../../../core/math/
|
|
4
|
+
import { randomIntegerBetween } from "../../../../core/math/random/randomIntegerBetween.js";
|
|
5
5
|
|
|
6
6
|
describe('computeUnsignedDistanceField', () => {
|
|
7
7
|
test('empty', () => {
|
|
@@ -7,6 +7,7 @@ import { assert } from "../../../../core/assert.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export function scaleSampler2D(source, target) {
|
|
9
9
|
const targetItemSize = target.itemSize;
|
|
10
|
+
|
|
10
11
|
assert.equal(source.itemSize, targetItemSize, 'both source and target must have the same number of channels');
|
|
11
12
|
|
|
12
13
|
const targetWidth = target.width;
|
|
@@ -18,32 +19,28 @@ export function scaleSampler2D(source, target) {
|
|
|
18
19
|
const target_data = target.data;
|
|
19
20
|
|
|
20
21
|
if (sourceWidth === targetWidth && sourceHeight === targetHeight) {
|
|
21
|
-
// exact size match
|
|
22
|
+
// exact size match, nothing to do
|
|
22
23
|
target_data.set(source.data);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
const sample = [];
|
|
27
|
-
|
|
28
27
|
const targetRowSize = targetItemSize * targetWidth;
|
|
29
28
|
|
|
29
|
+
const source_scale_x = sourceWidth / targetWidth;
|
|
30
|
+
const source_scale_y = sourceHeight / targetHeight;
|
|
31
|
+
|
|
30
32
|
for (let y = 0; y < targetHeight; y++) {
|
|
31
33
|
|
|
32
|
-
const v = y / targetHeight;
|
|
33
34
|
|
|
35
|
+
const sample_y = y * source_scale_y;
|
|
34
36
|
const target_row_address = y * targetRowSize;
|
|
35
37
|
|
|
36
38
|
for (let x = 0; x < targetWidth; x++) {
|
|
37
39
|
|
|
38
|
-
const u = x / targetWidth;
|
|
39
|
-
|
|
40
|
-
source.sampleBilinear(u * sourceWidth, v * sourceHeight, sample);
|
|
41
40
|
|
|
42
41
|
const target_offset = target_row_address + x * targetItemSize;
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
target_data[target_offset + i] = sample[i];
|
|
46
|
-
}
|
|
43
|
+
source.sampleBilinear(x * source_scale_x, sample_y, target_data, target_offset);
|
|
47
44
|
|
|
48
45
|
}
|
|
49
46
|
}
|
|
@@ -106,11 +106,11 @@ export class RibbonMaterialX extends ShaderMaterial {
|
|
|
106
106
|
uDiffuse: {
|
|
107
107
|
type: 't',
|
|
108
108
|
value: null
|
|
109
|
-
},
|
|
110
|
-
defines: {
|
|
111
|
-
USE_TEXTURE: false
|
|
112
109
|
}
|
|
113
110
|
},
|
|
111
|
+
defines: {
|
|
112
|
+
USE_TEXTURE: false
|
|
113
|
+
},
|
|
114
114
|
blending: NormalBlending,
|
|
115
115
|
transparent: true,
|
|
116
116
|
depthWrite: false,
|
|
@@ -36,7 +36,6 @@ export class RibbonX {
|
|
|
36
36
|
*/
|
|
37
37
|
this.__data = new RowFirstTable(ribbon_attributes_spec);
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
/**
|
|
41
40
|
* Index into current geometry segment that is at the END of the ribbon
|
|
42
41
|
* @type {number}
|
|
@@ -66,6 +65,10 @@ export class RibbonX {
|
|
|
66
65
|
this.__count = 0;
|
|
67
66
|
}
|
|
68
67
|
|
|
68
|
+
dispose() {
|
|
69
|
+
this.__geometry.dispose();
|
|
70
|
+
}
|
|
71
|
+
|
|
69
72
|
/**
|
|
70
73
|
*
|
|
71
74
|
* @returns {BufferGeometry}
|
|
@@ -350,6 +353,11 @@ export class RibbonX {
|
|
|
350
353
|
this.setPointAttribute_Vector3(index, RIBBON_ATTRIBUTE_ADDRESS_COLOR, r, g, b);
|
|
351
354
|
}
|
|
352
355
|
|
|
356
|
+
/**
|
|
357
|
+
*
|
|
358
|
+
* @param {number} index
|
|
359
|
+
* @param {number} value
|
|
360
|
+
*/
|
|
353
361
|
setPointAlpha(index, value) {
|
|
354
362
|
const i2 = index * 2;
|
|
355
363
|
|
|
@@ -359,7 +367,11 @@ export class RibbonX {
|
|
|
359
367
|
this.__ib_float32.needsUpdate = true;
|
|
360
368
|
}
|
|
361
369
|
|
|
362
|
-
|
|
370
|
+
/**
|
|
371
|
+
*
|
|
372
|
+
* @param {number} index
|
|
373
|
+
* @param {number} value
|
|
374
|
+
*/
|
|
363
375
|
setPointThickness(index, value) {
|
|
364
376
|
const i2 = index * 2;
|
|
365
377
|
|
|
@@ -377,6 +389,9 @@ export class RibbonX {
|
|
|
377
389
|
assert.greaterThanOrEqual(count, 2, 'number of points in the ribbon must be at least 2 (to produce at least a single quad)');
|
|
378
390
|
assert.isNonNegativeInteger(count, 'count');
|
|
379
391
|
|
|
392
|
+
// dispose of existing geometry
|
|
393
|
+
this.__geometry.dispose();
|
|
394
|
+
|
|
380
395
|
const point_count = count * 2;
|
|
381
396
|
|
|
382
397
|
if (this.__data.length > point_count) {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { EnginePlugin } from "../../../plugin/EnginePlugin.js";
|
|
2
2
|
import { RibbonMaterialX } from "./RibbonMaterialX.js";
|
|
3
|
-
import { DoubleSide } from "three";
|
|
3
|
+
import { DoubleSide, Vector2 } from "three";
|
|
4
4
|
import { GameAssetType } from "../../../asset/GameAssetType.js";
|
|
5
5
|
import { Cache } from "../../../../core/cache/Cache.js";
|
|
6
6
|
import { invokeObjectEquals } from "../../../../core/model/object/invokeObjectEquals.js";
|
|
7
7
|
import { invokeObjectHash } from "../../../../core/model/object/invokeObjectHash.js";
|
|
8
|
+
import { MaterialManager } from "../../material/manager/MaterialManager.js";
|
|
8
9
|
|
|
9
10
|
export class RibbonXPlugin extends EnginePlugin {
|
|
10
11
|
initialize(engine) {
|
|
11
12
|
super.initialize(engine);
|
|
12
13
|
|
|
14
|
+
this.id = 'ribbon-x-plugin';
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* @private
|
|
15
18
|
* @readonly
|
|
@@ -21,6 +24,51 @@ export class RibbonXPlugin extends EnginePlugin {
|
|
|
21
24
|
keyHashFunction: invokeObjectHash,
|
|
22
25
|
keyEqualityFunction: invokeObjectEquals
|
|
23
26
|
});
|
|
27
|
+
|
|
28
|
+
this.__shared_uniforms = {
|
|
29
|
+
resolution: {
|
|
30
|
+
value: new Vector2(1, 1)
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {MaterialManager}
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
39
|
+
this.__materials = new MaterialManager();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
__handle_viewport_size_change() {
|
|
43
|
+
const s = this.engine.graphics.viewport.size;
|
|
44
|
+
|
|
45
|
+
this.__shared_uniforms.resolution.value.set(s.x, s.y);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async startup() {
|
|
49
|
+
this.__handle_viewport_size_change();
|
|
50
|
+
|
|
51
|
+
this.engine.graphics.viewport.size.onChanged.add(this.__handle_viewport_size_change, this);
|
|
52
|
+
|
|
53
|
+
return super.startup();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async shutdown() {
|
|
57
|
+
|
|
58
|
+
this.engine.graphics.viewport.size.onChanged.remove(this.__handle_viewport_size_change, this);
|
|
59
|
+
|
|
60
|
+
return super.shutdown();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {RibbonXMaterialSpec} spec
|
|
66
|
+
* @return {Reference<Material>}
|
|
67
|
+
*/
|
|
68
|
+
obtain_material_reference(spec) {
|
|
69
|
+
const mm = this.obtain_material_x(spec);
|
|
70
|
+
|
|
71
|
+
return this.__materials.obtain(mm);
|
|
24
72
|
}
|
|
25
73
|
|
|
26
74
|
/**
|
|
@@ -62,6 +110,8 @@ export class RibbonXPlugin extends EnginePlugin {
|
|
|
62
110
|
}
|
|
63
111
|
});
|
|
64
112
|
|
|
113
|
+
material.uniforms.resolution = this.__shared_uniforms.resolution;
|
|
114
|
+
|
|
65
115
|
if (spec.diffuse !== null) {
|
|
66
116
|
const am = this.engine.assetManager;
|
|
67
117
|
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
import Vector2 from '../../../core/geom/Vector2.js';
|
|
7
|
-
import { computeHashIntegerArray } from "../../../core/math/MathUtils.js";
|
|
8
7
|
import { assert } from "../../../core/assert.js";
|
|
9
8
|
import { BinaryClassSerializationAdapter } from "../../ecs/storage/binary/BinaryClassSerializationAdapter.js";
|
|
10
9
|
import { computeIntegerArrayHash } from "../../../core/primitives/array/computeIntegerArrayHash.js";
|
|
10
|
+
import { isArrayEqualStrict } from "../../../core/collection/array/isArrayEqualStrict.js";
|
|
11
|
+
import { computeHashIntegerArray } from "../../../core/collection/array/computeHashIntegerArray.js";
|
|
11
12
|
|
|
12
13
|
class GridObstacle {
|
|
13
14
|
constructor() {
|
|
@@ -236,15 +237,7 @@ class GridObstacle {
|
|
|
236
237
|
return false;
|
|
237
238
|
}
|
|
238
239
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
for (let i = 0; i < dataSize; i++) {
|
|
242
|
-
if (this.data[i] !== other.data[i]) {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return true;
|
|
240
|
+
return isArrayEqualStrict(this.data, other.data);
|
|
248
241
|
}
|
|
249
242
|
}
|
|
250
243
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { computeHashFloat, computeHashIntegerArray } from "../../../../core/math/MathUtils.js";
|
|
2
1
|
import { assert } from "../../../../core/assert.js";
|
|
3
2
|
import { invokeObjectEquals } from "../../../../core/model/object/invokeObjectEquals.js";
|
|
4
3
|
import { invokeObjectHash } from "../../../../core/model/object/invokeObjectHash.js";
|
|
4
|
+
import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
|
|
5
|
+
import { computeHashFloat } from "../../../../core/math/hash/computeHashFloat.js";
|
|
5
6
|
|
|
6
7
|
export class WeightedElement {
|
|
7
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { randomFromArray} from "../../../core/math/MathUtils.js";
|
|
2
1
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
|
+
import { randomFromArray } from "../../../core/math/random/randomFromArray.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Hill climbing optimizer based on random moves
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import Vector3, { v3_distance } from "../../../../core/geom/Vector3.js";
|
|
6
|
+
import Vector3 from "../../../../core/geom/Vector3.js";
|
|
8
7
|
|
|
9
8
|
import { CatmullRomCurve3 } from "three";
|
|
10
9
|
import { clamp } from "../../../../core/math/clamp.js";
|
|
@@ -17,6 +16,8 @@ import { max2 } from "../../../../core/math/max2.js";
|
|
|
17
16
|
import { min2 } from "../../../../core/math/min2.js";
|
|
18
17
|
import { computeNonuniformCatmullRomSplineSample } from "./computeNonuniformCatmullRomSplineSample.js";
|
|
19
18
|
import { InterpolationType } from "./InterpolationType.js";
|
|
19
|
+
import { v3_distance } from "../../../../core/geom/v3_distance.js";
|
|
20
|
+
import { line3_computeSegmentPointDistance_sqr } from "../../../../core/geom/3d/line/line3_computeSegmentPointDistance_sqr.js";
|
|
20
21
|
|
|
21
22
|
const v3_a = new Vector3();
|
|
22
23
|
const v3_b = new Vector3();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
2
|
import BinaryHeap from "./FastBinaryHeap.js";
|
|
3
3
|
import { passThrough, returnZero } from "../../../core/function/Functions.js";
|
|
4
|
-
import { randomIntegerBetween} from "../../../core/math/
|
|
4
|
+
import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
|
|
5
5
|
|
|
6
6
|
test("constructor doesn't throw", () => {
|
|
7
7
|
new BinaryHeap(returnZero);
|
|
@@ -10,11 +10,12 @@ import { SoundEmitterFlags } from "./SoundEmitterFlags.js";
|
|
|
10
10
|
import { SoundAttenuationFunction } from "./SoundAttenuationFunction.js";
|
|
11
11
|
import { attenuateSoundLinear } from "./attenuate/attenuateSoundLinear.js";
|
|
12
12
|
import { attenuateSoundLogarithmic } from "./attenuate/attenuateSoundLogarithmic.js";
|
|
13
|
-
import { computeHashFloat, computeHashIntegerArray } from "../../../../core/math/MathUtils.js";
|
|
14
13
|
import { SoundPanningModelType } from "./SoundPanningModelType.js";
|
|
15
14
|
import { attenuateSoundSmith } from "./attenuate/attenuateSoundSmith.js";
|
|
16
15
|
import { objectKeyByValue } from "../../../../core/model/object/objectKeyByValue.js";
|
|
17
16
|
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
17
|
+
import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
|
|
18
|
+
import { computeHashFloat } from "../../../../core/math/hash/computeHashFloat.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Convert decibel to percentage volume
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import Signal from "../../../../core/events/signal/Signal.js";
|
|
2
2
|
import { SoundTrackFlags } from "./SoundTrackFlags.js";
|
|
3
|
-
import { computeHashFloat, computeHashIntegerArray } from "../../../../core/math/MathUtils.js";
|
|
4
3
|
import { assert } from "../../../../core/assert.js";
|
|
5
4
|
import { computeStringHash } from "../../../../core/primitives/strings/computeStringHash.js";
|
|
5
|
+
import { computeHashIntegerArray } from "../../../../core/collection/array/computeHashIntegerArray.js";
|
|
6
|
+
import { computeHashFloat } from "../../../../core/math/hash/computeHashFloat.js";
|
|
6
7
|
|
|
7
8
|
const DEFAULT_FLAGS = SoundTrackFlags.StartWhenReady;
|
|
8
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractSoundMaterialDefinition } from "../AbstractSoundMaterialDefinition.js";
|
|
2
|
-
import { randomFromArray } from "../../../../core/math/MathUtils.js";
|
|
3
2
|
import { SoundAssetPlaybackSpec } from "../../asset/SoundAssetPlaybackSpec.js";
|
|
3
|
+
import { randomFromArray } from "../../../../core/math/random/randomFromArray.js";
|
|
4
4
|
|
|
5
5
|
export class RandomSoundMaterial extends AbstractSoundMaterialDefinition {
|
|
6
6
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Notification } from "../../notify/Notification.js";
|
|
2
|
-
import { randomFromArray } from "../../../core/math/MathUtils.js";
|
|
3
2
|
import { NotificationAreaKind } from "../GUIEngine.js";
|
|
3
|
+
import { randomFromArray } from "../../../core/math/random/randomFromArray.js";
|
|
4
4
|
|
|
5
5
|
function notificationGenerator(callback, timeout = 5) {
|
|
6
6
|
const phrases = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CellFilter } from "../../CellFilter.js";
|
|
2
|
-
import Vector3
|
|
2
|
+
import Vector3 from "../../../../core/geom/Vector3.js";
|
|
3
3
|
import { assert } from "../../../../core/assert.js";
|
|
4
|
+
import { v3_angle_between } from "../../../../core/geom/v3_angle_between.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Builds surface normal of another filter, and then computes the angle to a fixed 3d vector
|
|
@@ -70,7 +71,7 @@ export class CellFilterAngleToNormal extends CellFilter {
|
|
|
70
71
|
|
|
71
72
|
const reference = this.reference;
|
|
72
73
|
|
|
73
|
-
const angle =
|
|
74
|
+
const angle = v3_angle_between(reference.x, reference.y, reference.z, _x, _y, _z);
|
|
74
75
|
|
|
75
76
|
return angle;
|
|
76
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CellFilter } from "../../CellFilter.js";
|
|
2
|
-
import { gaussian } from "../../../../core/math/
|
|
2
|
+
import { gaussian } from "../../../../core/math/gaussian.js";
|
|
3
3
|
|
|
4
4
|
function buildKernel(result, samplesX, samplesY, sigma_x, sigma_y) {
|
|
5
5
|
const half_samples_x = (samplesX / 2);
|
|
@@ -3,9 +3,10 @@ import { GridTaskGenerator } from "../GridTaskGenerator.js";
|
|
|
3
3
|
import Task from "../../../core/process/task/Task.js";
|
|
4
4
|
import TaskSignal from "../../../core/process/task/TaskSignal.js";
|
|
5
5
|
import { BitSet } from "../../../core/binary/BitSet.js";
|
|
6
|
-
import { PI_HALF
|
|
6
|
+
import { PI_HALF } from "../../../core/math/MathUtils.js";
|
|
7
7
|
import { actionTask } from "../../../core/process/task/TaskUtils.js";
|
|
8
8
|
import TaskGroup from "../../../core/process/task/TaskGroup.js";
|
|
9
|
+
import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
|
|
9
10
|
|
|
10
11
|
export class GridTaskExecuteRuleTimes extends GridTaskGenerator {
|
|
11
12
|
constructor() {
|
|
@@ -36,6 +36,12 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
36
36
|
*/
|
|
37
37
|
this.transformers = [];
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {number}
|
|
42
|
+
*/
|
|
43
|
+
this.priority = 0;
|
|
44
|
+
|
|
39
45
|
/**
|
|
40
46
|
*
|
|
41
47
|
* @type {Vector2}
|
|
@@ -91,6 +97,7 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
91
97
|
* @param {string[]} [tags]
|
|
92
98
|
* @param {Transform} [transform]
|
|
93
99
|
* @param {*} [properties]
|
|
100
|
+
* @param priority
|
|
94
101
|
* @return {GridCellActionPlaceMarker}
|
|
95
102
|
*/
|
|
96
103
|
static from({
|
|
@@ -99,7 +106,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
99
106
|
transformers = [],
|
|
100
107
|
tags = [],
|
|
101
108
|
transform,
|
|
102
|
-
properties
|
|
109
|
+
properties,
|
|
110
|
+
priority = 0
|
|
103
111
|
}) {
|
|
104
112
|
|
|
105
113
|
assert.typeOf(type, 'string', 'type');
|
|
@@ -125,6 +133,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
125
133
|
r.properties = properties;
|
|
126
134
|
}
|
|
127
135
|
|
|
136
|
+
r.priority = priority;
|
|
137
|
+
|
|
128
138
|
return r;
|
|
129
139
|
}
|
|
130
140
|
|
|
@@ -183,6 +193,8 @@ export class GridCellActionPlaceMarker extends GridCellAction {
|
|
|
183
193
|
//write properties
|
|
184
194
|
Object.assign(node.properties, this.properties);
|
|
185
195
|
|
|
196
|
+
node.priority = this.priority;
|
|
197
|
+
|
|
186
198
|
//apply transformations
|
|
187
199
|
const transformers = this.transformers;
|
|
188
200
|
const transformerCount = transformers.length;
|
|
@@ -5,6 +5,12 @@ import { circleIntersectsCircle } from "../../core/geom/2d/circle/circleIntersec
|
|
|
5
5
|
|
|
6
6
|
export class MarkerNode {
|
|
7
7
|
constructor() {
|
|
8
|
+
/**
|
|
9
|
+
* Processing order, higher priority nodes are processed first
|
|
10
|
+
* @type {number}
|
|
11
|
+
*/
|
|
12
|
+
this.priority = 0;
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
*
|
|
10
16
|
* @type {String}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
2
|
import { MarkerNodeAction } from "./MarkerNodeAction.js";
|
|
3
3
|
import { assert } from "../../../core/assert.js";
|
|
4
|
-
import { randomFromArray} from "../../../core/math/
|
|
4
|
+
import { randomFromArray } from "../../../core/math/random/randomFromArray.js";
|
|
5
5
|
|
|
6
6
|
export class MarkerNodeActionSelectRandom extends MarkerNodeAction {
|
|
7
7
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
2
2
|
import { MarkerNodeTransformer } from "./MarkerNodeTransformer.js";
|
|
3
|
-
import { randomIntegerBetween} from "../../../core/math/MathUtils.js";
|
|
4
3
|
import { assert } from "../../../core/assert.js";
|
|
4
|
+
import { randomIntegerBetween } from "../../../core/math/random/randomIntegerBetween.js";
|
|
5
5
|
|
|
6
6
|
export class MarkerNodeTransformerRecordUniqueRandomEnum extends MarkerNodeTransformer {
|
|
7
7
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
2
2
|
import { GridCellAction } from "../GridCellAction.js";
|
|
3
|
-
import { randomFromArray} from "../../../../core/math/MathUtils.js";
|
|
4
3
|
import { assert } from "../../../../core/assert.js";
|
|
4
|
+
import { randomFromArray } from "../../../../core/math/random/randomFromArray.js";
|
|
5
5
|
|
|
6
6
|
export class CellActionSelectRandom extends GridCellAction {
|
|
7
7
|
constructor() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QuadTreeNode } from "../../core/geom/2d/quad-tree/QuadTreeNode.js";
|
|
2
2
|
import { assert } from "../../core/assert.js";
|
|
3
3
|
import { obtainTerrain } from "../../../model/game/scenes/SceneUtils.js";
|
|
4
|
-
import { randomFloatBetween } from "../../core/math/MathUtils.js";
|
|
5
4
|
import { seededRandom } from "../../core/math/random/seededRandom.js";
|
|
6
5
|
import { TerrainLayerRuleAggregator } from "./TerrainLayerRuleAggregator.js";
|
|
7
6
|
import { actionTask, countTask, emptyTask, futureTask } from "../../core/process/task/TaskUtils.js";
|
|
@@ -17,6 +16,7 @@ import { HashMap } from "../../core/collection/HashMap.js";
|
|
|
17
16
|
import { TerrainLayer } from "../../engine/ecs/terrain/ecs/layers/TerrainLayer.js";
|
|
18
17
|
import { TerrainFlags } from "../../engine/ecs/terrain/ecs/TerrainFlags.js";
|
|
19
18
|
import { binarySearchLowIndex } from "../../core/collection/array/binarySearchLowIndex.js";
|
|
19
|
+
import { randomFloatBetween } from "../../core/math/random/randomFloatBetween.js";
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
*
|
|
@@ -337,7 +337,7 @@ export class ThemeEngine {
|
|
|
337
337
|
const source_x = u * weights.width;
|
|
338
338
|
|
|
339
339
|
|
|
340
|
-
weights.sampleBilinear(source_x, source_y, weightSample);
|
|
340
|
+
weights.sampleBilinear(source_x, source_y, weightSample, 0);
|
|
341
341
|
|
|
342
342
|
for (let i = 0; i < layer_count; i++) {
|
|
343
343
|
const targetAddress = (y * splatWidth + x) + i * splatLayerSize;
|
|
@@ -451,6 +451,9 @@ export class ThemeEngine {
|
|
|
451
451
|
return new Task({
|
|
452
452
|
initializer() {
|
|
453
453
|
grid.markers.getRawData(nodes);
|
|
454
|
+
|
|
455
|
+
// sort nodes by priority
|
|
456
|
+
nodes.sort((a, b) => b.priority - a.priority);
|
|
454
457
|
},
|
|
455
458
|
cycleFunction
|
|
456
459
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Cache } from "../core/cache/Cache.js";
|
|
2
|
-
import { computeHashIntegerArray } from "../core/math/MathUtils.js";
|
|
3
2
|
import { computeMaterialEquality } from "../engine/asset/loaders/material/computeMaterialEquality.js";
|
|
4
3
|
import { computeMaterialHash } from "../engine/asset/loaders/material/computeMaterialHash.js";
|
|
5
4
|
import { makeMaterialIcon } from "./makeMaterialIcon.js";
|
|
5
|
+
import { computeHashIntegerArray } from "../core/collection/array/computeHashIntegerArray.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
@@ -47,4 +47,4 @@ export function makeMaterialIconCached(material, renderer, size) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
return sampler;
|
|
50
|
-
}
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"productName": "Meep",
|
|
5
5
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
6
6
|
"author": "Alexander Goldring",
|
|
7
|
-
"version": "2.33.
|
|
7
|
+
"version": "2.33.24",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"fast-levenshtein": "2.0.6",
|
|
10
10
|
"opentype.js": "1.3.3",
|
|
11
11
|
"simplex-noise": "2.4.0",
|
|
12
|
-
"three": "0.132.2"
|
|
12
|
+
"three": "^0.132.2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"babel-jest": "^26.6.3",
|
|
16
|
-
"@types/three": "0.132.2"
|
|
16
|
+
"@types/three": "^0.132.2"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/view/View.js
CHANGED
|
@@ -677,10 +677,12 @@ class View {
|
|
|
677
677
|
|
|
678
678
|
const classesToRemove = [];
|
|
679
679
|
|
|
680
|
-
|
|
680
|
+
const initial_class_count = classList.length;
|
|
681
|
+
|
|
682
|
+
for (let i = 0; i < initial_class_count; i++) {
|
|
681
683
|
const className = classList[i];
|
|
682
684
|
|
|
683
|
-
if (className.
|
|
685
|
+
if (className.search(rx) !== -1) {
|
|
684
686
|
classesToRemove.push(className);
|
|
685
687
|
}
|
|
686
688
|
}
|