summaryrefslogtreecommitdiffstats
path: root/game/shared/world/ray_dda.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
committeruntodesu <kirill@untode.su>2025-07-01 03:23:05 +0500
commit6dc5194895b6bd61d19bf5c95021471784084325 (patch)
tree705c35b3a671a09fc52b406dca81e7761729ded6 /game/shared/world/ray_dda.cc
parent44d91043f268d93dd08e99c5855bd29f85dd61a7 (diff)
downloadvoxelius-6dc5194895b6bd61d19bf5c95021471784084325.tar.bz2
voxelius-6dc5194895b6bd61d19bf5c95021471784084325.zip
I forgot to set these to true in .clang-format
https://files.catbox.moe/909rig.gif
Diffstat (limited to 'game/shared/world/ray_dda.cc')
-rw-r--r--game/shared/world/ray_dda.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/game/shared/world/ray_dda.cc b/game/shared/world/ray_dda.cc
index b12fa48..9f85e6b 100644
--- a/game/shared/world/ray_dda.cc
+++ b/game/shared/world/ray_dda.cc
@@ -40,7 +40,8 @@ void world::RayDDA::reset(
if(direction.x < 0.0f) {
this->side_dist.x = this->delta_dist.x * (start_fpos.x - lpos.x);
this->vstep.x = voxel_pos::value_type(-1);
- } else {
+ }
+ else {
this->side_dist.x = this->delta_dist.x * (lpos.x + 1.0f - start_fpos.x);
this->vstep.x = voxel_pos::value_type(+1);
}
@@ -48,7 +49,8 @@ void world::RayDDA::reset(
if(direction.y < 0.0f) {
this->side_dist.y = this->delta_dist.y * (start_fpos.y - lpos.y);
this->vstep.y = voxel_pos::value_type(-1);
- } else {
+ }
+ else {
this->side_dist.y = this->delta_dist.y * (lpos.y + 1.0f - start_fpos.y);
this->vstep.y = voxel_pos::value_type(+1);
}
@@ -56,7 +58,8 @@ void world::RayDDA::reset(
if(direction.z < 0.0f) {
this->side_dist.z = this->delta_dist.z * (start_fpos.z - lpos.z);
this->vstep.z = voxel_pos::value_type(-1);
- } else {
+ }
+ else {
this->side_dist.z = this->delta_dist.z * (lpos.z + 1.0f - start_fpos.z);
this->vstep.z = voxel_pos::value_type(+1);
}
@@ -76,19 +79,22 @@ voxel_id world::RayDDA::step(void)
distance = side_dist.x;
side_dist.x += delta_dist.x;
vpos.x += vstep.x;
- } else {
+ }
+ else {
vnormal = voxel_pos(0, -vstep.y, 0);
distance = side_dist.y;
side_dist.y += delta_dist.y;
vpos.y += vstep.y;
}
- } else {
+ }
+ else {
if(side_dist.z < side_dist.y) {
vnormal = voxel_pos(0, 0, -vstep.z);
distance = side_dist.z;
side_dist.z += delta_dist.z;
vpos.z += vstep.z;
- } else {
+ }
+ else {
vnormal = voxel_pos(0, -vstep.y, 0);
distance = side_dist.y;
side_dist.y += delta_dist.y;