mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
ui update,many fixes
This commit is contained in:
parent
f04bac6b43
commit
a1f9155498
12 changed files with 312 additions and 208 deletions
|
|
@ -135,43 +135,6 @@ void WorldRenderer::draw(World* world, Camera* camera, bool occlusion, bool devd
|
|||
// draw 3D stuff here
|
||||
batch3d->render();
|
||||
|
||||
if (devdata) {
|
||||
linesShader->use();
|
||||
linesShader->uniformMatrix("u_projview", camera->getProjection()*camera->getView());
|
||||
|
||||
vec3 point = vec3(camera->position.x+camera->front.x/1,
|
||||
camera->position.y+camera->front.y/1,
|
||||
camera->position.z+camera->front.z/1);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glLineWidth(3.0f);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x+0.1f, point.y, point.z,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y, point.z+0.1f,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y+0.1f, point.z,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->render();
|
||||
|
||||
glLineWidth(1.0f);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x+0.1f, point.y, point.z,
|
||||
1, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y, point.z+0.1f,
|
||||
0, 0, 1, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y+0.1f, point.z,
|
||||
0, 1, 0, 1);
|
||||
lineBatch->render();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
|
||||
if (level->playerController->selectedBlockId != -1){
|
||||
Block* selectedBlock = Block::blocks[level->playerController->selectedBlockId];
|
||||
vec3 pos = level->playerController->selectedBlockPosition;
|
||||
|
|
@ -185,4 +148,41 @@ void WorldRenderer::draw(World* world, Camera* camera, bool occlusion, bool devd
|
|||
}
|
||||
lineBatch->render();
|
||||
}
|
||||
|
||||
if (devdata) {
|
||||
linesShader->use();
|
||||
linesShader->uniformMatrix("u_projview", camera->getProjection()*camera->getView());
|
||||
|
||||
vec3 point = vec3(camera->position.x+camera->front.x/1,
|
||||
camera->position.y+camera->front.y/1,
|
||||
camera->position.z+camera->front.z/1);
|
||||
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glLineWidth(4.0f);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x+0.1f, point.y, point.z,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y, point.z+0.1f,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y+0.1f, point.z,
|
||||
0, 0, 0, 1);
|
||||
lineBatch->render();
|
||||
|
||||
glLineWidth(2.0f);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x+0.1f, point.y, point.z,
|
||||
1, 0, 0, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y, point.z+0.1f,
|
||||
0, 0, 1, 1);
|
||||
lineBatch->line(point.x, point.y, point.z,
|
||||
point.x, point.y+0.1f, point.z,
|
||||
0, 1, 0, 1);
|
||||
lineBatch->render();
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue