This commit is contained in:
Andras Schmelczer 2026-05-18 08:11:52 +01:00
commit 15e99380b5
84 changed files with 1659 additions and 4726 deletions

View file

@ -1,5 +1,6 @@
import { appConfig } from '../config';
import { AGENT_FLOAT_COUNT } from '../pipelines/agents/agent-generation/agent';
import { AGENT_FLOAT_COUNT } from '../pipelines/agents/agent-generation/agent-generation-pipeline';
import { clamp, easeOutQuad, mix, mixAngle, smoothstep } from '../utils/math';
interface IntroTitlePoint {
x: number;
@ -398,19 +399,6 @@ const createSeededRandom = (seed: number): RandomSource => {
};
};
const mix = (from: number, to: number, amount: number): number =>
from + (to - from) * amount;
const mixAngle = (from: number, to: number, amount: number): number => {
const delta = Math.atan2(Math.sin(to - from), Math.cos(to - from));
return from + delta * amount;
};
const smoothstep = (edge0: number, edge1: number, value: number): number => {
const t = clamp((value - edge0) / (edge1 - edge0), 0, 1);
return t * t * (3 - 2 * t);
};
const easePathProgress = (amount: number): number => {
if (appConfig.simulation.intro.pathEasing === 'linear') {
return amount;
@ -418,10 +406,3 @@ const easePathProgress = (amount: number): number => {
return easeOutQuad(amount);
};
const easeOutQuad = (value: number): number => value * (2 - value);
const clamp = (value: number, min: number, max: number): number => {
const safeValue = Number.isFinite(value) ? value : min;
return Math.min(max, Math.max(min, safeValue));
};