rogueviz::flocking:: do not try large steps even if delta way too big

This commit is contained in:
Zeno Rogue 2019-04-21 20:45:15 +02:00
parent 2c40216e06
commit 0509c82b54
1 changed files with 3 additions and 1 deletions

View File

@ -99,8 +99,10 @@ namespace flocking {
int precision = 10;
void simulate(int delta) {
while(delta > precision && delta < 100 * precision) {
int iter = 0;
while(delta > precision && iter < 100) {
simulate(precision); delta -= precision;
iter++;
}
ld d = delta / 1000.;
using namespace hyperpoint_vec;