Преглед изворни кода

fix webgl_gpgpu_birds_gltf cohesion 0 error

gonnavis пре 4 година
родитељ
комит
16b1e65939
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      examples/webgl_gpgpu_birds_gltf.html

+ 1 - 0
examples/webgl_gpgpu_birds_gltf.html

@@ -179,6 +179,7 @@
 
 							// Attraction / Cohesion - move closer
 							float threshDelta = 1.0 - alignmentThresh;
+							threshDelta = max( threshDelta, 1e-6 );
 							float adjustedPercent = ( percent - alignmentThresh ) / threshDelta;
 
 							f = ( 0.5 - ( cos( adjustedPercent * PI_2 ) * -0.5 + 0.5 ) ) * delta;