@thi.ng/boids
Version:
n-dimensional boids simulation with modular behavior system
19 lines • 948 B
TypeScript
import type { Fn, Nullable } from "@thi.ng/api";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { IBoidBehavior, ScalarOrField } from "../api.js";
import type { Boid } from "../boid.js";
/**
* Boid behavior which steers toward target positions sourced from user provided
* `target` fn. That `target` function will be called successively for each boid
* update. If it returns a point, it will be used as steer target until a new
* one is returned. If the function returns null/undefined the current target
* will be kept. The behavior is a no-op for boids outside the configured
* `radius` (around the target) and also has no effect until the target function
* returns its first point.
*
* @param target
* @param radius
* @param weight
*/
export declare const dynamicTarget: (target: Fn<Boid, Nullable<ReadonlyVec>>, radius?: ScalarOrField, weight?: ScalarOrField) => IBoidBehavior;
//# sourceMappingURL=dynamic.d.ts.map