import { LeviarObject } from '../LeviarObject.js'; import type { LeviarObjectOptions } from '../types.js'; import type { ParticleClip, ParticleManager } from '../ParticleManager.js'; import type { PhysicsEngine } from '../PhysicsEngine.js'; import Matter from 'matter-js'; export interface ParticleAttribute { src?: string; /** * true이면 matter-js 기반 물리를 각 파티클 인스턴스에 적용합니다. * false(기본)이면 내부 velocity 시뮬레이션을 사용합니다. */ strictPhysics?: boolean; } export interface ParticleOptions = Record> extends LeviarObjectOptions { } export interface ParticleInstance { /** 에미터 기준 초기 스폰 x 오프셋 (px) */ spawnX: number; /** 에미터 기준 초기 스폰 y 오프셋 (px) */ spawnY: number; /** 에미터 기준 초기 스폰 z 오프셋 (px) */ spawnZ: number; /** 에미터 기준 현재 x 좌표 (px) — tick마다 갱신 */ x: number; /** 에미터 기준 현재 y 좌표 (px) — tick마다 갱신 */ y: number; /** 에미터 기준 현재 z 좌표 (px) — tick마다 갱신 */ z: number; /** x 방향 속도 (px/ms) */ vx: number; /** y 방향 속도 (px/ms) */ vy: number; /** z 방향 속도 (px/ms) */ vz: number; /** 크기 궤적 (보간용) */ sizes: number[]; /** 투명도 궤적 (보간용) */ opacities: number[]; /** 생성 timestamp */ born: number; /** 생존 시간 (ms) */ lifespan: number; /** 현재 회전각 (rad) — 매 tick 갱신 */ angle: number; /** 각속도 (rad/ms) — 스폰 시 결정 */ angularVelocity: number; /** strict 모드 전용 matter-js 바디 */ body?: Matter.Body; /** 가상 물리(strict=false) 누적 연산용 마지막 갱신 시간 */ lastTick?: number; } export declare class Particle = Record> extends LeviarObject { private manager; private clipName; __clip: ParticleClip | null; /** 생성자 시점에 __manager가 없어서 보류된 src 값 */ private pendingSrc; /** 활성 파티클 인스턴스 목록 (Renderer에서 직접 참조) */ __instances: ParticleInstance[]; private playing; private lastSpawnTime; private spawnCount; /** PhysicsEngine 참조 (strict 모드 전용) */ private physics; /** 일시정지 여부 */ private paused; private static readonly DELEGATED_GETTERS; private static readonly DELEGATED_SETTERS; constructor(options?: ParticleOptions); /** * ParticleManager를 연결합니다. */ __setManager(manager: ParticleManager): this; /** * PhysicsEngine을 연결합니다. strict=true 시 필요합니다. */ __setPhysics(physics: PhysicsEngine): this; /** * 파티클 에미션을 시작합니다. */ play(): this; /** * 파티클 에미션을 일시정지합니다. */ pause(): this; /** * 파티클 에미션을 정지합니다. 이미 생성된 인스턴스는 lifespan까지 유지됩니다. */ stop(): this; /** * Renderer에서 매 프레임 호출합니다. * 인스턴스 생성/업데이트/제거를 처리합니다. */ __tick(timestamp: number): void; private _spawn; private _removeInstanceBody; protected _getDelegatedAttribute(key: string): any; protected _setDelegatedAttribute(key: string, value: any): void; }