diff options
| author | untodesu <kirill@untode.su> | 2025-09-12 16:16:06 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-12 16:16:06 +0500 |
| commit | fc80fa024fc93dac6ea89461ef36f455c5e468a2 (patch) | |
| tree | 7c4ea8f03b6778572d59784dc28b600e3f8f2268 /game/client/world/player_target.cc | |
| parent | 12947aafcc6a6eb362cc454e2149796ec9265743 (diff) | |
| parent | 522a7514012da86f7b9643179f0763746f3b232e (diff) | |
| download | voxelius-fc80fa024fc93dac6ea89461ef36f455c5e468a2.tar.bz2 voxelius-fc80fa024fc93dac6ea89461ef36f455c5e468a2.zip | |
Merge pull request #15 from untodesu/metavoxels
Metavoxels
Diffstat (limited to 'game/client/world/player_target.cc')
| -rw-r--r-- | game/client/world/player_target.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/game/client/world/player_target.cc b/game/client/world/player_target.cc index f0550c0..3ede47e 100644 --- a/game/client/world/player_target.cc +++ b/game/client/world/player_target.cc @@ -16,17 +16,15 @@ constexpr static float MAX_REACH = 16.0f;
-voxel_id world::player_target::voxel;
voxel_pos world::player_target::coord;
voxel_pos world::player_target::normal;
-const world::VoxelInfo* world::player_target::info;
+const world::Voxel* world::player_target::voxel;
void world::player_target::init(void)
{
- world::player_target::voxel = NULL_VOXEL_ID;
world::player_target::coord = voxel_pos();
world::player_target::normal = voxel_pos();
- world::player_target::info = nullptr;
+ world::player_target::voxel = nullptr;
}
void world::player_target::update(void)
@@ -37,29 +35,26 @@ void world::player_target::update(void) do {
world::player_target::voxel = ray.step();
- if(world::player_target::voxel != NULL_VOXEL_ID) {
+ if(world::player_target::voxel) {
world::player_target::coord = ray.vpos;
world::player_target::normal = ray.vnormal;
- world::player_target::info = world::voxel_registry::find(world::player_target::voxel);
break;
}
world::player_target::coord = voxel_pos();
world::player_target::normal = voxel_pos();
- world::player_target::info = nullptr;
} while(ray.distance < MAX_REACH);
}
else {
- world::player_target::voxel = NULL_VOXEL_ID;
+ world::player_target::voxel = nullptr;
world::player_target::coord = voxel_pos();
world::player_target::normal = voxel_pos();
- world::player_target::info = nullptr;
}
}
void world::player_target::render(void)
{
- if((world::player_target::voxel != NULL_VOXEL_ID) && !client_game::hide_hud) {
+ 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);
|
