mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
player.get_selected_block
This commit is contained in:
parent
29ca6e969c
commit
74042b5c2a
13 changed files with 32 additions and 18 deletions
|
|
@ -194,7 +194,7 @@ void WorldRenderer::renderBlockSelection(Camera* camera, Shader* linesShader) {
|
|||
auto indices = level->content->getIndices();
|
||||
blockid_t id = PlayerController::selectedBlockId;
|
||||
auto block = indices->getBlockDef(id);
|
||||
const glm::vec3 pos = PlayerController::selectedBlockPosition;
|
||||
const glm::ivec3 pos = player->selectedBlockPosition;
|
||||
const glm::vec3 point = PlayerController::selectedPointPosition;
|
||||
const glm::vec3 norm = PlayerController::selectedBlockNormal;
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ void WorldRenderer::renderBlockSelection(Camera* camera, Shader* linesShader) {
|
|||
linesShader->uniformMatrix("u_projview", camera->getProjView());
|
||||
lineBatch->lineWidth(2.0f);
|
||||
for (auto& hitbox: hitboxes) {
|
||||
const glm::vec3 center = pos + hitbox.center();
|
||||
const glm::vec3 center = glm::vec3(pos) + hitbox.center();
|
||||
const glm::vec3 size = hitbox.size();
|
||||
lineBatch->box(center, size + glm::vec3(0.02), glm::vec4(0.f, 0.f, 0.f, 0.5f));
|
||||
if (player->debug) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue