[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"github-stars":3,"guide-nav":5,"doc-\u002Fdocs\u002Fprimitives\u002Fsim-agentforces":129},{"stars":4},5505,[6,11,15,19,23,27,31,35,39,43,47,51,55,59,63,67,72,76,80,84,88,93,97,101,105,109,113,117,121,125],{"path":7,"title":8,"description":9,"category":10},"\u002Fdocs\u002Fguide","Getting started","Shaders is a library of GPU effect components for Vue, React, Svelte, Solid, JavaScript and Framer, with a design editor for building with them.","code",{"path":12,"title":13,"description":14,"category":10},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":16,"title":17,"description":18,"category":10},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":20,"title":21,"description":22,"category":10},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":24,"title":25,"description":26,"category":10},"\u002Fdocs\u002Fguide\u002Fprops-reactivity","Props and reactivity","Bind props to your framework's state so effects update when it changes, and animate props with an animation library.",{"path":28,"title":29,"description":30,"category":10},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":32,"title":33,"description":34,"category":10},"\u002Fdocs\u002Fguide\u002Flayout-positioning","Layout and positioning","Size and place a shader in your page with CSS, as a background, a fill, or an inline block.",{"path":36,"title":37,"description":38,"category":10},"\u002Fdocs\u002Fguide\u002Fsizing-and-units","Sizing and units","Size and place layers in CSS units (px, %, vw, rem, and canvas units) that stay correct as the canvas and window resize.",{"path":40,"title":41,"description":42,"category":10},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":44,"title":45,"description":46,"category":10},"\u002Fdocs\u002Fguide\u002Fshape-effects","Shape effects","Pick the 2D, 3D or custom SVG shape that Glass, Neon, Emboss and other shape effects draw inside.",{"path":48,"title":49,"description":50,"category":10},"\u002Fdocs\u002Fguide\u002Fcolor-space","Color space","Match colors to your design tool with the output color space, and keep bright layers from clipping with tone mapping.",{"path":52,"title":53,"description":54,"category":10},"\u002Fdocs\u002Fguide\u002Fhooks-events","Hooks and events","Run code when an effect is ready to show, and show a fallback when the GPU can't run it.",{"path":56,"title":57,"description":58,"category":10},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":60,"title":61,"description":62,"category":10},"\u002Fdocs\u002Fguide\u002Fcustom-shaders","Custom components","Write your own component in TypeScript, use it like any component in the library, and write WGSL by hand when you need to.",{"path":64,"title":65,"description":66,"category":10},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":68,"title":69,"description":70,"category":71},"\u002Fdocs\u002Fguide\u002Fmcp","Shaders MCP","Connect your AI coding agent to Shaders so it can find, install and edit effects in your codebase.","workflows",{"path":73,"title":74,"description":75,"category":71},"\u002Fdocs\u002Fguide\u002Fcli","Shaders CLI","Install your own shaders and Pro shaders into your codebase as component files, and keep them in sync with the design editor.",{"path":77,"title":78,"description":79,"category":71},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill","Give your coding agent a skill that teaches it to build with Shaders components, the CLI and Pro shaders.",{"path":81,"title":82,"description":83,"category":10},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Turn a shader effect into a video file, from the design editor or from a frame-by-frame pipeline such as Remotion, Hyperframes or Puppeteer.",{"path":85,"title":86,"description":87,"category":10},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",{"path":89,"title":90,"description":91,"category":92},"\u002Fdocs\u002Fguide\u002Fquick-tour-of-the-design-editor","Quick tour of the design editor","A short walkthrough of the full Shaders workflow, from designing on the infinite canvas to exporting code.","editor",{"path":94,"title":95,"description":96,"category":92},"\u002Fdocs\u002Fguide\u002Fintro-to-the-interface","Intro to the interface","A tour of the design editor interface: the canvas, layers, the Properties panel, and the ways to share and export.",{"path":98,"title":99,"description":100,"category":92},"\u002Fdocs\u002Fguide\u002Fcomposing-your-first-shader-effect","Composing your first shader effect","Building a first shader effect in the design editor by stacking and nesting components as layers.",{"path":102,"title":103,"description":104,"category":92},"\u002Fdocs\u002Fguide\u002Fmasking-and-blending","Masking and blending","How blend modes and masks combine components in the design editor.",{"path":106,"title":107,"description":108,"category":92},"\u002Fdocs\u002Fguide\u002Fdynamic-prop-mapping","Dynamic prop mapping","Turning static props into dynamic ones in the design editor: mapping one layer's output into another's prop, following the cursor, or animating automatically.",{"path":110,"title":111,"description":112,"category":92},"\u002Fdocs\u002Fguide\u002Fcustom-media-and-transformations","Custom media and transformations","Uploading images, videos, and SVG files to the media gallery, adding them to a composition, and placing them with transformations.",{"path":114,"title":115,"description":116,"category":92},"\u002Fdocs\u002Fguide\u002Finstalling-a-shader-via-mcp","Installing a shader via MCP","Installing a shader from the design editor into a hero section with the Shaders MCP.",{"path":118,"title":119,"description":120,"category":92},"\u002Fdocs\u002Fguide\u002Fexploring-shape-effects","Exploring shape effects","Applying shape effects such as liquid glass, liquid metal, and glowing edges to built-in shapes and your own SVG.",{"path":122,"title":123,"description":124,"category":92},"\u002Fdocs\u002Fguide\u002Fglass-component-spotlight","Component spotlight: Glass","A short look at the Glass component and the liquid-glass look it creates.",{"path":126,"title":127,"description":128,"category":92},"\u002Fdocs\u002Fguide\u002Fdigital-looks-component-spotlight","Component spotlight: Digital looks","A look at the digital stylization components for glitchy, futuristic, or technical effects.",{"id":130,"title":131,"body":132,"categoryId":2895,"categorySlug":2896,"categoryTitle":2897,"curated":564,"description":2898,"editUrl":2899,"extension":2900,"group":2901,"groupTitle":2902,"kind":2897,"meta":2903,"navigation":564,"path":2904,"seo":2905,"sourceUrl":2906,"stem":2907,"wordCount":961,"__hash__":2908},"primitives\u002Fdocs\u002Fprimitives\u002F41.sim-agentforces\u002Findex.md","Agent forces",{"type":133,"value":134,"toc":2889},"minimark",[135,139,177,331,338,367,372,513,517,2297,2301,2560,2564,2885],[136,137,131],"h1",{"id":138},"agent-forces",[140,141,142,143,147,148,155,156,162,163,169,170,176],"p",{},"What pushes, turns and carries each agent. The physics of an agent simulation is a list of\nparts folded into one update step by an ",[144,145,146],"strong",{},"integrator",". A ",[149,150,152],"a",{"href":151},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce",[10,153,154],{},"force"," returns a push for one\nagent; a ",[149,157,159],{"href":158},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque",[10,160,161],{},"torque"," returns a turn; a ",[149,164,166],{"href":165},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield",[10,167,168],{},"field"," samples something at the agent's position (the\nmagnet at the cursor, a home on a grid); a ",[149,171,173],{"href":172},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fdrift",[10,174,175],{},"drift"," is a built-in velocity. Every part is built\nover your layout, which names the per-agent buffers and the per-frame values it reads, so the\nsame part works in any layer that provides those names.",[140,178,179,180,186,187,193,194,193,200,193,206,193,212,218,219,225,226,193,232,193,238,218,244,250,251,193,257,263,264,270,271,277,278,284,285,193,291,277,297,303,304,193,310,277,316,322,323,326,327,330],{},"Six kinds of agent, six integrators. ",[149,181,183],{"href":182},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-forces3d",[10,184,185],{},"integrator.forces3d"," moves a 3D swarm held in a shape\n(",[149,188,190],{"href":189},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-pressure",[10,191,192],{},"force.pressure",", ",[149,195,197],{"href":196},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-containment",[10,198,199],{},"force.containment",[149,201,203],{"href":202},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorxy",[10,204,205],{},"force.cursorXY",[149,207,209],{"href":208},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-gravity",[10,210,211],{},"force.gravity",[149,213,215],{"href":214},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-turbulence",[10,216,217],{},"force.turbulence",").\n",[149,220,222],{"href":221},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-steering2d",[10,223,224],{},"integrator.steering2d"," moves a flock (",[149,227,229],{"href":228},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-flocking",[10,230,231],{},"force.flocking",[149,233,235],{"href":234},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorsteer",[10,236,237],{},"force.cursorSteer",[149,239,241],{"href":240},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-wallturn",[10,242,243],{},"force.wallTurn",[149,245,247],{"href":246},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-orientation2d",[10,248,249],{},"integrator.orientation2d"," turns agents in place (",[149,252,254],{"href":253},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque-aligntofield",[10,255,256],{},"torque.alignToField",[149,258,260],{"href":259},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque-rest",[10,261,262],{},"torque.rest",", over\n",[149,265,267],{"href":266},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield-dipoleorradial",[10,268,269],{},"field.dipoleOrRadial"," and ",[149,272,274],{"href":273},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield-jitteredgridhome",[10,275,276],{},"field.jitteredGridHome","). ",[149,279,281],{"href":280},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-drift2d",[10,282,283],{},"integrator.drift2d"," glides motes\n(",[149,286,288],{"href":287},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fdrift-variedheading",[10,289,290],{},"drift.variedHeading",[149,292,294],{"href":293},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorgust",[10,295,296],{},"force.cursorGust",[149,298,300],{"href":299},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-relief",[10,301,302],{},"integrator.relief"," stands particles on the\nchild's image (",[149,305,307],{"href":306},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel",[10,308,309],{},"channel",[149,311,313],{"href":312},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorinview",[10,314,315],{},"force.cursorInView",[149,317,319],{"href":318},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-advect2d",[10,320,321],{},"integrator.advect2d"," carries particles along\na fluid. Pick the integrator, list the parts, and register the result as the update step in\n",[10,324,325],{},"agentSim","'s ",[10,328,329],{},"bake",".",[140,332,333,334,337],{},"Drag arrives as a per-frame multiplier the frame writes each frame: compute it with\n",[10,335,336],{},"agentFrame.expDecay"," so it does not depend on frame rate.",[339,340,345],"pre",{"className":341,"code":342,"language":343,"meta":344,"style":344},"language-ts shiki shiki-themes github-dark","import {sim} from 'shaders\u002Fstd'\n","ts","",[10,346,347],{"__ignoreMap":344},[348,349,352,356,360,363],"span",{"class":350,"line":351},"line",1,[348,353,355],{"class":354},"snl16","import",[348,357,359],{"class":358},"s95oV"," {sim} ",[348,361,362],{"class":354},"from",[348,364,366],{"class":365},"sU2Wk"," 'shaders\u002Fstd'\n",[368,369,371],"h2",{"id":370},"reach-for-it-when","Reach for it when",[373,374,375,388],"table",{},[376,377,378],"thead",{},[379,380,381,385],"tr",{},[382,383,384],"th",{},"When you need",[382,386,387],{},"Use",[389,390,391,408,419,438,461,476,487,502],"tbody",{},[379,392,393,397],{},[394,395,396],"td",{},"a flock that separates, aligns and coheres",[394,398,399,403,404],{},[149,400,401],{"href":221},[10,402,224],{}," with ",[149,405,406],{"href":228},[10,407,231],{},[379,409,410,413],{},[394,411,412],{},"the cursor attracts or scatters a flock",[394,414,415],{},[149,416,417],{"href":234},[10,418,237],{},[379,420,421,424],{},[394,422,423],{},"a swarm that fills a shape evenly and stays inside it",[394,425,426,403,430,270,434],{},[149,427,428],{"href":182},[10,429,185],{},[149,431,432],{"href":189},[10,433,192],{},[149,435,436],{"href":196},[10,437,199],{},[379,439,440,443],{},[394,441,442],{},"iron filings that swing onto a magnetic field",[394,444,445,403,449,193,453,193,457],{},[149,446,447],{"href":246},[10,448,249],{},[149,450,451],{"href":253},[10,452,256],{},[149,454,455],{"href":259},[10,456,262],{},[149,458,459],{"href":266},[10,460,269],{},[379,462,463,466],{},[394,464,465],{},"motes that glide in one direction with variety",[394,467,468,403,472],{},[149,469,470],{"href":280},[10,471,283],{},[149,473,474],{"href":287},[10,475,290],{},[379,477,478,481],{},[394,479,480],{},"a puff from the cursor on drifting motes",[394,482,483],{},[149,484,485],{"href":293},[10,486,296],{},[379,488,489,492],{},[394,490,491],{},"particles that rise by the brightness of the layer inside",[394,493,494,403,498],{},[149,495,496],{"href":299},[10,497,302],{},[149,499,500],{"href":306},[10,501,309],{},[379,503,504,507],{},[394,505,506],{},"particles carried along a fluid's velocity",[394,508,509],{},[149,510,511],{"href":318},[10,512,321],{},[368,514,516],{"id":515},"example","Example",[339,518,520],{"className":341,"code":519,"language":343,"meta":344,"style":344},"import {defineShader, sim, transformColor} from 'shaders\u002Fstd'\nimport {tgpu, d, agents} from '@coreroot\u002Fgpu\u002Fkit'\nimport {makeCpuValueGetter, readAgentFrame, resolveRenderRes, SIZE_REF_RES} from '@coreroot\u002Fgpu\u002Fporters'\n\nconst {agentSim, renderAgents, torque, field, integrator, agentFrame} = sim.agents\n\nconst MAX_FILINGS = 12288\nconst RES = resolveRenderRes({desktop: 1024, mobile: 768})\nconst OVERSCAN = 0.14\n\n\u002F\u002F The values the torques, the field and the home read each frame.\nconst SimParams = d.struct({\n  colA: d.vec4f, colB: d.vec4f,\n  count: d.f32,\n  dt: d.f32, aspect: d.f32, domainX: d.f32,\n  cursorX: d.f32, cursorY: d.f32, axisX: d.f32, axisY: d.f32,\n  fieldType: d.f32, restMode: d.f32,\n  strength: d.f32, reachSq: d.f32,\n  alignK: d.f32, damping: d.f32, restK: d.f32, pullK: d.f32, homeK: d.f32,\n  omegaRef: d.f32, agitCool: d.f32,\n  gridCols: d.f32, cellW: d.f32, cellH: d.f32, jitter: d.f32,\n  bodyR: d.f32,\n})\n\u002F\u002F Per-agent state (offset from home, angle, spin), excitement, the two canvases, the output.\nconst simLayout = tgpu.bindGroupLayout({\n  agents: {storage: d.arrayOf(d.vec4f, MAX_FILINGS), access: 'mutable'},\n  agit: {storage: d.arrayOf(d.f32, MAX_FILINGS), access: 'mutable'},\n  accumE: {storage: d.arrayOf(d.atomic(d.u32), RES * RES), access: 'mutable'},\n  accumS: {storage: d.arrayOf(d.atomic(d.u32), RES * RES), access: 'mutable'},\n  params: {uniform: SimParams},\n  outTex: {storageTexture: d.textureStorage2d('rgba16float', 'write-only')},\n})\n\nconst filingsInit = agents.makeRestingDirectorInit(simLayout, 'filingsInit')\n\n\u002F\u002F The physics: every filing rests on a jittered grid, samples the magnet at the cursor, and\n\u002F\u002F swings onto its field line, with a weak pull back to its rest angle where the field is faint.\nconst filingsHome = field.jitteredGridHome(simLayout, {overscan: OVERSCAN})\nconst filingsUpdate = integrator.orientation2d(simLayout, {\n  home: filingsHome,\n  fieldAt: field.dipoleOrRadial(simLayout),\n  torques: [torque.alignToField(simLayout), torque.rest(simLayout)],\n  maxOffset: 0.12,\n  name: 'filingsUpdate',\n})\n\n\u002F\u002F The look: slivers drawn along each filing's own angle, colored calm to excited.\nconst filingsRender = renderAgents.orientedWorld(simLayout, {\n  shape: 'streak', res: RES, splatRCap: 14, heading: 'angle', agitation: 'buffer', comet: false, home: filingsHome,\n  ramp: {colorSpace: 2, trails: 'none'},\n  names: {splat: 'filingsSplat', resolve: 'filingsResolve'},\n})\n\n\u002F\u002F MagneticFilings: iron filings that reveal the field lines of a magnet at the cursor.\nexport const MagneticFilings = defineShader({\n  name: 'MagneticFilings',\n  usesPointer: true,\n  props: {\n    colorA: {default: '#85929e', transform: transformColor},\n    colorB: {default: '#ff9d5c', transform: transformColor},\n    count: {default: 5000},\n    strength: {default: 1},\n    reach: {default: 0.35},\n    response: {default: 0.5},\n    size: {default: 1},\n  },\n  ...agentSim\u003Ctypeof SimParams>({\n    layout: simLayout,\n    params: SimParams,\n    maxAgents: MAX_FILINGS,\n    output: {key: 'outTex', name: 'filingsTexture', size: [RES, RES], format: 'rgba16float'},\n    bake: () => ({\n      pipelines: {\n        init: {kernel: filingsInit, threads: 'max'},\n        update: {kernel: filingsUpdate, threads: 'agents'},\n        splat: filingsRender.splat,\n        resolve: filingsRender.resolve,\n      },\n      initStep: 'init',\n      program: ['update', 'splat', 'resolve'],\n    }),\n    frame: (sys, {getCpuValue}) => {\n      const g = makeCpuValueGetter(getCpuValue)\n      \u002F\u002F The magnet's axis follows where the cursor has been travelling.\n      const motionAxis = agentFrame.createMotionAxis({smoothing: 0.1, teleport: 0.25})\n      return (frameParams) => {\n        const {dt, aspect, pointerX, pointerY} = readAgentFrame(frameParams)\n        const domainX = Math.max(aspect, 0.01)\n        const count = sys.resolveCount(g('count', 5000))\n        const {cols, cellW, cellH} = agentFrame.fitJitteredGrid(count, domainX, OVERSCAN)\n        const cursorX = pointerX * aspect\n        const cursorY = pointerY\n        const axis = motionAxis.update(cursorX, cursorY)\n        const reach = g('reach', 0.35)\n        const colA = getCpuValue('colorA') as {x: number; y: number; z: number; w: number} | undefined\n        const colB = getCpuValue('colorB') as {x: number; y: number; z: number; w: number} | undefined\n        sys.writeParams({\n          colA: d.vec4f(colA?.x ?? 0.52, colA?.y ?? 0.57, colA?.z ?? 0.64, colA?.w ?? 1),\n          colB: d.vec4f(colB?.x ?? 1, colB?.y ?? 0.62, colB?.z ?? 0.36, colB?.w ?? 1),\n          count,\n          dt, aspect, domainX,\n          cursorX, cursorY, axisX: axis.x, axisY: axis.y,\n          fieldType: 0, restMode: 0,\n          strength: g('strength', 1), reachSq: reach * reach,\n          alignK: 45, damping: 3 + Math.min(Math.max(g('response', 0.5), 0), 1) * 9,\n          restK: 6, pullK: 0.25, homeK: 2.5,\n          omegaRef: 6, agitCool: 1,\n          gridCols: cols, cellW, cellH, jitter: 0.85,\n          bodyR: Math.min(Math.max(g('size', 1), 0.5), 3) * 1.7 \u002F SIZE_REF_RES,\n        })\n        return sys.frame({count})\n      }\n    },\n    fragment: {output: 'filingsTexture', fallback: 'transparent'},\n  }),\n})\n",[10,521,522,533,546,559,566,609,614,628,657,670,675,682,701,707,713,719,725,731,737,743,749,755,761,766,772,790,814,833,864,890,896,919,924,929,954,959,965,971,995,1014,1020,1032,1050,1062,1073,1078,1083,1089,1107,1148,1165,1182,1187,1192,1198,1217,1227,1238,1244,1256,1267,1278,1289,1300,1311,1321,1327,1344,1350,1356,1366,1397,1412,1418,1429,1440,1446,1452,1458,1469,1491,1497,1524,1541,1547,1577,1596,1632,1656,1689,1725,1744,1757,1776,1799,1869,1928,1939,1984,2024,2030,2036,2042,2058,2083,2142,2164,2179,2190,2238,2244,2258,2264,2270,2286,2292],{"__ignoreMap":344},[348,523,524,526,529,531],{"class":350,"line":351},[348,525,355],{"class":354},[348,527,528],{"class":358}," {defineShader, sim, transformColor} ",[348,530,362],{"class":354},[348,532,366],{"class":365},[348,534,536,538,541,543],{"class":350,"line":535},2,[348,537,355],{"class":354},[348,539,540],{"class":358}," {tgpu, d, agents} ",[348,542,362],{"class":354},[348,544,545],{"class":365}," '@coreroot\u002Fgpu\u002Fkit'\n",[348,547,549,551,554,556],{"class":350,"line":548},3,[348,550,355],{"class":354},[348,552,553],{"class":358}," {makeCpuValueGetter, readAgentFrame, resolveRenderRes, SIZE_REF_RES} ",[348,555,362],{"class":354},[348,557,558],{"class":365}," '@coreroot\u002Fgpu\u002Fporters'\n",[348,560,562],{"class":350,"line":561},4,[348,563,565],{"emptyLinePlaceholder":564},true,"\n",[348,567,569,572,575,578,580,583,585,587,589,591,593,595,597,600,603,606],{"class":350,"line":568},5,[348,570,571],{"class":354},"const",[348,573,574],{"class":358}," {",[348,576,325],{"class":577},"sDLfK",[348,579,193],{"class":358},[348,581,582],{"class":577},"renderAgents",[348,584,193],{"class":358},[348,586,161],{"class":577},[348,588,193],{"class":358},[348,590,168],{"class":577},[348,592,193],{"class":358},[348,594,146],{"class":577},[348,596,193],{"class":358},[348,598,599],{"class":577},"agentFrame",[348,601,602],{"class":358},"} ",[348,604,605],{"class":354},"=",[348,607,608],{"class":358}," sim.agents\n",[348,610,612],{"class":350,"line":611},6,[348,613,565],{"emptyLinePlaceholder":564},[348,615,617,619,622,625],{"class":350,"line":616},7,[348,618,571],{"class":354},[348,620,621],{"class":577}," MAX_FILINGS",[348,623,624],{"class":354}," =",[348,626,627],{"class":577}," 12288\n",[348,629,631,633,636,638,642,645,648,651,654],{"class":350,"line":630},8,[348,632,571],{"class":354},[348,634,635],{"class":577}," RES",[348,637,624],{"class":354},[348,639,641],{"class":640},"svObZ"," resolveRenderRes",[348,643,644],{"class":358},"({desktop: ",[348,646,647],{"class":577},"1024",[348,649,650],{"class":358},", mobile: ",[348,652,653],{"class":577},"768",[348,655,656],{"class":358},"})\n",[348,658,660,662,665,667],{"class":350,"line":659},9,[348,661,571],{"class":354},[348,663,664],{"class":577}," OVERSCAN",[348,666,624],{"class":354},[348,668,669],{"class":577}," 0.14\n",[348,671,673],{"class":350,"line":672},10,[348,674,565],{"emptyLinePlaceholder":564},[348,676,678],{"class":350,"line":677},11,[348,679,681],{"class":680},"sAwPA","\u002F\u002F The values the torques, the field and the home read each frame.\n",[348,683,685,687,690,692,695,698],{"class":350,"line":684},12,[348,686,571],{"class":354},[348,688,689],{"class":577}," SimParams",[348,691,624],{"class":354},[348,693,694],{"class":358}," d.",[348,696,697],{"class":640},"struct",[348,699,700],{"class":358},"({\n",[348,702,704],{"class":350,"line":703},13,[348,705,706],{"class":358},"  colA: d.vec4f, colB: d.vec4f,\n",[348,708,710],{"class":350,"line":709},14,[348,711,712],{"class":358},"  count: d.f32,\n",[348,714,716],{"class":350,"line":715},15,[348,717,718],{"class":358},"  dt: d.f32, aspect: d.f32, domainX: d.f32,\n",[348,720,722],{"class":350,"line":721},16,[348,723,724],{"class":358},"  cursorX: d.f32, cursorY: d.f32, axisX: d.f32, axisY: d.f32,\n",[348,726,728],{"class":350,"line":727},17,[348,729,730],{"class":358},"  fieldType: d.f32, restMode: d.f32,\n",[348,732,734],{"class":350,"line":733},18,[348,735,736],{"class":358},"  strength: d.f32, reachSq: d.f32,\n",[348,738,740],{"class":350,"line":739},19,[348,741,742],{"class":358},"  alignK: d.f32, damping: d.f32, restK: d.f32, pullK: d.f32, homeK: d.f32,\n",[348,744,746],{"class":350,"line":745},20,[348,747,748],{"class":358},"  omegaRef: d.f32, agitCool: d.f32,\n",[348,750,752],{"class":350,"line":751},21,[348,753,754],{"class":358},"  gridCols: d.f32, cellW: d.f32, cellH: d.f32, jitter: d.f32,\n",[348,756,758],{"class":350,"line":757},22,[348,759,760],{"class":358},"  bodyR: d.f32,\n",[348,762,764],{"class":350,"line":763},23,[348,765,656],{"class":358},[348,767,769],{"class":350,"line":768},24,[348,770,771],{"class":680},"\u002F\u002F Per-agent state (offset from home, angle, spin), excitement, the two canvases, the output.\n",[348,773,775,777,780,782,785,788],{"class":350,"line":774},25,[348,776,571],{"class":354},[348,778,779],{"class":577}," simLayout",[348,781,624],{"class":354},[348,783,784],{"class":358}," tgpu.",[348,786,787],{"class":640},"bindGroupLayout",[348,789,700],{"class":358},[348,791,793,796,799,802,805,808,811],{"class":350,"line":792},26,[348,794,795],{"class":358},"  agents: {storage: d.",[348,797,798],{"class":640},"arrayOf",[348,800,801],{"class":358},"(d.vec4f, ",[348,803,804],{"class":577},"MAX_FILINGS",[348,806,807],{"class":358},"), access: ",[348,809,810],{"class":365},"'mutable'",[348,812,813],{"class":358},"},\n",[348,815,817,820,822,825,827,829,831],{"class":350,"line":816},27,[348,818,819],{"class":358},"  agit: {storage: d.",[348,821,798],{"class":640},[348,823,824],{"class":358},"(d.f32, ",[348,826,804],{"class":577},[348,828,807],{"class":358},[348,830,810],{"class":365},[348,832,813],{"class":358},[348,834,836,839,841,844,847,850,853,856,858,860,862],{"class":350,"line":835},28,[348,837,838],{"class":358},"  accumE: {storage: d.",[348,840,798],{"class":640},[348,842,843],{"class":358},"(d.",[348,845,846],{"class":640},"atomic",[348,848,849],{"class":358},"(d.u32), ",[348,851,852],{"class":577},"RES",[348,854,855],{"class":354}," *",[348,857,635],{"class":577},[348,859,807],{"class":358},[348,861,810],{"class":365},[348,863,813],{"class":358},[348,865,867,870,872,874,876,878,880,882,884,886,888],{"class":350,"line":866},29,[348,868,869],{"class":358},"  accumS: {storage: d.",[348,871,798],{"class":640},[348,873,843],{"class":358},[348,875,846],{"class":640},[348,877,849],{"class":358},[348,879,852],{"class":577},[348,881,855],{"class":354},[348,883,635],{"class":577},[348,885,807],{"class":358},[348,887,810],{"class":365},[348,889,813],{"class":358},[348,891,893],{"class":350,"line":892},30,[348,894,895],{"class":358},"  params: {uniform: SimParams},\n",[348,897,899,902,905,908,911,913,916],{"class":350,"line":898},31,[348,900,901],{"class":358},"  outTex: {storageTexture: d.",[348,903,904],{"class":640},"textureStorage2d",[348,906,907],{"class":358},"(",[348,909,910],{"class":365},"'rgba16float'",[348,912,193],{"class":358},[348,914,915],{"class":365},"'write-only'",[348,917,918],{"class":358},")},\n",[348,920,922],{"class":350,"line":921},32,[348,923,656],{"class":358},[348,925,927],{"class":350,"line":926},33,[348,928,565],{"emptyLinePlaceholder":564},[348,930,932,934,937,939,942,945,948,951],{"class":350,"line":931},34,[348,933,571],{"class":354},[348,935,936],{"class":577}," filingsInit",[348,938,624],{"class":354},[348,940,941],{"class":358}," agents.",[348,943,944],{"class":640},"makeRestingDirectorInit",[348,946,947],{"class":358},"(simLayout, ",[348,949,950],{"class":365},"'filingsInit'",[348,952,953],{"class":358},")\n",[348,955,957],{"class":350,"line":956},35,[348,958,565],{"emptyLinePlaceholder":564},[348,960,962],{"class":350,"line":961},36,[348,963,964],{"class":680},"\u002F\u002F The physics: every filing rests on a jittered grid, samples the magnet at the cursor, and\n",[348,966,968],{"class":350,"line":967},37,[348,969,970],{"class":680},"\u002F\u002F swings onto its field line, with a weak pull back to its rest angle where the field is faint.\n",[348,972,974,976,979,981,984,987,990,993],{"class":350,"line":973},38,[348,975,571],{"class":354},[348,977,978],{"class":577}," filingsHome",[348,980,624],{"class":354},[348,982,983],{"class":358}," field.",[348,985,986],{"class":640},"jitteredGridHome",[348,988,989],{"class":358},"(simLayout, {overscan: ",[348,991,992],{"class":577},"OVERSCAN",[348,994,656],{"class":358},[348,996,998,1000,1003,1005,1008,1011],{"class":350,"line":997},39,[348,999,571],{"class":354},[348,1001,1002],{"class":577}," filingsUpdate",[348,1004,624],{"class":354},[348,1006,1007],{"class":358}," integrator.",[348,1009,1010],{"class":640},"orientation2d",[348,1012,1013],{"class":358},"(simLayout, {\n",[348,1015,1017],{"class":350,"line":1016},40,[348,1018,1019],{"class":358},"  home: filingsHome,\n",[348,1021,1023,1026,1029],{"class":350,"line":1022},41,[348,1024,1025],{"class":358},"  fieldAt: field.",[348,1027,1028],{"class":640},"dipoleOrRadial",[348,1030,1031],{"class":358},"(simLayout),\n",[348,1033,1035,1038,1041,1044,1047],{"class":350,"line":1034},42,[348,1036,1037],{"class":358},"  torques: [torque.",[348,1039,1040],{"class":640},"alignToField",[348,1042,1043],{"class":358},"(simLayout), torque.",[348,1045,1046],{"class":640},"rest",[348,1048,1049],{"class":358},"(simLayout)],\n",[348,1051,1053,1056,1059],{"class":350,"line":1052},43,[348,1054,1055],{"class":358},"  maxOffset: ",[348,1057,1058],{"class":577},"0.12",[348,1060,1061],{"class":358},",\n",[348,1063,1065,1068,1071],{"class":350,"line":1064},44,[348,1066,1067],{"class":358},"  name: ",[348,1069,1070],{"class":365},"'filingsUpdate'",[348,1072,1061],{"class":358},[348,1074,1076],{"class":350,"line":1075},45,[348,1077,656],{"class":358},[348,1079,1081],{"class":350,"line":1080},46,[348,1082,565],{"emptyLinePlaceholder":564},[348,1084,1086],{"class":350,"line":1085},47,[348,1087,1088],{"class":680},"\u002F\u002F The look: slivers drawn along each filing's own angle, colored calm to excited.\n",[348,1090,1092,1094,1097,1099,1102,1105],{"class":350,"line":1091},48,[348,1093,571],{"class":354},[348,1095,1096],{"class":577}," filingsRender",[348,1098,624],{"class":354},[348,1100,1101],{"class":358}," renderAgents.",[348,1103,1104],{"class":640},"orientedWorld",[348,1106,1013],{"class":358},[348,1108,1110,1113,1116,1119,1121,1124,1127,1130,1133,1136,1139,1142,1145],{"class":350,"line":1109},49,[348,1111,1112],{"class":358},"  shape: ",[348,1114,1115],{"class":365},"'streak'",[348,1117,1118],{"class":358},", res: ",[348,1120,852],{"class":577},[348,1122,1123],{"class":358},", splatRCap: ",[348,1125,1126],{"class":577},"14",[348,1128,1129],{"class":358},", heading: ",[348,1131,1132],{"class":365},"'angle'",[348,1134,1135],{"class":358},", agitation: ",[348,1137,1138],{"class":365},"'buffer'",[348,1140,1141],{"class":358},", comet: ",[348,1143,1144],{"class":577},"false",[348,1146,1147],{"class":358},", home: filingsHome,\n",[348,1149,1151,1154,1157,1160,1163],{"class":350,"line":1150},50,[348,1152,1153],{"class":358},"  ramp: {colorSpace: ",[348,1155,1156],{"class":577},"2",[348,1158,1159],{"class":358},", trails: ",[348,1161,1162],{"class":365},"'none'",[348,1164,813],{"class":358},[348,1166,1168,1171,1174,1177,1180],{"class":350,"line":1167},51,[348,1169,1170],{"class":358},"  names: {splat: ",[348,1172,1173],{"class":365},"'filingsSplat'",[348,1175,1176],{"class":358},", resolve: ",[348,1178,1179],{"class":365},"'filingsResolve'",[348,1181,813],{"class":358},[348,1183,1185],{"class":350,"line":1184},52,[348,1186,656],{"class":358},[348,1188,1190],{"class":350,"line":1189},53,[348,1191,565],{"emptyLinePlaceholder":564},[348,1193,1195],{"class":350,"line":1194},54,[348,1196,1197],{"class":680},"\u002F\u002F MagneticFilings: iron filings that reveal the field lines of a magnet at the cursor.\n",[348,1199,1201,1204,1207,1210,1212,1215],{"class":350,"line":1200},55,[348,1202,1203],{"class":354},"export",[348,1205,1206],{"class":354}," const",[348,1208,1209],{"class":577}," MagneticFilings",[348,1211,624],{"class":354},[348,1213,1214],{"class":640}," defineShader",[348,1216,700],{"class":358},[348,1218,1220,1222,1225],{"class":350,"line":1219},56,[348,1221,1067],{"class":358},[348,1223,1224],{"class":365},"'MagneticFilings'",[348,1226,1061],{"class":358},[348,1228,1230,1233,1236],{"class":350,"line":1229},57,[348,1231,1232],{"class":358},"  usesPointer: ",[348,1234,1235],{"class":577},"true",[348,1237,1061],{"class":358},[348,1239,1241],{"class":350,"line":1240},58,[348,1242,1243],{"class":358},"  props: {\n",[348,1245,1247,1250,1253],{"class":350,"line":1246},59,[348,1248,1249],{"class":358},"    colorA: {default: ",[348,1251,1252],{"class":365},"'#85929e'",[348,1254,1255],{"class":358},", transform: transformColor},\n",[348,1257,1259,1262,1265],{"class":350,"line":1258},60,[348,1260,1261],{"class":358},"    colorB: {default: ",[348,1263,1264],{"class":365},"'#ff9d5c'",[348,1266,1255],{"class":358},[348,1268,1270,1273,1276],{"class":350,"line":1269},61,[348,1271,1272],{"class":358},"    count: {default: ",[348,1274,1275],{"class":577},"5000",[348,1277,813],{"class":358},[348,1279,1281,1284,1287],{"class":350,"line":1280},62,[348,1282,1283],{"class":358},"    strength: {default: ",[348,1285,1286],{"class":577},"1",[348,1288,813],{"class":358},[348,1290,1292,1295,1298],{"class":350,"line":1291},63,[348,1293,1294],{"class":358},"    reach: {default: ",[348,1296,1297],{"class":577},"0.35",[348,1299,813],{"class":358},[348,1301,1303,1306,1309],{"class":350,"line":1302},64,[348,1304,1305],{"class":358},"    response: {default: ",[348,1307,1308],{"class":577},"0.5",[348,1310,813],{"class":358},[348,1312,1314,1317,1319],{"class":350,"line":1313},65,[348,1315,1316],{"class":358},"    size: {default: ",[348,1318,1286],{"class":577},[348,1320,813],{"class":358},[348,1322,1324],{"class":350,"line":1323},66,[348,1325,1326],{"class":358},"  },\n",[348,1328,1330,1333,1335,1338,1341],{"class":350,"line":1329},67,[348,1331,1332],{"class":354},"  ...",[348,1334,325],{"class":640},[348,1336,1337],{"class":358},"\u003C",[348,1339,1340],{"class":354},"typeof",[348,1342,1343],{"class":358}," SimParams>({\n",[348,1345,1347],{"class":350,"line":1346},68,[348,1348,1349],{"class":358},"    layout: simLayout,\n",[348,1351,1353],{"class":350,"line":1352},69,[348,1354,1355],{"class":358},"    params: SimParams,\n",[348,1357,1359,1362,1364],{"class":350,"line":1358},70,[348,1360,1361],{"class":358},"    maxAgents: ",[348,1363,804],{"class":577},[348,1365,1061],{"class":358},[348,1367,1369,1372,1375,1378,1381,1384,1386,1388,1390,1393,1395],{"class":350,"line":1368},71,[348,1370,1371],{"class":358},"    output: {key: ",[348,1373,1374],{"class":365},"'outTex'",[348,1376,1377],{"class":358},", name: ",[348,1379,1380],{"class":365},"'filingsTexture'",[348,1382,1383],{"class":358},", size: [",[348,1385,852],{"class":577},[348,1387,193],{"class":358},[348,1389,852],{"class":577},[348,1391,1392],{"class":358},"], format: ",[348,1394,910],{"class":365},[348,1396,813],{"class":358},[348,1398,1400,1403,1406,1409],{"class":350,"line":1399},72,[348,1401,1402],{"class":640},"    bake",[348,1404,1405],{"class":358},": () ",[348,1407,1408],{"class":354},"=>",[348,1410,1411],{"class":358}," ({\n",[348,1413,1415],{"class":350,"line":1414},73,[348,1416,1417],{"class":358},"      pipelines: {\n",[348,1419,1421,1424,1427],{"class":350,"line":1420},74,[348,1422,1423],{"class":358},"        init: {kernel: filingsInit, threads: ",[348,1425,1426],{"class":365},"'max'",[348,1428,813],{"class":358},[348,1430,1432,1435,1438],{"class":350,"line":1431},75,[348,1433,1434],{"class":358},"        update: {kernel: filingsUpdate, threads: ",[348,1436,1437],{"class":365},"'agents'",[348,1439,813],{"class":358},[348,1441,1443],{"class":350,"line":1442},76,[348,1444,1445],{"class":358},"        splat: filingsRender.splat,\n",[348,1447,1449],{"class":350,"line":1448},77,[348,1450,1451],{"class":358},"        resolve: filingsRender.resolve,\n",[348,1453,1455],{"class":350,"line":1454},78,[348,1456,1457],{"class":358},"      },\n",[348,1459,1461,1464,1467],{"class":350,"line":1460},79,[348,1462,1463],{"class":358},"      initStep: ",[348,1465,1466],{"class":365},"'init'",[348,1468,1061],{"class":358},[348,1470,1472,1475,1478,1480,1483,1485,1488],{"class":350,"line":1471},80,[348,1473,1474],{"class":358},"      program: [",[348,1476,1477],{"class":365},"'update'",[348,1479,193],{"class":358},[348,1481,1482],{"class":365},"'splat'",[348,1484,193],{"class":358},[348,1486,1487],{"class":365},"'resolve'",[348,1489,1490],{"class":358},"],\n",[348,1492,1494],{"class":350,"line":1493},81,[348,1495,1496],{"class":358},"    }),\n",[348,1498,1500,1503,1506,1510,1513,1516,1519,1521],{"class":350,"line":1499},82,[348,1501,1502],{"class":640},"    frame",[348,1504,1505],{"class":358},": (",[348,1507,1509],{"class":1508},"s9osk","sys",[348,1511,1512],{"class":358},", {",[348,1514,1515],{"class":1508},"getCpuValue",[348,1517,1518],{"class":358},"}) ",[348,1520,1408],{"class":354},[348,1522,1523],{"class":358}," {\n",[348,1525,1527,1530,1533,1535,1538],{"class":350,"line":1526},83,[348,1528,1529],{"class":354},"      const",[348,1531,1532],{"class":577}," g",[348,1534,624],{"class":354},[348,1536,1537],{"class":640}," makeCpuValueGetter",[348,1539,1540],{"class":358},"(getCpuValue)\n",[348,1542,1544],{"class":350,"line":1543},84,[348,1545,1546],{"class":680},"      \u002F\u002F The magnet's axis follows where the cursor has been travelling.\n",[348,1548,1550,1552,1555,1557,1560,1563,1566,1569,1572,1575],{"class":350,"line":1549},85,[348,1551,1529],{"class":354},[348,1553,1554],{"class":577}," motionAxis",[348,1556,624],{"class":354},[348,1558,1559],{"class":358}," agentFrame.",[348,1561,1562],{"class":640},"createMotionAxis",[348,1564,1565],{"class":358},"({smoothing: ",[348,1567,1568],{"class":577},"0.1",[348,1570,1571],{"class":358},", teleport: ",[348,1573,1574],{"class":577},"0.25",[348,1576,656],{"class":358},[348,1578,1580,1583,1586,1589,1592,1594],{"class":350,"line":1579},86,[348,1581,1582],{"class":354},"      return",[348,1584,1585],{"class":358}," (",[348,1587,1588],{"class":1508},"frameParams",[348,1590,1591],{"class":358},") ",[348,1593,1408],{"class":354},[348,1595,1523],{"class":358},[348,1597,1599,1602,1604,1607,1609,1612,1614,1617,1619,1622,1624,1626,1629],{"class":350,"line":1598},87,[348,1600,1601],{"class":354},"        const",[348,1603,574],{"class":358},[348,1605,1606],{"class":577},"dt",[348,1608,193],{"class":358},[348,1610,1611],{"class":577},"aspect",[348,1613,193],{"class":358},[348,1615,1616],{"class":577},"pointerX",[348,1618,193],{"class":358},[348,1620,1621],{"class":577},"pointerY",[348,1623,602],{"class":358},[348,1625,605],{"class":354},[348,1627,1628],{"class":640}," readAgentFrame",[348,1630,1631],{"class":358},"(frameParams)\n",[348,1633,1635,1637,1640,1642,1645,1648,1651,1654],{"class":350,"line":1634},88,[348,1636,1601],{"class":354},[348,1638,1639],{"class":577}," domainX",[348,1641,624],{"class":354},[348,1643,1644],{"class":358}," Math.",[348,1646,1647],{"class":640},"max",[348,1649,1650],{"class":358},"(aspect, ",[348,1652,1653],{"class":577},"0.01",[348,1655,953],{"class":358},[348,1657,1659,1661,1664,1666,1669,1672,1674,1677,1679,1682,1684,1686],{"class":350,"line":1658},89,[348,1660,1601],{"class":354},[348,1662,1663],{"class":577}," count",[348,1665,624],{"class":354},[348,1667,1668],{"class":358}," sys.",[348,1670,1671],{"class":640},"resolveCount",[348,1673,907],{"class":358},[348,1675,1676],{"class":640},"g",[348,1678,907],{"class":358},[348,1680,1681],{"class":365},"'count'",[348,1683,193],{"class":358},[348,1685,1275],{"class":577},[348,1687,1688],{"class":358},"))\n",[348,1690,1692,1694,1696,1699,1701,1704,1706,1709,1711,1713,1715,1718,1721,1723],{"class":350,"line":1691},90,[348,1693,1601],{"class":354},[348,1695,574],{"class":358},[348,1697,1698],{"class":577},"cols",[348,1700,193],{"class":358},[348,1702,1703],{"class":577},"cellW",[348,1705,193],{"class":358},[348,1707,1708],{"class":577},"cellH",[348,1710,602],{"class":358},[348,1712,605],{"class":354},[348,1714,1559],{"class":358},[348,1716,1717],{"class":640},"fitJitteredGrid",[348,1719,1720],{"class":358},"(count, domainX, ",[348,1722,992],{"class":577},[348,1724,953],{"class":358},[348,1726,1728,1730,1733,1735,1738,1741],{"class":350,"line":1727},91,[348,1729,1601],{"class":354},[348,1731,1732],{"class":577}," cursorX",[348,1734,624],{"class":354},[348,1736,1737],{"class":358}," pointerX ",[348,1739,1740],{"class":354},"*",[348,1742,1743],{"class":358}," aspect\n",[348,1745,1747,1749,1752,1754],{"class":350,"line":1746},92,[348,1748,1601],{"class":354},[348,1750,1751],{"class":577}," cursorY",[348,1753,624],{"class":354},[348,1755,1756],{"class":358}," pointerY\n",[348,1758,1760,1762,1765,1767,1770,1773],{"class":350,"line":1759},93,[348,1761,1601],{"class":354},[348,1763,1764],{"class":577}," axis",[348,1766,624],{"class":354},[348,1768,1769],{"class":358}," motionAxis.",[348,1771,1772],{"class":640},"update",[348,1774,1775],{"class":358},"(cursorX, cursorY)\n",[348,1777,1779,1781,1784,1786,1788,1790,1793,1795,1797],{"class":350,"line":1778},94,[348,1780,1601],{"class":354},[348,1782,1783],{"class":577}," reach",[348,1785,624],{"class":354},[348,1787,1532],{"class":640},[348,1789,907],{"class":358},[348,1791,1792],{"class":365},"'reach'",[348,1794,193],{"class":358},[348,1796,1297],{"class":577},[348,1798,953],{"class":358},[348,1800,1802,1804,1807,1809,1812,1814,1817,1819,1822,1824,1827,1830,1833,1836,1839,1841,1843,1845,1848,1850,1852,1854,1857,1859,1861,1863,1866],{"class":350,"line":1801},95,[348,1803,1601],{"class":354},[348,1805,1806],{"class":577}," colA",[348,1808,624],{"class":354},[348,1810,1811],{"class":640}," getCpuValue",[348,1813,907],{"class":358},[348,1815,1816],{"class":365},"'colorA'",[348,1818,1591],{"class":358},[348,1820,1821],{"class":354},"as",[348,1823,574],{"class":358},[348,1825,1826],{"class":1508},"x",[348,1828,1829],{"class":354},":",[348,1831,1832],{"class":577}," number",[348,1834,1835],{"class":358},"; ",[348,1837,1838],{"class":1508},"y",[348,1840,1829],{"class":354},[348,1842,1832],{"class":577},[348,1844,1835],{"class":358},[348,1846,1847],{"class":1508},"z",[348,1849,1829],{"class":354},[348,1851,1832],{"class":577},[348,1853,1835],{"class":358},[348,1855,1856],{"class":1508},"w",[348,1858,1829],{"class":354},[348,1860,1832],{"class":577},[348,1862,602],{"class":358},[348,1864,1865],{"class":354},"|",[348,1867,1868],{"class":577}," undefined\n",[348,1870,1872,1874,1877,1879,1881,1883,1886,1888,1890,1892,1894,1896,1898,1900,1902,1904,1906,1908,1910,1912,1914,1916,1918,1920,1922,1924,1926],{"class":350,"line":1871},96,[348,1873,1601],{"class":354},[348,1875,1876],{"class":577}," colB",[348,1878,624],{"class":354},[348,1880,1811],{"class":640},[348,1882,907],{"class":358},[348,1884,1885],{"class":365},"'colorB'",[348,1887,1591],{"class":358},[348,1889,1821],{"class":354},[348,1891,574],{"class":358},[348,1893,1826],{"class":1508},[348,1895,1829],{"class":354},[348,1897,1832],{"class":577},[348,1899,1835],{"class":358},[348,1901,1838],{"class":1508},[348,1903,1829],{"class":354},[348,1905,1832],{"class":577},[348,1907,1835],{"class":358},[348,1909,1847],{"class":1508},[348,1911,1829],{"class":354},[348,1913,1832],{"class":577},[348,1915,1835],{"class":358},[348,1917,1856],{"class":1508},[348,1919,1829],{"class":354},[348,1921,1832],{"class":577},[348,1923,602],{"class":358},[348,1925,1865],{"class":354},[348,1927,1868],{"class":577},[348,1929,1931,1934,1937],{"class":350,"line":1930},97,[348,1932,1933],{"class":358},"        sys.",[348,1935,1936],{"class":640},"writeParams",[348,1938,700],{"class":358},[348,1940,1942,1945,1948,1951,1954,1957,1960,1962,1965,1968,1970,1973,1976,1978,1981],{"class":350,"line":1941},98,[348,1943,1944],{"class":358},"          colA: d.",[348,1946,1947],{"class":640},"vec4f",[348,1949,1950],{"class":358},"(colA?.x ",[348,1952,1953],{"class":354},"??",[348,1955,1956],{"class":577}," 0.52",[348,1958,1959],{"class":358},", colA?.y ",[348,1961,1953],{"class":354},[348,1963,1964],{"class":577}," 0.57",[348,1966,1967],{"class":358},", colA?.z ",[348,1969,1953],{"class":354},[348,1971,1972],{"class":577}," 0.64",[348,1974,1975],{"class":358},", colA?.w ",[348,1977,1953],{"class":354},[348,1979,1980],{"class":577}," 1",[348,1982,1983],{"class":358},"),\n",[348,1985,1987,1990,1992,1995,1997,1999,2002,2004,2007,2010,2012,2015,2018,2020,2022],{"class":350,"line":1986},99,[348,1988,1989],{"class":358},"          colB: d.",[348,1991,1947],{"class":640},[348,1993,1994],{"class":358},"(colB?.x ",[348,1996,1953],{"class":354},[348,1998,1980],{"class":577},[348,2000,2001],{"class":358},", colB?.y ",[348,2003,1953],{"class":354},[348,2005,2006],{"class":577}," 0.62",[348,2008,2009],{"class":358},", colB?.z ",[348,2011,1953],{"class":354},[348,2013,2014],{"class":577}," 0.36",[348,2016,2017],{"class":358},", colB?.w ",[348,2019,1953],{"class":354},[348,2021,1980],{"class":577},[348,2023,1983],{"class":358},[348,2025,2027],{"class":350,"line":2026},100,[348,2028,2029],{"class":358},"          count,\n",[348,2031,2033],{"class":350,"line":2032},101,[348,2034,2035],{"class":358},"          dt, aspect, domainX,\n",[348,2037,2039],{"class":350,"line":2038},102,[348,2040,2041],{"class":358},"          cursorX, cursorY, axisX: axis.x, axisY: axis.y,\n",[348,2043,2045,2048,2051,2054,2056],{"class":350,"line":2044},103,[348,2046,2047],{"class":358},"          fieldType: ",[348,2049,2050],{"class":577},"0",[348,2052,2053],{"class":358},", restMode: ",[348,2055,2050],{"class":577},[348,2057,1061],{"class":358},[348,2059,2061,2064,2066,2068,2071,2073,2075,2078,2080],{"class":350,"line":2060},104,[348,2062,2063],{"class":358},"          strength: ",[348,2065,1676],{"class":640},[348,2067,907],{"class":358},[348,2069,2070],{"class":365},"'strength'",[348,2072,193],{"class":358},[348,2074,1286],{"class":577},[348,2076,2077],{"class":358},"), reachSq: reach ",[348,2079,1740],{"class":354},[348,2081,2082],{"class":358}," reach,\n",[348,2084,2086,2089,2092,2095,2098,2101,2103,2106,2109,2111,2113,2115,2117,2120,2122,2124,2127,2129,2131,2133,2135,2137,2140],{"class":350,"line":2085},105,[348,2087,2088],{"class":358},"          alignK: ",[348,2090,2091],{"class":577},"45",[348,2093,2094],{"class":358},", damping: ",[348,2096,2097],{"class":577},"3",[348,2099,2100],{"class":354}," +",[348,2102,1644],{"class":358},[348,2104,2105],{"class":640},"min",[348,2107,2108],{"class":358},"(Math.",[348,2110,1647],{"class":640},[348,2112,907],{"class":358},[348,2114,1676],{"class":640},[348,2116,907],{"class":358},[348,2118,2119],{"class":365},"'response'",[348,2121,193],{"class":358},[348,2123,1308],{"class":577},[348,2125,2126],{"class":358},"), ",[348,2128,2050],{"class":577},[348,2130,2126],{"class":358},[348,2132,1286],{"class":577},[348,2134,1591],{"class":358},[348,2136,1740],{"class":354},[348,2138,2139],{"class":577}," 9",[348,2141,1061],{"class":358},[348,2143,2145,2148,2151,2154,2156,2159,2162],{"class":350,"line":2144},106,[348,2146,2147],{"class":358},"          restK: ",[348,2149,2150],{"class":577},"6",[348,2152,2153],{"class":358},", pullK: ",[348,2155,1574],{"class":577},[348,2157,2158],{"class":358},", homeK: ",[348,2160,2161],{"class":577},"2.5",[348,2163,1061],{"class":358},[348,2165,2167,2170,2172,2175,2177],{"class":350,"line":2166},107,[348,2168,2169],{"class":358},"          omegaRef: ",[348,2171,2150],{"class":577},[348,2173,2174],{"class":358},", agitCool: ",[348,2176,1286],{"class":577},[348,2178,1061],{"class":358},[348,2180,2182,2185,2188],{"class":350,"line":2181},108,[348,2183,2184],{"class":358},"          gridCols: cols, cellW, cellH, jitter: ",[348,2186,2187],{"class":577},"0.85",[348,2189,1061],{"class":358},[348,2191,2193,2196,2198,2200,2202,2204,2206,2208,2211,2213,2215,2217,2219,2221,2223,2225,2227,2230,2233,2236],{"class":350,"line":2192},109,[348,2194,2195],{"class":358},"          bodyR: Math.",[348,2197,2105],{"class":640},[348,2199,2108],{"class":358},[348,2201,1647],{"class":640},[348,2203,907],{"class":358},[348,2205,1676],{"class":640},[348,2207,907],{"class":358},[348,2209,2210],{"class":365},"'size'",[348,2212,193],{"class":358},[348,2214,1286],{"class":577},[348,2216,2126],{"class":358},[348,2218,1308],{"class":577},[348,2220,2126],{"class":358},[348,2222,2097],{"class":577},[348,2224,1591],{"class":358},[348,2226,1740],{"class":354},[348,2228,2229],{"class":577}," 1.7",[348,2231,2232],{"class":354}," \u002F",[348,2234,2235],{"class":577}," SIZE_REF_RES",[348,2237,1061],{"class":358},[348,2239,2241],{"class":350,"line":2240},110,[348,2242,2243],{"class":358},"        })\n",[348,2245,2247,2250,2252,2255],{"class":350,"line":2246},111,[348,2248,2249],{"class":354},"        return",[348,2251,1668],{"class":358},[348,2253,2254],{"class":640},"frame",[348,2256,2257],{"class":358},"({count})\n",[348,2259,2261],{"class":350,"line":2260},112,[348,2262,2263],{"class":358},"      }\n",[348,2265,2267],{"class":350,"line":2266},113,[348,2268,2269],{"class":358},"    },\n",[348,2271,2273,2276,2278,2281,2284],{"class":350,"line":2272},114,[348,2274,2275],{"class":358},"    fragment: {output: ",[348,2277,1380],{"class":365},[348,2279,2280],{"class":358},", fallback: ",[348,2282,2283],{"class":365},"'transparent'",[348,2285,813],{"class":358},[348,2287,2289],{"class":350,"line":2288},115,[348,2290,2291],{"class":358},"  }),\n",[348,2293,2295],{"class":350,"line":2294},116,[348,2296,656],{"class":358},[368,2298,2300],{"id":2299},"types","Types",[373,2302,2303,2313],{},[376,2304,2305],{},[379,2306,2307,2310],{},[382,2308,2309],{},"Type",[382,2311,2312],{},"What it is",[389,2314,2315,2337,2347,2357,2367,2377,2387,2397,2407,2421,2440,2459,2472,2497,2507,2523,2540],{},[379,2316,2317,2322],{},[394,2318,2319],{},[10,2320,2321],{},"AdvectLayout",[394,2323,2324,2325,2328,2329,2332,2333,2336],{},"What a fluid-carried layout must name: ",[10,2326,2327],{},"agents",", the fluid's velocity texture ",[10,2330,2331],{},"velTex"," and the ",[10,2334,2335],{},"params"," values.",[379,2338,2339,2344],{},[394,2340,2341],{},[10,2342,2343],{},"AgentChannel",[394,2345,2346],{},"One number in 0–1 read out of a color and its alpha: a brightness, a channel, a saturation.",[379,2348,2349,2354],{},[394,2350,2351],{},[10,2352,2353],{},"AgentDrift",[394,2355,2356],{},"A built-in velocity for an agent, from its index alone.",[379,2358,2359,2364],{},[394,2360,2361],{},[10,2362,2363],{},"AgentFieldAt",[394,2365,2366],{},"A sample of a field at a 2D position.",[379,2368,2369,2374],{},[394,2370,2371],{},[10,2372,2373],{},"AgentForce3",[394,2375,2376],{},"A push on a 3D agent, from its position, velocity and per-agent seed.",[379,2378,2379,2384],{},[394,2380,2381],{},[10,2382,2383],{},"AgentHome2",[394,2385,2386],{},"An agent's resting position, from its index.",[379,2388,2389,2394],{},[394,2390,2391],{},[10,2392,2393],{},"AgentSteer2",[394,2395,2396],{},"A steering push on a 2D agent, from its position, velocity and its own top speed.",[379,2398,2399,2404],{},[394,2400,2401],{},[10,2402,2403],{},"AgentTorque",[394,2405,2406],{},"A turn on a turning agent, from the field at its position, its angle and its index.",[379,2408,2409,2414],{},[394,2410,2411],{},[10,2412,2413],{},"DriftLayout",[394,2415,2416,2417,2332,2419,2336],{},"What a drifting-mote layout must name: ",[10,2418,2327],{},[10,2420,2335],{},[379,2422,2423,2428],{},[394,2424,2425],{},[10,2426,2427],{},"FieldSampleValue",[394,2429,2430,2431,193,2434,193,2437,330],{},"A field sample's value: ",[10,2432,2433],{},"rhat",[10,2435,2436],{},"strength",[10,2438,2439],{},"phi",[379,2441,2442,2447],{},[394,2443,2444],{},[10,2445,2446],{},"OrientationLayout",[394,2448,2449,2450,2452,2453,2456,2457,2336],{},"What a turning-agent layout must name: ",[10,2451,2327],{},", the ",[10,2454,2455],{},"agit"," excitement buffer and the ",[10,2458,2335],{},[379,2460,2461,2466],{},[394,2462,2463],{},[10,2464,2465],{},"PressureForce",[394,2467,2468,2469,2471],{},"What ",[10,2470,192],{}," returns: the force, plus the two density-grid steps and the grid's cell count for the program.",[379,2473,2474,2479],{},[394,2475,2476],{},[10,2477,2478],{},"ReliefLayout",[394,2480,2481,2482,193,2485,193,2488,2491,2492,2332,2495,2336],{},"What an image-relief layout must name: ",[10,2483,2484],{},"pos",[10,2486,2487],{},"vel",[10,2489,2490],{},"col",", the child picture ",[10,2493,2494],{},"src",[10,2496,2335],{},[379,2498,2499,2504],{},[394,2500,2501],{},[10,2502,2503],{},"ShapeField3",[394,2505,2506],{},"The signed distance to a shape's surface at a shape-local 3D point, negative inside.",[379,2508,2509,2514],{},[394,2510,2511],{},[10,2512,2513],{},"SteeringLayout",[394,2515,2516,2517,2452,2519,2456,2521,2336],{},"What a flock's layout must name: ",[10,2518,2327],{},[10,2520,2455],{},[10,2522,2335],{},[379,2524,2525,2530],{},[394,2526,2527],{},[10,2528,2529],{},"Vec4StateArray",[394,2531,2532,2533,193,2535,193,2537,2539],{},"A per-agent buffer of four numbers each (",[10,2534,2327],{},[10,2536,2484],{},[10,2538,2487],{},", …).",[379,2541,2542,2547],{},[394,2543,2544],{},[10,2545,2546],{},"VolumeSwarmLayout",[394,2548,2549,2550,193,2552,2452,2554,2557,2558,2336],{},"What a 3D swarm's layout must name: ",[10,2551,2484],{},[10,2553,2487],{},[10,2555,2556],{},"dens"," grid and the ",[10,2559,2335],{},[368,2561,2563],{"id":2562},"words","Words",[2565,2566,2568],"primitive-words",{":words":2567},"[{\"name\":\"integrator\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator\",\"summary\":\"The update step of an agent simulation: one per kind of agent.\"},{\"name\":\"integrator.steering2d\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-steering2d\",\"summary\":\"A flock under summed steering, kept cruising, arcing off the canvas edges.\"},{\"name\":\"integrator.forces3d\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-forces3d\",\"summary\":\"A 3D swarm under summed forces, with drag, a speed limit and a position clamp.\"},{\"name\":\"integrator.orientation2d\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-orientation2d\",\"summary\":\"Agents that turn in place under summed torques and drift a little toward the field.\"},{\"name\":\"integrator.drift2d\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-drift2d\",\"summary\":\"Motes that glide on a built-in drift plus a fading gust, wrapping around the canvas.\"},{\"name\":\"integrator.relief\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-relief\",\"summary\":\"Particles standing on the child's image, rising by a color channel, springing home.\"},{\"name\":\"integrator.advect2d\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator-advect2d\",\"summary\":\"Particles carried by a fluid's velocity texture, easing back to an even spread.\"},{\"name\":\"force\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce\",\"summary\":\"The pushes an agent can feel.\"},{\"name\":\"force.flocking\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-flocking\",\"summary\":\"Separation, alignment and cohesion for a flock, with live weights and radii.\"},{\"name\":\"force.cursorSteer\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorsteer\",\"summary\":\"The cursor on a flock: attract, scatter like a predator, or nothing.\"},{\"name\":\"force.wallTurn\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-wallturn\",\"summary\":\"A soft turn back toward the canvas near an edge, so a flock arcs instead of bouncing.\"},{\"name\":\"force.pressure\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-pressure\",\"summary\":\"Spread a 3D swarm evenly by pushing agents away from crowded cells of a density grid.\"},{\"name\":\"force.containment\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-containment\",\"summary\":\"Keep a 3D swarm inside a shape: a spring at the surface, a pull back from far away, and a drag when the shape rotates.\"},{\"name\":\"force.cursorXY\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorxy\",\"summary\":\"The cursor as a magnet on a 3D swarm, pushing away (or pulling in when the force is negative).\"},{\"name\":\"force.gravity\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-gravity\",\"summary\":\"A constant pull on a 3D swarm in the direction of `params.gravX, gravY`.\"},{\"name\":\"force.turbulence\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-turbulence\",\"summary\":\"A per-agent jitter that keeps a 3D swarm alive, scaled by `params.agitation`.\"},{\"name\":\"force.cursorGust\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorgust\",\"summary\":\"A puff from the cursor on drifting motes, zero while the force slider sits at 0.\"},{\"name\":\"force.cursorInView\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fforce-cursorinview\",\"summary\":\"The cursor on an image relief, applied where each particle appears on screen.\"},{\"name\":\"torque\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque\",\"summary\":\"The turns an agent that spins in place can feel, for `integrator.orientation2d`.\"},{\"name\":\"torque.alignToField\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque-aligntofield\",\"summary\":\"Swing onto the field's line like a compass needle.\"},{\"name\":\"torque.rest\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ftorque-rest\",\"summary\":\"A weak swing back to each agent's rest angle, felt only where the field is faint.\"},{\"name\":\"field\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield\",\"summary\":\"What a turning agent samples at its position: the magnetic field at the cursor, and its resting place on a jittered grid.\"},{\"name\":\"field.dipoleOrRadial\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield-dipoleorradial\",\"summary\":\"The field of a magnet at the cursor: a bar magnet along its travel, or a single pole.\"},{\"name\":\"field.jitteredGridHome\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffield-jitteredgridhome\",\"summary\":\"Each agent's resting position on a jittered grid that runs past the canvas edges.\"},{\"name\":\"drift\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fdrift\",\"summary\":\"A built-in velocity for motes that glide, for `integrator.drift2d`.\"},{\"name\":\"drift.variedHeading\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fdrift-variedheading\",\"summary\":\"One shared heading and speed, each varied a little per mote.\"},{\"name\":\"channel\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel\",\"summary\":\"Which part of the child's color drives a particle: `luminance`, `luminanceInverted`, `red`, `green`, `blue`, `saturation` or `alpha`, each a number in 0–1.\"},{\"name\":\"FieldSample\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffieldsample\",\"summary\":\"What a field sample carries: the direction away from the source (`rhat`), the `strength`, and the line angle `phi` in radians.\"},{\"name\":\"channel.alpha\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-alpha\",\"summary\":\"The pixel's alpha.\"},{\"name\":\"channel.blue\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-blue\",\"summary\":\"The blue channel.\"},{\"name\":\"channel.byMode\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-bymode\",\"summary\":\"The same seven by a select prop's number: 0 luminance, 1 inverted, 2 red, 3 green, 4 blue, 5 saturation, 6 alpha.\"},{\"name\":\"channel.green\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-green\",\"summary\":\"The green channel.\"},{\"name\":\"channel.luminance\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-luminance\",\"summary\":\"The color's brightness, 0 black to 1 white.\"},{\"name\":\"channel.luminanceInverted\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-luminanceinverted\",\"summary\":\"One minus the brightness, so dark areas rise.\"},{\"name\":\"channel.red\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-red\",\"summary\":\"The red channel.\"},{\"name\":\"channel.saturation\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-saturation\",\"summary\":\"How colorful the pixel is, 0 grey to 1 pure.\"}]",[2569,2570,2571,2580,2587,2594,2601,2608,2615,2622,2629,2636,2643,2650,2657,2664,2671,2681,2691,2698,2705,2714,2721,2728,2735,2742,2749,2758,2765,2795,2813,2822,2831,2840,2849,2858,2867,2876],"ul",{},[2572,2573,2574,2579],"li",{},[149,2575,2577],{"href":2576},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fintegrator",[10,2578,146],{}," — The update step of an agent simulation: one per kind of agent.",[2572,2581,2582,2586],{},[149,2583,2584],{"href":221},[10,2585,224],{}," — A flock under summed steering, kept cruising, arcing off the canvas edges.",[2572,2588,2589,2593],{},[149,2590,2591],{"href":182},[10,2592,185],{}," — A 3D swarm under summed forces, with drag, a speed limit and a position clamp.",[2572,2595,2596,2600],{},[149,2597,2598],{"href":246},[10,2599,249],{}," — Agents that turn in place under summed torques and drift a little toward the field.",[2572,2602,2603,2607],{},[149,2604,2605],{"href":280},[10,2606,283],{}," — Motes that glide on a built-in drift plus a fading gust, wrapping around the canvas.",[2572,2609,2610,2614],{},[149,2611,2612],{"href":299},[10,2613,302],{}," — Particles standing on the child's image, rising by a color channel, springing home.",[2572,2616,2617,2621],{},[149,2618,2619],{"href":318},[10,2620,321],{}," — Particles carried by a fluid's velocity texture, easing back to an even spread.",[2572,2623,2624,2628],{},[149,2625,2626],{"href":151},[10,2627,154],{}," — The pushes an agent can feel.",[2572,2630,2631,2635],{},[149,2632,2633],{"href":228},[10,2634,231],{}," — Separation, alignment and cohesion for a flock, with live weights and radii.",[2572,2637,2638,2642],{},[149,2639,2640],{"href":234},[10,2641,237],{}," — The cursor on a flock: attract, scatter like a predator, or nothing.",[2572,2644,2645,2649],{},[149,2646,2647],{"href":240},[10,2648,243],{}," — A soft turn back toward the canvas near an edge, so a flock arcs instead of bouncing.",[2572,2651,2652,2656],{},[149,2653,2654],{"href":189},[10,2655,192],{}," — Spread a 3D swarm evenly by pushing agents away from crowded cells of a density grid.",[2572,2658,2659,2663],{},[149,2660,2661],{"href":196},[10,2662,199],{}," — Keep a 3D swarm inside a shape: a spring at the surface, a pull back from far away, and a drag when the shape rotates.",[2572,2665,2666,2670],{},[149,2667,2668],{"href":202},[10,2669,205],{}," — The cursor as a magnet on a 3D swarm, pushing away (or pulling in when the force is negative).",[2572,2672,2673,2677,2678,330],{},[149,2674,2675],{"href":208},[10,2676,211],{}," — A constant pull on a 3D swarm in the direction of ",[10,2679,2680],{},"params.gravX, gravY",[2572,2682,2683,2687,2688,330],{},[149,2684,2685],{"href":214},[10,2686,217],{}," — A per-agent jitter that keeps a 3D swarm alive, scaled by ",[10,2689,2690],{},"params.agitation",[2572,2692,2693,2697],{},[149,2694,2695],{"href":293},[10,2696,296],{}," — A puff from the cursor on drifting motes, zero while the force slider sits at 0.",[2572,2699,2700,2704],{},[149,2701,2702],{"href":312},[10,2703,315],{}," — The cursor on an image relief, applied where each particle appears on screen.",[2572,2706,2707,2711,2712,330],{},[149,2708,2709],{"href":158},[10,2710,161],{}," — The turns an agent that spins in place can feel, for ",[10,2713,249],{},[2572,2715,2716,2720],{},[149,2717,2718],{"href":253},[10,2719,256],{}," — Swing onto the field's line like a compass needle.",[2572,2722,2723,2727],{},[149,2724,2725],{"href":259},[10,2726,262],{}," — A weak swing back to each agent's rest angle, felt only where the field is faint.",[2572,2729,2730,2734],{},[149,2731,2732],{"href":165},[10,2733,168],{}," — What a turning agent samples at its position: the magnetic field at the cursor, and its resting place on a jittered grid.",[2572,2736,2737,2741],{},[149,2738,2739],{"href":266},[10,2740,269],{}," — The field of a magnet at the cursor: a bar magnet along its travel, or a single pole.",[2572,2743,2744,2748],{},[149,2745,2746],{"href":273},[10,2747,276],{}," — Each agent's resting position on a jittered grid that runs past the canvas edges.",[2572,2750,2751,2755,2756,330],{},[149,2752,2753],{"href":172},[10,2754,175],{}," — A built-in velocity for motes that glide, for ",[10,2757,283],{},[2572,2759,2760,2764],{},[149,2761,2762],{"href":287},[10,2763,290],{}," — One shared heading and speed, each varied a little per mote.",[2572,2766,2767,2771,2772,193,2775,193,2778,193,2781,193,2784,193,2787,2790,2791,2794],{},[149,2768,2769],{"href":306},[10,2770,309],{}," — Which part of the child's color drives a particle: ",[10,2773,2774],{},"luminance",[10,2776,2777],{},"luminanceInverted",[10,2779,2780],{},"red",[10,2782,2783],{},"green",[10,2785,2786],{},"blue",[10,2788,2789],{},"saturation"," or ",[10,2792,2793],{},"alpha",", each a number in 0–1.",[2572,2796,2797,2803,2804,2806,2807,2809,2810,2812],{},[149,2798,2800],{"href":2799},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Ffieldsample",[10,2801,2802],{},"FieldSample"," — What a field sample carries: the direction away from the source (",[10,2805,2433],{},"), the ",[10,2808,2436],{},", and the line angle ",[10,2811,2439],{}," in radians.",[2572,2814,2815,2821],{},[149,2816,2818],{"href":2817},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-alpha",[10,2819,2820],{},"channel.alpha"," — The pixel's alpha.",[2572,2823,2824,2830],{},[149,2825,2827],{"href":2826},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-blue",[10,2828,2829],{},"channel.blue"," — The blue channel.",[2572,2832,2833,2839],{},[149,2834,2836],{"href":2835},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-bymode",[10,2837,2838],{},"channel.byMode"," — The same seven by a select prop's number: 0 luminance, 1 inverted, 2 red, 3 green, 4 blue, 5 saturation, 6 alpha.",[2572,2841,2842,2848],{},[149,2843,2845],{"href":2844},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-green",[10,2846,2847],{},"channel.green"," — The green channel.",[2572,2850,2851,2857],{},[149,2852,2854],{"href":2853},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-luminance",[10,2855,2856],{},"channel.luminance"," — The color's brightness, 0 black to 1 white.",[2572,2859,2860,2866],{},[149,2861,2863],{"href":2862},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-luminanceinverted",[10,2864,2865],{},"channel.luminanceInverted"," — One minus the brightness, so dark areas rise.",[2572,2868,2869,2875],{},[149,2870,2872],{"href":2871},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-red",[10,2873,2874],{},"channel.red"," — The red channel.",[2572,2877,2878,2884],{},[149,2879,2881],{"href":2880},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces\u002Fchannel-saturation",[10,2882,2883],{},"channel.saturation"," — How colorful the pixel is, 0 grey to 1 pure.",[2886,2887,2888],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}",{"title":344,"searchDepth":535,"depth":535,"links":2890},[2891,2892,2893,2894],{"id":370,"depth":535,"text":371},{"id":515,"depth":535,"text":516},{"id":2299,"depth":535,"text":2300},{"id":2562,"depth":535,"text":2563},"sim.agentForces","sim-agentforces",null,"What pushes, turns and carries each agent.","https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fedit\u002Fmain\u002Fpackages\u002Fcore\u002Fdocs\u002Fstd\u002Fsim.agentForces.md","md","simulation","Simulation",{},"\u002Fdocs\u002Fprimitives\u002Fsim-agentforces",{"title":131,"description":2898},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fsim\u002FagentForces.ts","docs\u002Fprimitives\u002F41.sim-agentforces\u002Findex","zd_zJP5fZW0OYZ0EAJsstY_XmnT0rf20rtCjEfix1vA"]