Fix #36630, Particlesystem - boids - goal - collision.
[blender.git] / source / blender / blenkernel / intern / particle_system.c
index db22e0308213f7befb1579905c1456984fbf8b83..526d54a97fa197c60bc2876b34a00e61cce68ea8 100644 (file)
@@ -3313,9 +3313,14 @@ static float collision_newton_rhapson(ParticleCollision *col, float radius, Part
 
        pce->inv_nor = -1;
 
-       /* Initial step size should be small, but not too small or floating point
-        * precision errors will appear. - z0r */
-       dt_init = COLLISION_INIT_STEP * col->inv_total_time;
+       if (col->inv_total_time > 0.0f) {
+               /* Initial step size should be small, but not too small or floating point
+                * precision errors will appear. - z0r */
+               dt_init = COLLISION_INIT_STEP * col->inv_total_time;
+       }
+       else {
+               dt_init = 0.001f;
+       }
 
        /* start from the beginning */
        t0 = 0.f;