1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37662],{37662:(e,r,t)=>{t.r(r),t.d(r,{useCollisionGame:()=>a});var u=t(12115),n=t(94741),l=t(44466),c=t(81921);function a(){let e=(0,u.useRef)(null),r=(0,u.useRef)(null),{particles:t,container:a,currentTime:s,mode:i,particleCount:C,totalMomentum:o,setParticleCount:f,setTotalMomentum:k,setContainer:b}=(0,l.useSimulationStore)(),d=(0,u.useCallback)(()=>{},[]);(0,u.useEffect)(()=>{let r={width:c.CANVAS_CONFIG.WIDTH,height:c.CANVAS_CONFIG.HEIGHT};return e.current=new n.SimulationAdapter(r),b(r),e.current.setUpdateCallback(d),()=>{e.current&&(e.current.dispose(),e.current=null)}},[b,d]),(0,u.useEffect)(()=>{let t=r.current;if(!t||!e.current)return;e.current.initializeRenderer(t);let u=l.useSimulationStore.getState().particleCount;u>0&&e.current.generateParticles(u)},[]);let p=(0,u.useCallback)(function(){let r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e.current&&e.current.render(r)},[]),S=(0,u.useCallback)(()=>{e.current&&e.current.generateParticles(C)},[C]),h=(0,u.useCallback)(()=>{e.current&&e.current.start()},[]),N=(0,u.useCallback)(()=>{e.current&&e.current.stop()},[]);return{particles:t,container:a,currentTime:s,mode:i,particleCount:C,totalMomentum:o,canvasRef:r,adapterRef:e,generateParticles:S,startSimulation:h,stopSimulation:N,render:p,setParticleCount:f,setTotalMomentum:k}}}}]);
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.