feat: players interpolation & add hud.set_allow_pause(...)

This commit is contained in:
MihailRis
2025-01-17 01:44:46 +03:00
parent 036e13a2ca
commit 2fa71b3bf0
25 changed files with 232 additions and 41 deletions
+6 -1
View File
@@ -12,6 +12,7 @@
#include "window/Camera.hpp"
#include "objects/Player.hpp"
#include "objects/Players.hpp"
#include "objects/Entities.hpp"
#include "logic/LevelController.hpp"
#include "util/stringutil.hpp"
#include "engine/Engine.hpp"
@@ -159,7 +160,11 @@ void Decorator::update(float delta, const Camera& camera) {
renderer.texts->remove(textsIter->second);
textsIter = playerTexts.erase(textsIter);
} else {
note->setPosition(player->getPosition() + glm::vec3(0, 1, 0));
glm::vec3 position = player->getPosition();
if (auto entity = level.entities->get(player->getEntity())) {
position = entity->getInterpolatedPosition();
}
note->setPosition(position + glm::vec3(0, 1, 0));
++textsIter;
}
}