import { d } from './index'; /** Signed distance to an isosceles triangle: tip at t = +hl pointing along the heading, base * (half-width hw) at t = −hl. iq's sdTriangleIsosceles with the apex mapped to the origin. */ export declare const arrowSdf: import('typegpu').TgpuFn<(t: d.F32, n: d.F32, hl: d.F32, hw: d.F32) => d.F32>; /** Signed distance to a capsule along the heading (segment half-length hl, radius r). * hl = 0 degenerates to a plain disc. */ export declare const capsuleSdf: import('typegpu').TgpuFn<(t: d.F32, n: d.F32, hl: d.F32, r: d.F32) => d.F32>; /** Signed distance to a box with half-extents (hl along the heading, hw across it). */ export declare const boxSdf: import('typegpu').TgpuFn<(t: d.F32, n: d.F32, hl: d.F32, hw: d.F32) => d.F32>; export declare const AGENT_SHAPES: { readonly arrow: { readonly kind: 1; readonly hl: 2.3; readonly hw: 1; readonly soft: 0; readonly ext: 2.65; }; readonly streak: { readonly kind: 0; readonly hl: 1.7; readonly hw: 0.8; readonly soft: 0; readonly ext: 2.6; }; readonly dot: { readonly kind: 0; readonly hl: 0; readonly hw: 1; readonly soft: 0; readonly ext: 1.2; }; readonly square: { readonly kind: 2; readonly hl: 0.9; readonly hw: 0.9; readonly soft: 0; readonly ext: 1.5; }; readonly glow: { readonly kind: 0; readonly hl: 0; readonly hw: 0; readonly soft: 1; readonly ext: 2.1; }; }; export type AgentShapeName = keyof typeof AGENT_SHAPES; export declare function resolveAgentShape(name: unknown, fallback: AgentShapeName): AgentShapeName; /** Full menu for oriented consumers (agents with a travel direction — Boids). */ export declare const orientedShapeOptions: { label: string; value: string; }[]; /** Un-oriented subset (point particles — Particles, ParticleField). */ export declare const pointShapeOptions: { label: string; value: string; }[]; /** * Bake one shape into a per-texel weight fn: (t, n, bodyR, aaW, soft) → coverage in [0, 1]. * `aaW` is the hard edge's anti-alias half-width in the caller's units (~¾ of a render * texel); `soft` mixes toward the Gaussian glow profile — pass the registry's baked 0/1, or * a runtime softness uniform (the Particles slider). Hard interiors return exactly 1, so * consumers whose alpha curve tops out below opaque should over-drive their fixed-point gain * for hard shapes (see Boids). */ export declare function makeAgentWeightFn(shape: string): import('typegpu').TgpuFn<(t: d.F32, n: d.F32, bodyR: d.F32, aaW: d.F32, soft: d.F32) => d.F32>; /** * The FAST sibling of `makeAgentWeightFn`, for splat kernels whose softness is a compile-time * constant (the shape registry's own 0/1) and which already computed the radial reject quotient * `q = (t² + n²) / bodyR²` to cull the texel. Two things get baked away versus the general fn: * * - Only ONE half of the profile is emitted — the hard AA smoothstep, or the Gaussian skirt's * divide + exp. The general fn always evaluates both and mixes, which is the right call only * when `soft` is a live uniform (the Particles / FloatingParticles softness slider). * - For a zero-half-length shape the capsule SDF degenerates to `dist − r`, and `dist` is * already implied by `q` — so the signed distance comes from `sqrt(q)` instead of re-summing * and re-sqrting the offsets inside a general SDF call. * * Signature is `(q, t, n, bodyR, aaW)`; whichever of `q` / `t,n` the baked shape doesn't need is * ignored. Consumers with a runtime softness uniform must keep using `makeAgentWeightFn`. */ export declare function makeAgentTexelWeightFn(shape: string): import('typegpu').TgpuFn<(q: d.F32, _t: d.F32, _n: d.F32, bodyR: d.F32, _aaW: d.F32) => d.F32>; /** Shape metadata the oriented splat consumers bake: the comet consumers stretch the round * registry glow into a ±1·bodyR segment and widen its reject by one bodyR. */ export declare function orientedShapeProfile(shape: string, opts?: { comet?: boolean; }): { name: "square" | "arrow" | "streak" | "dot" | "glow"; soft: 0 | 1; hl: number; ext: number; /** A zero-half-length round shape needs no heading-space rotation (and no comet). */ symmetric: boolean; }; /** * Bake one oriented shape into the per-texel weight the velocity-heading splat consumers share * (Boids, ParticleFlow): the fast baked weight fn wrapped with the glow comet treatment — the * along-heading coordinate collapsed over a ±hl segment and a head-bright tail fade. For hard * shapes (SOFT = 0) both fold to the identity. Signature `(t, n, bodyR, aaW) → w`. */ export declare function makeOrientedCometWeightFn(shape: string): import('typegpu').TgpuFn<(t: d.F32, n: d.F32, bodyR: d.F32, aaW: d.F32) => d.F32>; /** Reynolds steering: desired = normalize(dir)·maxSpeed, steer = desired − vel, clamped to maxForce. * Zero-length `dir` yields zero steer (the caller only passes it when a neighbour was found). */ export declare const reynoldsSteer: import('typegpu').TgpuFn<(dir: d.Vec2f, vel: d.Vec2f, maxSpeed: d.F32, maxForce: d.F32) => d.Vec2f>; /** Per-agent cruise-speed variation (hash of index) so a flock isn't robotic. */ export declare const cruiseVariation: import('typegpu').TgpuFn<(fi: d.F32) => d.F32>; /** Per-agent "presence" factor in [0.55, 1.25] (hash of index) — one shared depth-ish cascade * that consumers scale both size and brightness by, so near-reading agents are bigger AND * brighter together (the multi-layer parallax read from a single hash). */ export declare const presenceVariation: import('typegpu').TgpuFn<(fi: d.F32) => d.F32>; /** Straight-alpha OVER composite of a resolved agent field onto a backdrop colour — the plain * un-premultiplied Porter-Duff over, for consumers that layer their field without an RTT. */ export declare const straightAlphaOver: import('typegpu').TgpuFn<(p: d.Vec4f, c: d.Vec4f) => d.Vec4f>; /** Field-line direction at r̂ from the source: 2D magnetic dipole B ∝ 2(m·r̂)r̂ − m (fieldType 0) * or radial monopole spokes B ∝ r̂ (fieldType 1). */ export declare const dipoleOrRadialField: import('typegpu').TgpuFn<(rhat: d.Vec2f, axis: d.Vec2f, fieldType: d.F32) => d.Vec2f>; /** * Nematic restoring torque: `k · sin(2·(target − θ))`. π-periodic, so a director (θ ≡ θ+π) always * takes the SHORT way onto the target line — its stable equilibria sit exactly at the two * line-aligned angles, no wrap, no wrong-way spins. */ export declare const nematicTorque: import('typegpu').TgpuFn<(k: d.F32, target: d.F32, theta: d.F32) => d.F32>; /** * The trail canvas composite the trail-bearing consumers share: a max-with-decay — the crisp new * head wins where the agent is now, a fading copy persists where it was. Never saturates, and * collapses to the plain splat at `trails` = 0. */ export declare const trailMaxDecay: import('typegpu').TgpuFn<(col: d.Vec4f, curA: d.F32, prev: d.Vec4f, trails: d.F32) => d.Vec4f>; /** Rotate a world position by the camera matrix rows (built on the CPU, w unused). */ export declare const applyCameraRows: import('typegpu').TgpuFn<(pw: d.Vec3f, rowX: d.Vec4f, rowY: d.Vec4f, rowZ: d.Vec4f) => d.Vec3f>; /** Rotate a view-space vector back into world space by Rᵀ (rows are orthonormal). */ export declare const applyCameraRowsTransposed: import('typegpu').TgpuFn<(v: d.Vec3f, rowX: d.Vec4f, rowY: d.Vec4f, rowZ: d.Vec4f) => d.Vec3f>; /** Clamped bilinear tap geometry over a texel grid: corner indices + fractional weights. */ export declare const BilinearFrame: d.WgslStruct<{ x0: d.U32; x1: d.U32; y0: d.U32; y1: d.U32; fx: d.F32; fy: d.F32; }>; /** The clamped index/frac setup every per-agent bilinear textureLoad shares (`uv01` in [0,1] per * axis, `dims` the texture size). The caller owns the four loads (layout access) and the mixes. */ export declare const bilinearTexelFrame: import('typegpu').TgpuFn<(uv01: d.Vec2f, dims: d.Vec2f) => d.WgslStruct<{ x0: d.U32; x1: d.U32; y0: d.U32; y1: d.U32; fx: d.F32; fy: d.F32; }>>; /** Gaussian falloff of a cursor field at offset `delta` (any 2D space), radius² `radSq`. */ export declare const cursorFalloff: import('typegpu').TgpuFn<(delta: d.Vec2f, radSq: d.F32) => d.F32>; /** * The cursor magnet force: a Gaussian radial push (positive `force`) or pull (negative) on an * agent at offset `delta` from the pointer. Apply to VELOCITY (F·dt) — that is what makes the * interaction feel physical: agents get shoved, coast, and spring back over time instead of * rendering a displaced fisheye. */ export declare const cursorMagnet: import('typegpu').TgpuFn<(delta: d.Vec2f, radSq: d.F32, force: d.F32) => d.Vec2f>; /** * Uniform-scatter spawn: agents distributed evenly across the aspect-corrected screen * domain at rest (hash-decorrelated with irrational per-axis strides). Layout ABI: * `agents` (vec4f state, xy = position) and `params.aspect`. */ export declare function makeUniformScatterInit(layout: { readonly $: { agents: d.v4f[]; params: { readonly aspect: number; }; }; }, name: string): import('typegpu').TgpuFn<(i: d.U32) => d.Void>; /** * Ball-cloud spawn for a 3D swarm: agents on hash directions at cube-root-distributed radii * (volume-uniform inside the ball), at rest, each carrying a hash seed in pos.w. Irrational * per-axis strides decorrelate consecutive indices (linear strides through the fract-based * hash leave visible filament alignments). Layout ABI: `pos`/`vel` vec4f state arrays; * state written as pos = (xyz, seed), vel = 0. */ export declare function makeBallCloudInit(layout: { readonly $: { pos: d.v4f[]; vel: d.v4f[]; }; }, name: string, cfg?: { radius?: number; zSquash?: number; }): import('typegpu').TgpuFn<(i: d.U32) => d.Void>; /** * Clustered-formation spawn for a steering swarm: K elongated clusters (one per * `agentsPerCluster` agents, at least `minClusters`), each with a shared heading and cruise * velocity, jittered per agent — frame one reads as an already-organised flock instead of a * uniform scatter that takes seconds to self-organise (pre-running the sim would cost O(N²) * per warm-up step). `params.seed` re-rolls the layout at runtime. Layout ABI: `agents` * (vec4f = posX, posY, velX, velY), `agit` (f32, zeroed), `params.{count, seed, domainX, * maxSpeed}`. */ export declare function makeClusterFormationInit(layout: { readonly $: { agents: d.v4f[]; agit: number[]; readonly params: { readonly count: number; readonly seed: number; readonly domainX: number; readonly maxSpeed: number; }; }; }, name: string, cfg?: { agentsPerCluster?: number; minClusters?: number; }): import('typegpu').TgpuFn<(i: d.U32) => d.Void>; /** * Resting-director spawn for an orientation swarm: every agent parked at its home (zero * offset), a hash-scattered starting angle over the [0, π) director line, zero spin, calm. * Layout ABI: `agents` (vec4f = offX, offY, θ, ω), `agit` (f32, zeroed). */ export declare function makeRestingDirectorInit(layout: { readonly $: { agents: d.v4f[]; agit: number[]; }; }, name: string): import('typegpu').TgpuFn<(i: d.U32) => d.Void>; /** * Bake a per-pixel scan of a recorded stroke polyline as a SMOOTH capsule chain: * `(pointsTex, uv, aspect, radius, shrink, softness, viewportH) → vec2(age, coverage)`. * * The polyline arrives as a `maxPoints`×1 data texture, texel i = (x, y, age∈[0,1), * signedWidth); age ≥ 1 marks a dead slot. |w| is the per-point width scale (the pen-pressure * analogue) and its SIGN is the link flag — positive = linked to texel i−1, negative = stroke * start; the recorder appends a duplicate of the live head so the curve reaches the tip. * * The spine is the classic midpoint quadratic-Bézier chain: each linked point P_i draws the * quadratic around joint P_{i−1} — from mid(P_{i−2},P_{i−1}) to mid(P_{i−1},P_i) with P_{i−1} * as control (falling back to the raw endpoint at a stroke start). C1-continuous through the * whole path, so a drawn arc reads as a curve, not a chain of chords. Each quadratic is * evaluated as `subdivisions` sub-capsules (round-cones with age-shrunk radii); an unlinked * survivor is a plain dot. * * Two accumulators, both chosen for CONTINUITY: * - `minSdf` — plain min-union (adjacent pieces share endpoints/radii, so the union is * already smooth; smooth-min would bulge every overlap into a scallop). * - `age` — exponentially depth-weighted blend of each joint's age at its closest point: * the stroke a pixel is deepest inside dominates (newest-on-top in spirit at * crossings) but the handoff is a smooth band ~r/4 wide, never a seam. * `softness` widens the edge band in radius units on top of the ~1.5px AA floor; a late-life * fade (age 0.8→1) removes the pop when a piece is culled. */ export declare function makeStrokePolylineScan(cfg: { maxPoints: number; subdivisions: number; name: string; }): import('typegpu').TgpuFn<(pointsTex: d.WgslTexture2d, uv: d.Vec2f, aspect: d.F32, radius: d.F32, shrink: d.F32, softness: d.F32, viewportH: d.F32) => d.Vec2f>; //# sourceMappingURL=agents.d.ts.map