import { segmentHexHit } from './path-math.js'; // Approach, readable contact pause, recoil. Used by both browser and Cocos. export function collisionPhase(progress, reduced=false){ const t=Math.max(0,Math.min(1,progress)); const distance=t<.42?1-Math.pow(1-t/.42,2):t<.64?1:Math.pow(1-(t-.64)/.36,2); const impact=t>=.42&&t<.72?Math.sin((t-.42)/.30*Math.PI):0; return {distance,impact,kick:reduced?0:Math.sin(Math.max(0,t-.42)/.58*Math.PI)*Math.exp(-Math.max(0,t-.42)*2)}; } // Stop the drawn silhouette at first contact, avoiding visible overlap from collider tolerance. export function contactPath(points,blocker,radius){ if(!blocker)return points; for(let i=1;i