stable
This commit is contained in:
parent
d2e7a80e72
commit
860471f805
13 changed files with 1643 additions and 356 deletions
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue