diff options
| author | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-12-26 14:50:33 +0500 |
| commit | 6c2abde5c99a236453b795abaa6d7d70105e31f7 (patch) | |
| tree | f085049b9615a7d03cca5de40adb6529d6c13e11 /src/game/client/world/player_target.cc | |
| parent | f40d09cb8f712e87691af4912f3630d92d692779 (diff) | |
| download | voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.tar.bz2 voxelius-6c2abde5c99a236453b795abaa6d7d70105e31f7.zip | |
Just a big Ctrl+H refactoring
Diffstat (limited to 'src/game/client/world/player_target.cc')
| -rw-r--r-- | src/game/client/world/player_target.cc | 48 |
1 files changed, 24 insertions, 24 deletions
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)); } } |
