PageSourceSearch

https://georgluif.at/assets/hero-aura.js?v=6b16fa26

js georgluif.at collected 2026-10-09 21:24:18 UTC 2,181 bytes, 2 lines download raw bytes

1/*! © 2011–2026 Georg Luif · georgluif.at · All rights reserved. */
2import{createEffect as M,createEmitter as g}from"./particles.js";import{FX as z}from"./fx-recipes.js";import{AURA_RADIUS as k}from"./hero-item-rolls.js";const x=.5,R=24,F=1.2,I=12;export function createFlockAura(u){const c=u.scene,d=u.self,m=u.peers,h=!!u.reducedMotion,i=new Map,a=new Map;let l=0,y=!1;function v(o){let t=i.get(o);if(!t){if(i.size>=I)return null;const n=M(z.flockAura(),{seed:Math.random()*9973|0});n.points.traverse(function(s){s.raycast=function(){}}),c.add(n.points),t={fx:n,seen:!0},i.set(o,t)}return t.seen=!0,t}function A(o,t){let n=a.get(o);if(!n){const s={x:t.x,y:t.y-x+.35,z:t.z},p=Object.assign({},z.speedTrail(),{origin:s}),e=g(p);e.points.raycast=function(){},c.add(e.points),n={emitter:e,o:p,origin:s,last:{x:t.x,z:t.z},seen:!0},a.set(o,n)}return n.seen=!0,n}return{update:function(o){if(y)return;const t=o>0?o:.016,n=[],s=d?d():null;s&&n.push({key:"self",x:s.x,y:s.y,z:s.z,aura:s.aura||0,v:Math.hypot(s.vx||0,s.vz||0)});for(const e of m?m():[])n.push({key:"p:"+e.id,x:e.x,y:e.y,z:e.z,aura:e.aura||0,v:-1});const p=n.filter(function(e){return e.aura>0});i.forEach(function(e){e.seen=!1}),a.forEach(function(e){e.seen=!1}),l=0;for(const e of n){let f=0;for(const r of p)r.aura>f&&Math.hypot(r.x-e.x,r.z-e.z)<=k&&(f=r.aura);if(e.key==="self"&&(l=f),e.aura>0){const r=v(e.key);r&&r.fx.points.position.set(e.x,e.y-x,e.z)}if(f>0&&!h){const r=A(e.key,e),E=e.v>=0?e.v:Math.hypot(e.x-r.last.x,e.z-r.last.z)/t;r.last.x=e.x,r.last.z=e.z,r.origin.x=e.x,r.origin.y=e.y-x+.35,r.origin.z=e.z,r.o.rate=E>F?R:0}}i.forEach(function(e,f){if(!e.seen){c.remove(e.fx.points),e.fx.dispose(),i.delete(f);return}e.fx.update(t)}),a.forEach(function(e,f){e.idle=e.seen?0:(e.idle||0)+t,e.seen||(e.o.rate=0),e.emitter.update(t),e.idle>1&&(c.remove(e.emitter.points),e.emitter.dispose(),a.delete(f))})},speedMul:function(){return 1+l},probe:function(){return{boost:l,carriers:Array.from(i.keys()),trails:Array.from(a.keys())}},dispose:function(){y=!0,i.forEach(function(o){c.remove(o.fx.points),o.fx.dispose()}),a.forEach(function(o){c.remove(o.emitter.points),o.emitter.dispose()}),i.clear(),a.clear()}}}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.