diff options
| author | Stanislaw Skowronek <skylark@disorder.sko> | 2013-11-17 00:48:15 (GMT) |
|---|---|---|
| committer | Stanislaw Skowronek <skylark@disorder.sko> | 2013-11-17 00:48:15 (GMT) |
| commit | 65d9d794d9aca3159a59fdc867ee422087e11306 (patch) | |
| tree | 1f21a9d9a121dc319d1564b43f16e4fb5c494f4a | |
| parent | 3bc1d3cfaf9523041a15677dba4bcc39c56cb337 (diff) | |
| download | powder-65d9d794d9aca3159a59fdc867ee422087e11306.zip powder-65d9d794d9aca3159a59fdc867ee422087e11306.tar.gz | |
Fix the one particle bug.
| -rw-r--r-- | src/simulation/Simulation.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 1cb83a9..eb8f065 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -5069,7 +5069,10 @@ void Simulation::update_solids() } if(sld->an) { - sld->vrot = atanf(sld->arot / av); + if(av > 0.0001f) + sld->vrot = atanf(sld->arot / av); + else + sld->vrot = 0.0f; #ifdef DEBUG_SOLID printf("Solid %d: count %d, vx %f, vy %f, vrot %f, b %d/%d, cdx %f, cdy %f\n", i, sld->an, sld->vx, sld->vy, sld->vrot, sld->bf, bd, sld->cdx, sld->cdy); if(sld->bf) { |
