Engine core and assets loading refactor
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user