/** Bubble size category affecting behavior and visuals */ export type BubbleSize = "small" | "medium" | "large"; /** Trail particle from bubble motion */ export interface BubbleTrailParticle { x: number; y: number; age: number; size: number; } /** * Enhanced Bubble with physics, iridescence, and visual depth */ export interface Bubble { x: number; y: number; startY: number; depth: number; radius: number; sizeCategory: BubbleSize; speed: number; baseSpeed: number; acceleration: number; sway: number; swayOffset: number; turbulenceX: number; turbulencePhase: number; wobblePhase: number; wobbleAmplitude: number; wobbleSpeed: number; opacity: number; baseOpacity: number; iridescentPhase: number; iridescentSpeed: number; rimHighlightAngle: number; trailParticles: BubbleTrailParticle[]; lastTrailSpawn: number; clusterId?: number; clusterOffset?: { x: number; y: number; }; age: number; fadeZone: number; } export type MarineLifeType = "fish" | "jellyfish"; interface MarineLifeBase { type: MarineLifeType; x: number; y: number; opacity: number; animationPhase: number; } /** Depth layer for parallax effect */ export type DepthLayer = "far" | "mid" | "near"; /** Fish behavior state */ export type FishBehavior = "cruising" | "turning" | "darting" | "schooling" | "passing" | "ascending" | "descending" | "approaching" | "receding" | "fleeing" | "stalking" | "chasing"; /** Fish species with different body shapes and characteristics */ export type FishSpecies = "tropical" | "sleek" | "deep" | "schooling"; /** Fin state with physics */ export interface FinState { angle: number; velocity: number; targetAngle: number; length: number; width: number; segments: number; } /** Tail fin state (more complex - forked/fan) */ export interface TailState extends FinState { forkAngle: number; forkDepth: number; wavePhase: number; waveAmplitude: number; } /** Fish color palette */ export interface FishColorPalette { bodyTop: string; bodyBottom: string; accent: string; eye: string; finTint: string; } /** Wake trail particle */ export interface WakeParticle { x: number; y: number; age: number; size: number; opacity: number; } /** Species-specific spine configuration */ export interface SpineConfig { jointCount: number; widthProfile: number[]; angleConstraint: number; segmentLength: number; } /** Fin attached to spine segment */ export interface SpineFin { attachmentSegment: number; attachmentSide: "top" | "bottom" | "left" | "right"; baseAngle: number; length: number; width: number; segments: number; curvatureResponse: number; } /** Spine-chain fish configuration */ export declare const SPINE_CONFIGS: Record; /** Species-specific swimming parameters */ export declare const SWIM_PARAMS: Record; /** * Procedural Fish with anatomical detail * * Supports two rendering modes: * 1. Legacy: Static bezier curves + sine wave body flex (useSpineChain = false) * 2. Spine-chain: Dynamic joint-based body (useSpineChain = true) * * The spine-chain approach creates more organic movement where * each body segment follows the one ahead. */ export interface FishMarineLife extends MarineLifeBase { type: "fish"; species: FishSpecies; colors: FishColorPalette; bodyLength: number; bodyHeight: number; bodyAspect: number; direction: 1 | -1; speed: number; baseSpeed: number; verticalDrift: number; bobAmplitude: number; bobSpeed: number; depthBand: { min: number; max: number; }; baseY: number; depthLayer: DepthLayer; depthScale: number; /** Continuous depth position: 0 = close/large, 1 = far/small */ z: number; /** Target depth for smooth transitions via lerp */ targetZ: number; /** Target Y position for vertical movement behaviors */ targetY?: number; behavior: FishBehavior; behaviorTimer: number; targetDirection?: 1 | -1; dartSpeed?: number; /** * Vertical speed (px/s) sampled ONCE when ascending/descending begins, then * reused every frame. Sampling per-frame produced uncorrelated jitter. */ verticalSpeed?: number; /** Smoothed actual horizontal speed target (px/s). Behaviors set this; the * controller eases `speed` toward it each frame. */ targetSpeed: number; /** Continuous heading factor (-1..1), eased on turns instead of flipping. */ headingFactor: number; /** Remaining flee panic time (s); >0 means actively fleeing the cursor. */ fleeTimer: number; /** Current flee intensity 0..1 for visual + speed scaling. */ fleeIntensity: number; schoolId?: number; leaderOffset?: { x: number; y: number; }; rotation: number; bodyFlexPhase: number; bodyFlexAmount: number; dorsalFin: FinState; pectoralFinTop: FinState; pectoralFinBottom: FinState; pelvicFin: FinState; analFin: FinState; tailFin: TailState; scalePhase: number; scaleSpeed: number; eyeSize: number; gillPhase: number; gillSpeed: number; hasBioluminescence: boolean; glowPhase: number; glowIntensity: number; wakeTrail: WakeParticle[]; lastWakeSpawn: number; /** Whether this fish uses spine-chain animation (vs legacy bezier) */ useSpineChain?: boolean; /** * Spine joint positions - array of {x, y, angle, width} objects * Populated when useSpineChain is true * Import SpineChain class to manipulate this */ spineJoints?: Array<{ x: number; y: number; angle: number; width: number; segmentLength: number; }>; /** Spine configuration reference */ spineConfig?: SpineConfig; /** Current swimming phase for tail oscillation */ swimPhase?: number; /** Tail oscillation amplitude (pixels) */ tailAmplitude?: number; /** Swimming speed multiplier for undulation */ swimSpeed?: number; /** Fins attached to spine (replaces individual fin states when using spine) */ spineFins?: SpineFin[]; /** * Individual personality traits (0-1 for each) * Generated at spawn, influences behavior throughout lifetime */ personality?: { boldness: number; sociability: number; activity: number; curiosity: number; }; /** * Current emotional state * Affects behavior decisions and visual expression */ mood?: "calm" | "curious" | "alert" | "playful" | "hungry" | "tired" | "social"; /** Time spent in current mood (for decay calculations) */ moodTimer?: number; /** Time since last interesting stimulus */ lastStimulusTime?: number; /** Current energy level (0-1), affects speed and rest behavior */ energy?: number; /** Current hunger level (0-1), drives feeding behavior */ hunger?: number; /** Current wobble animation for expression */ wobbleType?: "none" | "curious_tilt" | "startled_dart" | "playful_wiggle" | "tired_drift" | "feeding_lunge" | "social_shimmer" | "barrel_roll" | "freeze" | "double_take" | "happy_flip" | "sync_pulse"; /** Frames remaining in current wobble */ wobbleTimer?: number; /** Current wobble intensity (0-1, decays) */ wobbleIntensity?: number; /** Target point for behaviors (feeding, exploring) */ behaviorTarget?: { x: number; y: number; }; /** What the fish is "looking at" */ focusPoint?: { x: number; y: number; }; /** * Preferred vertical position within depth band (0 = top, 1 = bottom) * Set at spawn based on species, influences behavioral drift */ preferredVerticalPosition?: number; /** * Home zone - rough area where fish spawned * Fish have a slight tendency to drift back toward this zone */ homeZone?: { x: number; y: number; /** How strongly fish is drawn back (0-1) */ affinity: number; }; /** * Social memory - IDs of fish this fish has interacted with * Used for recognizing "friends" and triggering sync behaviors */ socialMemory?: Set; /** * Last interaction time - prevents interaction spam */ lastInteractionTime?: number; /** * Unique ID for social memory tracking */ fishId?: number; /** * Hunt state for predators (sleek, deep) */ huntState?: "idle" | "stalking" | "chasing" | "cooldown"; /** * ID of fish being hunted (for predators) */ huntingTarget?: number; /** * Time since hunt started (for chase duration limits) */ huntStartTime?: number; /** * Cooldown end time (animation time when can hunt again) */ huntCooldownEnd?: number; /** * Whether this fish is currently being hunted (for prey) */ isBeingHunted?: boolean; /** * ID of predator chasing this fish (for flee direction) */ hunterId?: number; width: number; height: number; tailPhase: number; } /** Tentacle segment for fluid physics simulation */ export interface TentacleSegment { /** Angle offset from parent segment */ angle: number; /** Length of this segment */ length: number; /** Current velocity for physics */ velocity: number; /** Phase offset for wave animation */ phase: number; } /** Individual tentacle with multiple segments */ export interface Tentacle { /** Starting X offset from bell center (as fraction of bell width) */ originX: number; /** Segments making up this tentacle */ segments: TentacleSegment[]; /** Base thickness at origin */ thickness: number; /** Opacity multiplier */ opacity: number; } /** Oral arm (thick inner tentacle near mouth) */ export interface OralArm { /** Starting angle from center */ angle: number; /** Length as fraction of bell size */ length: number; /** Thickness as fraction of bell size */ thickness: number; /** Wave phase offset */ phase: number; } /** Jellyfish species with different visual characteristics */ export type JellyfishSpecies = "moon" | "crystal" | "lionsMane" | "phantom"; /** Gonad configuration for internal anatomy */ export interface GonadConfig { /** Number of lobes (typically 4 for moon jellyfish) */ lobeCount: number; /** Size relative to bell */ size: number; /** Rotation offset */ rotation: number; /** Color (usually matches accent) */ color: string; } export interface JellyfishMarineLife extends MarineLifeBase { type: "jellyfish"; /** Species determines visual characteristics */ species: JellyfishSpecies; /** Base size (bell diameter at rest) */ size: number; /** Primary color */ color: string; /** Secondary/accent color for glow */ accentColor: string; /** Tertiary color for details */ detailColor: string; /** Horizontal drift speed */ horizontalSpeed: number; /** Vertical speed (affected by pulse) */ verticalSpeed: number; /** Base vertical position */ baseY: number; /** Continuous depth position for parallax effect */ depth: number; /** Current pulse phase (0-1, 0=relaxed, 0.5=contracted) */ pulsePhase: number; /** Pulse speed (cycles per second) */ pulseSpeed: number; /** Bell height-to-width ratio (affects dome shape) */ bellAspect: number; /** Number of margin frills */ frillCount: number; /** Frill wave phase */ frillPhase: number; /** Bell deformation seeds for asymmetric pulse */ bellDeformSeeds: number[]; /** Number of radial channels visible */ radialChannels: number; /** Oral arms (thick inner tentacles) */ oralArms: OralArm[]; /** Gonad configuration (internal organs) */ gonads: GonadConfig | null; /** Mesoglea vein seeds for internal texture */ mesogleaSeeds: number[]; /** Main trailing tentacles with physics */ tentacles: Tentacle[]; /** Current glow intensity (0-1) */ glowIntensity: number; /** Glow pulse phase (traveling wave) */ glowPhase: number; /** Glow pulse speed */ glowSpeed: number; /** * Seconds remaining on the tap-flash. >0 means the bell is lit from within and * the jelly is jetting upward (startle). Decays toward 0 each frame. */ flashTimer: number; /** * Hover affordance (0-1). Eases toward 1 while the pointer rests inside the * bell's poke radius and back to 0 when it leaves — a gentle "I'm alive, * poke me" shimmer, deliberately far subtler than the tap-flash startle * (no jet, no chime, small brightness lift only). */ hoverGlow: number; /** Recent positions for particle spawning */ trailPositions: { x: number; y: number; age: number; }[]; /** @deprecated Use tentacles array instead */ tentacleSeeds: number[]; /** @deprecated Use pulsePhase instead */ waveAmplitude: number; /** @deprecated Use pulseSpeed instead */ waveFrequency: number; } export interface OceanParticle { x: number; y: number; vx: number; vy: number; size: number; opacity: number; color: string; life: number; maxLife: number; /** * Per-particle brightness factor (0.15..0.40 range) sampled ONCE at creation. * Reused in the per-frame fade so opacity doesn't twitch every frame. */ brightness: number; } export interface MarineLifeSpawn { type: MarineLifeType; spawnTime: number; } /** Dust particle visible in light beam */ export interface LightDustParticle { x: number; y: number; size: number; opacity: number; drift: number; phase: number; } /** * Enhanced Light Ray from surface * * Volumetric god rays with wave distortion, color shifting, * dappled edges, and visible dust particles */ export interface LightRay { x: number; baseX: number; width: number; baseWidth: number; angle: number; wavePhase: number; waveAmplitude: number; waveSpeed: number; opacity: number; baseOpacity: number; intensityPhase: number; intensitySpeed: number; phase: number; speed: number; glowIntensity: number; depthFade: number; colorShiftPhase: number; colorShiftSpeed: number; edgeSeeds: number[]; dustParticles: LightDustParticle[]; } /** Caustic pattern cell for underwater light effect */ export interface CausticCell { x: number; y: number; size: number; intensity: number; phase: number; speed: number; } /** Caustic pattern state */ export interface CausticsState { cells: CausticCell[]; globalPhase: number; driftX: number; driftY: number; } /** Distant bioluminescent glow spot */ export interface DistantGlow { x: number; y: number; size: number; intensity: number; phase: number; speed: number; color: string; } /** Depth fog layer */ export interface FogLayer { y: number; opacity: number; phase: number; speed: number; } /** * Gradient animation state */ export interface GradientState { breathingPhase: number; breathingSpeed: number; fogLayers: FogLayer[]; distantGlows: DistantGlow[]; vignetteIntensity: number; } export interface OceanState { bubbles: Bubble[]; fish: FishMarineLife[]; jellyfish: JellyfishMarineLife[]; particles: OceanParticle[]; currentGradient: { top: string; bottom: string; }; lightRays: LightRay[]; caustics: CausticsState | null; gradientState: GradientState | null; pendingFishSpawns: number[]; schools: Map; } /** @deprecated Use fish + jellyfish arrays separately */ export type MarineLife = FishMarineLife | JellyfishMarineLife; export {}; //# sourceMappingURL=OceanModels.d.ts.map