@thi.ng/boids
Version:
n-dimensional boids simulation with modular behavior system
18 lines • 850 B
TypeScript
import type { Fn } from "@thi.ng/api";
import type { ReadonlyVec } from "@thi.ng/vectors";
import type { ScalarOrField, IBoidBehavior } from "../api.js";
/**
* 2D only behavior. Takes a field function to be sampled, a sensor `lookahead`
* distance and `angle` between left/right sensors. The returned behavior steers
* an agent towards the local maxima of the field function based on a given
* agent's position and direction. Steers toward which ever sensor yields the
* greater value. If both sensors yield the same reading, the behavior is a
* no-op (returns a zero force vector).
*
* @param field
* @param lookahead
* @param angle
* @param weight
*/
export declare const braitenberg2: (field: Fn<ReadonlyVec, number>, lookahead: number, angle: number, weight?: ScalarOrField) => IBoidBehavior;
//# sourceMappingURL=braitenberg.d.ts.map