File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -850,9 +850,21 @@ class HomeCanvas extends Base {
850850 buffer [ idx + 2 ] *= 0.95 ; // Friction
851851 buffer [ idx + 3 ] *= 0.95 ;
852852
853- let drift = isParent ? 0.02 : 0.01 ;
854- if ( Math . abs ( buffer [ idx + 2 ] ) < 0.2 ) buffer [ idx + 2 ] += ( Math . random ( ) - 0.5 ) * drift ;
855- if ( Math . abs ( buffer [ idx + 3 ] ) < 0.2 ) buffer [ idx + 3 ] += ( Math . random ( ) - 0.5 ) * drift ;
853+ // 4. Ambient Drift / Flow Field
854+ if ( isParent ) {
855+ // FLOW FIELD for Parents: Create organic currents
856+ // Combine Sine/Cosine based on position and time
857+ let angle = ( Math . cos ( buffer [ idx ] * 0.002 + me . time * 0.5 ) +
858+ Math . sin ( buffer [ idx + 1 ] * 0.002 + me . time * 0.5 ) ) * Math . PI ;
859+
860+ // Accelerate in flow direction
861+ buffer [ idx + 2 ] += Math . cos ( angle ) * 0.05 ;
862+ buffer [ idx + 3 ] += Math . sin ( angle ) * 0.05 ;
863+ } else {
864+ // Random wander for children
865+ if ( Math . abs ( buffer [ idx + 2 ] ) < 0.2 ) buffer [ idx + 2 ] += ( Math . random ( ) - 0.5 ) * 0.02 ;
866+ if ( Math . abs ( buffer [ idx + 3 ] ) < 0.2 ) buffer [ idx + 3 ] += ( Math . random ( ) - 0.5 ) * 0.02 ;
867+ }
856868
857869 buffer [ idx ] += buffer [ idx + 2 ] ;
858870 buffer [ idx + 1 ] += buffer [ idx + 3 ] ;
You can’t perform that action at this time.
0 commit comments