fix: player physics when chunks reload
This commit is contained in:
parent
a57f8f41bb
commit
5870981933
@ -22,12 +22,12 @@ LevelController::LevelController(EngineSettings& settings, std::unique_ptr<Level
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LevelController::update(float delta, bool input, bool pause) {
|
void LevelController::update(float delta, bool input, bool pause) {
|
||||||
player->update(delta, input, pause);
|
|
||||||
glm::vec3 position = player->getPlayer()->hitbox->position;
|
glm::vec3 position = player->getPlayer()->hitbox->position;
|
||||||
level->loadMatrix(position.x, position.z,
|
level->loadMatrix(position.x, position.z,
|
||||||
settings.chunks.loadDistance.get() +
|
settings.chunks.loadDistance.get() +
|
||||||
settings.chunks.padding.get() * 2);
|
settings.chunks.padding.get() * 2);
|
||||||
chunks->update(settings.chunks.loadSpeed.get());
|
chunks->update(settings.chunks.loadSpeed.get());
|
||||||
|
player->update(delta, input, pause);
|
||||||
|
|
||||||
// erease null pointers
|
// erease null pointers
|
||||||
level->objects.erase(
|
level->objects.erase(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user