Commit Graph
4 Commits
Author SHA1 Message Date
kamilkrzywda a1fd66d039 fix: per-species scale correction for skinned mesh fish
Box3.setFromObject measures skinned geometry in skeleton space (and may
use a stale cached bounding box), which does not match the GPU's actual
rendered extent (mesh.matrixWorld * skinning * position). Add a
per-species baseScale correction factor (rendered / box3) to FishSpec and
fold it into buildFish's scale calc so each GLB normalizes to its true
size.

Measured per GLB with three.js's exact skinning formula: most models
are 1.0. The skinned blendswap oscar (1.35) and knifefish (2.58) deviate
and are corrected. The clownfish GLB is a full scene (water 'Surface'
45.3, 'TopLight' 15, 'Bubbles' 3.4) plus a small skinned body (~8.3);
box3 is dominated by the water plane, so a baseScale can't fix it without
blowing up the scene geometry - left at 1.0 pending a clean re-export.
2026-10-07 15:19:16 +00:00
kamilkrzywda 6a4614e276 feat: dynamic fish add/remove, genetics visualization, full game loop (#13-#19)
- GLTFish: dynamic addFish/removeFish with fade, model caching, genetics applied
  (color hue/saturation shift, rarity emissive glow on fish meshes)
- Buy: spawns fish in 3D scene with random genetics + rarity roll
- Sell: fades out fish, removes from scene, credits money
- Breed: 1-3 babies with blended genetics + mutation, 60s cooldown
- Tank upgrade: resizes bounds, moves camera, updates capacity
- Fish growth: age-based value multiplier (baby/juvenile/adult)
- Full game loop: earn → breed for rarity → sell for profit → upgrade tank
2026-10-07 12:41:05 +00:00
kamilkrzywda c7427f9c61 feat: bubbles, food pellets & fish feeding behavior
- Bubbles.ts: rising bubble particles from 2 air stones (near plants),
  wobble + growth + fade near surface, 50-mesh pool
- Food.ts: auto-dropping food pellets (every 6-14s, 3-6 pieces) that
  float down and settle on the floor; manual drop via click
- GLTFish.ts: fish now notice food within 1.2 units, seek at 1.4x speed
  with faster turn rate, eat pellets within 0.15 units; faster tail beat
  while chasing
- main.ts: wires food + bubbles into render loop; click drops 4 pellets
2026-10-07 11:49:10 +00:00
kamilkrzywda 4893ee2f8c feat: replace procedural fish with GLB 3D models + tank decor
- 6 tropical fish (angelfish x2, goldfish x2, guppy x2) from maya's-aquarium-3d
- 4 Quaternius cute fish (Fish1 x2, Fish2, Fish3) with swim animations
- 2 plants + 3 rocks on the gravel floor
- Wandering AI with frame-rate-independent smoothing
- Quaternius fish rotated to match local +X forward axis
- .gitignore: add .env
2026-10-07 11:45:39 +00:00