Engine core and assets loading refactor

This commit is contained in:
MihailRis
2023-10-30 15:19:58 +03:00
committed by GitHub
parent 972db16a0c
commit 0576316282
10 changed files with 325 additions and 181 deletions
+15
View File
@@ -1,8 +1,10 @@
#include "Level.h"
#include "World.h"
#include "../lighting/Lighting.h"
#include "../voxels/Chunks.h"
#include "../voxels/ChunksController.h"
#include "../player_control.h"
#include "../physics/Hitbox.h"
#include "../physics/PhysicsSolver.h"
#include "../objects/Player.h"
@@ -24,3 +26,16 @@ Level::~Level(){
delete chunksController;
delete playerController;
}
void Level::update(float delta, bool interactions) {
playerController->update_controls(delta);
if (interactions) {
playerController->update_interaction();
}
else
{
playerController->selectedBlockId = -1;
}
vec3 position = player->hitbox->position;
chunks->setCenter(world->wfile, position.x, position.z);
}