refactor Entities load + loading velocity

This commit is contained in:
MihailRis
2024-07-08 22:47:01 +03:00
parent 3cd0261f3b
commit 19c6a82ab2
6 changed files with 40 additions and 23 deletions
+1 -3
View File
@@ -42,9 +42,7 @@ Player::~Player() {
void Player::updateEntity() {
if (eid == 0) {
auto& def = level->content->entities.require("base:player");
eid = level->entities->spawn(def, Transform {
getPosition(), glm::vec3(1.0f), glm::mat3(1.0f), {}, true
});
eid = level->entities->spawn(def, getPosition());
} else if (auto entity = level->entities->get(eid)) {
position = entity->getTransform().pos;
} else {