+ float entity_dist;
+ glm::vec3 entity_normal;
+ if (!world.Intersection(aim, glm::mat4(1.0f), aim_entity, entity_dist, entity_normal)) {
+ aim_entity = nullptr;
+ }
+ if (aim_chunk && aim_entity) {
+ // got both, pick the closest one
+ if (chunk_dist < entity_dist) {
+ aim_normal = chunk_normal;
+ UpdateOutline();
+ aim_entity = nullptr;
+ } else {
+ aim_normal = entity_normal;
+ aim_chunk = nullptr;
+ }
+ } else if (aim_chunk) {
+ aim_normal = chunk_normal;
+ UpdateOutline();
+ } else if (aim_entity) {
+ aim_normal = entity_normal;
+ }
+ if (debug) {
+ UpdateBlockInfo();
+ }
+}
+
+void Interface::UpdateOutline() {
+ outl_buf.Clear();
+ aim_chunk->Type(aim_chunk->BlockAt(aim_block)).FillOutlineModel(outl_buf);
+ outline.Update(outl_buf);
+ outline_transform = aim_chunk->Transform(world.Player().ChunkCoords());
+ outline_transform *= aim_chunk->ToTransform(Chunk::ToPos(aim_block), aim_block);
+ outline_transform *= glm::scale(glm::vec3(1.005f));