tangled
alpha
login
or
join now
j0.lol
/
bl0ck
0
fork
atom
WebGPU Voxel Game
0
fork
atom
overview
issues
4
pulls
pipelines
Apply lints
j0.lol
1 year ago
bc97c3bf
ab2d0494
+3
-8
2 changed files
expand all
collapse all
unified
split
src
gfx
camera.rs
world
encoded.rs
+1
-5
src/gfx/camera.rs
···
214
214
self.rotation = Vec2::ZERO;
215
215
216
216
// Keep the camera's angle from going too high/low.
217
217
-
if camera.pitch < -MAX_CAMERA_PITCH {
218
218
-
camera.pitch = -MAX_CAMERA_PITCH;
219
219
-
} else if camera.pitch > MAX_CAMERA_PITCH {
220
220
-
camera.pitch = MAX_CAMERA_PITCH;
221
221
-
}
217
217
+
camera.pitch = camera.pitch.clamp(-MAX_CAMERA_PITCH, MAX_CAMERA_PITCH);
222
218
}
223
219
}
224
220
+2
-3
src/world/encoded.rs
···
1
1
-
use std::collections::HashMap;
2
1
use bincode::{Decode, Encode};
3
2
use rollgrid::rollgrid3d::RollGrid3D;
3
3
+
use std::collections::HashMap;
4
4
5
5
use super::{chunk::Chunk, map::WorldMap};
6
6
-
7
6
8
7
#[derive(Decode, Encode)]
9
8
struct EncodedWorldMap {
···
13
12
}
14
13
15
14
impl EncodedWorldMap {
16
16
-
fn to_rollgrid(self) -> WorldMap {
15
15
+
fn to_rollgrid(&self) -> WorldMap {
17
16
WorldMap {
18
17
chunks: RollGrid3D::new(self.size, self.grid_offset, |p| self.chunks[&p]),
19
18
}