WorldRenderer and HudRenderer classes

This commit is contained in:
MihailRis
2022-10-01 15:59:57 +03:00
parent 5955c74208
commit d3f29f8ace
8 changed files with 43 additions and 216 deletions
+2 -2
View File
@@ -179,9 +179,9 @@ void update_interaction(Level* level, LineBatch* lineBatch){
vec3 iend;
voxel* vox = chunks->rayCast(camera->position, camera->front, 10.0f, end, norm, iend);
if (vox != nullptr){
if (Block::blocks[vox->id]->type == 1){
if (Block::blocks[vox->id]->model == 1){
lineBatch->box(iend.x+0.5f, iend.y+0.5f, iend.z+0.5f, 1.005f,1.005f,1.005f, 0,0,0,0.5f);
} else if (Block::blocks[vox->id]->type == 2){
} else if (Block::blocks[vox->id]->model == 2){
lineBatch->box(iend.x+0.4f, iend.y+0.3f, iend.z+0.4f, 0.805f,0.805f,0.805f, 0,0,0,0.5f);
}