selection normal vector debug

This commit is contained in:
MihailRis
2023-11-30 15:04:20 +03:00
parent 0c35eeb072
commit cee0214ac5
5 changed files with 17 additions and 1 deletions
+5
View File
@@ -107,6 +107,8 @@ void CameraControl::update(PlayerInput& input, float delta) {
}
vec3 PlayerController::selectedBlockPosition;
vec3 PlayerController::selectedPointPosition;
vec3 PlayerController::selectedBlockNormal;
int PlayerController::selectedBlockId = -1;
PlayerController::PlayerController(Level* level, const EngineSettings& settings)
@@ -179,6 +181,7 @@ void PlayerController::updateControls(float delta){
player->update(level, input, delta);
}
#include <iostream>
void PlayerController::updateInteraction(){
auto contentIds = level->content->indices;
Chunks* chunks = level->chunks;
@@ -206,6 +209,8 @@ void PlayerController::updateInteraction(){
player->selectedVoxel = *vox;
selectedBlockId = vox->id;
selectedBlockPosition = iend;
selectedPointPosition = end;
selectedBlockNormal = norm;
int x = (int)iend.x;
int y = (int)iend.y;
int z = (int)iend.z;