mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
refactor Entities load + loading velocity
This commit is contained in:
parent
3cd0261f3b
commit
19c6a82ab2
6 changed files with 41 additions and 24 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue