limit indefinite r-tree growth
This commit is contained in:
parent
4d31e6bf48
commit
721ffeb765
1 changed files with 12 additions and 6 deletions
|
@ -258,20 +258,26 @@ fn process_turtle_update(
|
||||||
turtle.position.0 += turtle.queued_movement;
|
turtle.position.0 += turtle.queued_movement;
|
||||||
}
|
}
|
||||||
|
|
||||||
world.insert(Block {
|
let above = Block {
|
||||||
name: update.above,
|
name: update.above,
|
||||||
pos: turtle.position.0 + Vec3::y(),
|
pos: turtle.position.0 + Vec3::y(),
|
||||||
});
|
};
|
||||||
|
world.remove_at_point(&above.pos.into());
|
||||||
|
world.insert(above);
|
||||||
|
|
||||||
world.insert(Block {
|
let ahead = Block {
|
||||||
name: update.ahead,
|
name: update.ahead,
|
||||||
pos: turtle.position.0 + turtle.position.1.clone().unit(),
|
pos: turtle.position.0 + turtle.position.1.clone().unit(),
|
||||||
});
|
};
|
||||||
|
world.remove_at_point(&ahead.pos.into());
|
||||||
|
world.insert(ahead);
|
||||||
|
|
||||||
world.insert(Block {
|
let below = Block {
|
||||||
name: update.below,
|
name: update.below,
|
||||||
pos: turtle.position.0 - Vec3::y(),
|
pos: turtle.position.0 - Vec3::y(),
|
||||||
});
|
};
|
||||||
|
world.remove_at_point(&below.pos.into());
|
||||||
|
world.insert(below);
|
||||||
|
|
||||||
turtle.queued_movement = turtle.position.1.clone().unit();
|
turtle.queued_movement = turtle.position.1.clone().unit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue