/** * The per-frame multiplier that decays a value at `rate` per second, whatever the frame rate. * * Write it into a `dragMul` value each frame. A rate of 1 halves a velocity in about 0.7 s. * * @example * ```ts * dragMul: agentFrame.expDecay(2.2 + damping * 6, dt) * ``` * @see integrator */ export declare function expDecay(rate: number, dt: number): number; /** * The pointer in the shape's own coordinates: undo the layer's center, scale and rotation so a * cursor force can act in the same space the swarm lives in (y up, isotropic). * * `pointerX`/`pointerY` and `centerX`/`centerYv` are in uv, `rotC`/`rotS` the cosine and sine * of the rotation, `aspect` the canvas width over height. * * @example * ```ts * const cursor = agentFrame.pointerToShapeLocal({pointerX, pointerY, centerX, centerYv, scale, rotC, rotS, aspect}) * ``` * @see force */ export declare function pointerToShapeLocal(opts: { pointerX: number; pointerY: number; centerX: number; centerYv: number; scale: number; rotC: number; rotS: number; aspect: number; }): { x: number; y: number; }; /** * How fast a rotating shape's surface moves, from its rotation this frame and last frame, so a * swarm inside it can be dragged along. Angles in radians, `dt` in seconds. Null on the first * frame. * * @example * ```ts * om = agentFrame.omegaFromRotationDeltas(prevRot, next, dt) ?? om * ``` * @see entrainmentFromOmega */ export declare function omegaFromRotationDeltas(prev: { x: number; y: number; z: number; } | null, next: { x: number; y: number; z: number; }, dt: number): { x: number; y: number; z: number; } | null; /** * The values `force.containment` reads for a rotating shape: the rotation rate capped at * `cap`, and an `entrain` gain that grows with the rate up to `gainMax`. * * @example * ```ts * const {omegaX, omegaY, omegaZ, entrain} = agentFrame.entrainmentFromOmega(om, {cap: 10, gainRate: 2.5, gainMax: 5}) * ``` * @tip With a still shape the gain is exactly 0, so the entrainment force costs nothing to leave declared. * @see omegaFromRotationDeltas, force */ export declare function entrainmentFromOmega(om: { x: number; y: number; z: number; }, opts: { cap: number; gainRate: number; gainMax: number; }): { omegaX: number; omegaY: number; omegaZ: number; entrain: number; }; /** * A unit direction that follows where the pointer has been travelling, smoothed frame to frame. * Feed `update(x, y)` the pointer each frame and write the result into an axis value. * * `smoothing` (0–1, default 0.1) is how fast the axis turns. A jump longer than `teleport` * (default 0.25, in the same units as the pointer) is the cursor re-entering the canvas, not a * stroke, and leaves the axis alone. * * @example * ```ts * const motionAxis = agentFrame.createMotionAxis({smoothing: 0.1, teleport: 0.25}) * const axis = motionAxis.update(cursorX, cursorY) * ``` * @see field */ export declare function createMotionAxis(opts?: { smoothing?: number; teleport?: number; }): { update(x: number, y: number): { x: number; y: number; }; }; /** * A grid of about `count` roughly square cells over the canvas plus an `overscan` border on * every side, for agents that rest on a jittered grid. `domainX` is the canvas width in * heights (the aspect). * * Returns the column count and the cell size, which `field.jitteredGridHome` reads. * * @example * ```ts * const {cols, cellW, cellH} = agentFrame.fitJitteredGrid(count, domainX, 0.1) * ``` * @see fitIsoGrid, field */ export declare function fitJitteredGrid(count: number, domainX: number, overscan: number): { cols: number; cellW: number; cellH: number; }; /** * A W×H grid of square cells holding about `count` agents at the canvas `aspect`, each side * clamped to `[min, max]`. * * @example * ```ts * const {w, h} = agentFrame.fitIsoGrid(count, aspect, 8, 160) * ``` * @see fitJitteredGrid */ export declare function fitIsoGrid(count: number, aspect: number, min: number, max: number): { w: number; h: number; }; /** * The three rows of a camera rotation for a 3D view drawn on a y-down canvas. Angles in * radians. Write them into the values a projected splat reads. * * Positive angles orbit in the directions that feel natural in the editor. * * @example * ```ts * const rows = agentFrame.cameraRowsYDown(rotX * DEG_TO_RAD, rotY * DEG_TO_RAD, rotZ * DEG_TO_RAD) * ``` * @see renderAgents */ export declare function cameraRowsYDown(rx: number, ry: number, rz: number): { rowX: [number, number, number]; rowY: [number, number, number]; rowZ: [number, number, number]; }; /** * A tiny offset for frame `frameIdx`, within one grid `cell`, that `force.pressure` reads to * keep its density grid from lining up with the shape. Increment the frame index each frame. * * @example * ```ts * const gridOff = agentFrame.r3SubCellOffset(frameIdx++, cellSize) * ``` * @see force */ export declare function r3SubCellOffset(frameIdx: number, cell: number): { x: number; y: number; z: number; }; //# sourceMappingURL=agentFrame.d.ts.map