This commit is contained in:
33333-33333 2026-05-28 15:48:42 +09:00
commit 860471f805
13 changed files with 1643 additions and 356 deletions

View file

@ -70,6 +70,19 @@ export function markPathInfluence(field, path, radius = 5, strength = 1, sea = n
}
}
export function createIncrementalPathInfluence(initialPaths = [], radius = 5, options = {}) {
const field = new Float32Array(SIZE);
const sea = options.sea || null;
for (const path of initialPaths || []) markPathInfluence(field, path, radius, 1, sea);
return {
field,
add(path, strength = 1, addRadius = radius) {
markPathInfluence(field, path, addRadius, strength, sea);
return field;
},
};
}
export function sampledNetworkCells(paths, step = 2, sea = null) {
const cells = [];
for (let pathId = 0; pathId < (paths || []).length; pathId++) {