File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export function computeVelocities(
8181 const diff = subtract ( selfPosition , otherPosition ) ;
8282 const distance = length ( diff ) ;
8383
84- const isInFieldOfView = dot ( normalize ( selfVelocity ) , normalize ( subtract ( otherPosition , selfPosition ) ) ) > 0.5 ;
84+ const isInFieldOfView = dot ( normalize ( selfVelocity ) , normalize ( subtract ( otherPosition , selfPosition ) ) ) > 0 ;
8585
8686 if ( isInFieldOfView && ( ! skipFirst || i > 0 ) ) {
8787 // Alignment - align with the direction of other boids
@@ -120,7 +120,7 @@ export function computeVelocities(
120120
121121 // Keep boids within bounds
122122 const distToCenter = length ( selfPosition ) ;
123- acceleration = add ( acceleration , scale ( selfPosition , - distToCenter * 0.0003 ) ) ;
123+ acceleration = add ( acceleration , scale ( selfPosition , - distToCenter * 0.0004 ) ) ;
124124
125125 velocity = add ( velocity , scale ( acceleration , deltaTime ) ) ;
126126
You can’t perform that action at this time.
0 commit comments