From 6c2abde5c99a236453b795abaa6d7d70105e31f7 Mon Sep 17 00:00:00 2001 From: untodesu Date: Fri, 26 Dec 2025 14:50:33 +0500 Subject: Just a big Ctrl+H refactoring --- src/game/client/world/player_target.cc | 48 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/game/client/world/player_target.cc') diff --git a/src/game/client/world/player_target.cc b/src/game/client/world/player_target.cc index 5969381..c8a7583 100644 --- a/src/game/client/world/player_target.cc +++ b/src/game/client/world/player_target.cc @@ -16,49 +16,49 @@ constexpr static float MAX_REACH = 16.0f; -voxel_pos world::player_target::coord; -voxel_pos world::player_target::normal; -const world::Voxel* world::player_target::voxel; +voxel_pos player_target::coord; +voxel_pos player_target::normal; +const Voxel* player_target::voxel; -void world::player_target::init(void) +void player_target::init(void) { - world::player_target::coord = voxel_pos(); - world::player_target::normal = voxel_pos(); - world::player_target::voxel = nullptr; + player_target::coord = voxel_pos(); + player_target::normal = voxel_pos(); + player_target::voxel = nullptr; } -void world::player_target::update(void) +void player_target::update(void) { if(session::is_ingame()) { - RayDDA ray(globals::dimension, entity::camera::position_chunk, entity::camera::position_local, entity::camera::direction); + RayDDA ray(globals::dimension, camera::position_chunk, camera::position_local, camera::direction); do { - world::player_target::voxel = ray.step(); + player_target::voxel = ray.step(); - if(world::player_target::voxel) { - world::player_target::coord = ray.vpos; - world::player_target::normal = ray.vnormal; + if(player_target::voxel) { + player_target::coord = ray.vpos; + player_target::normal = ray.vnormal; break; } - world::player_target::coord = voxel_pos(); - world::player_target::normal = voxel_pos(); + player_target::coord = voxel_pos(); + player_target::normal = voxel_pos(); } while(ray.distance < MAX_REACH); } else { - world::player_target::voxel = nullptr; - world::player_target::coord = voxel_pos(); - world::player_target::normal = voxel_pos(); + player_target::voxel = nullptr; + player_target::coord = voxel_pos(); + player_target::normal = voxel_pos(); } } -void world::player_target::render(void) +void player_target::render(void) { - if(world::player_target::voxel && !client_game::hide_hud) { - auto cpos = coord::to_chunk(world::player_target::coord); - auto fpos = coord::to_local(world::player_target::coord); + if(player_target::voxel && !client_game::hide_hud) { + auto cpos = coord::to_chunk(player_target::coord); + auto fpos = coord::to_local(player_target::coord); - world::outline::prepare(); - world::outline::cube(cpos, glm::fvec3(fpos), glm::fvec3(1.0f), 2.0f, glm::fvec4(0.0f, 0.0f, 0.0f, 1.0f)); + outline::prepare(); + outline::cube(cpos, glm::fvec3(fpos), glm::fvec3(1.0f), 2.0f, glm::fvec4(0.0f, 0.0f, 0.0f, 1.0f)); } } -- cgit