mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
Engine core and assets loading refactor
This commit is contained in:
parent
972db16a0c
commit
0576316282
10 changed files with 325 additions and 181 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue