+1
-5
src/gfx/camera.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
-
if camera.pitch < -MAX_CAMERA_PITCH {
218
-
camera.pitch = -MAX_CAMERA_PITCH;
219
-
} else if camera.pitch > MAX_CAMERA_PITCH {
220
-
camera.pitch = MAX_CAMERA_PITCH;
221
-
}
217
+
camera.pitch = camera.pitch.clamp(-MAX_CAMERA_PITCH, MAX_CAMERA_PITCH);
222
218
}
223
219
}
224
220
+2
-3
src/world/encoded.rs
+2
-3
src/world/encoded.rs
···
1
-
use std::collections::HashMap;
2
1
use bincode::{Decode, Encode};
3
2
use rollgrid::rollgrid3d::RollGrid3D;
3
+
use std::collections::HashMap;
4
4
5
5
use super::{chunk::Chunk, map::WorldMap};
6
-
7
6
8
7
#[derive(Decode, Encode)]
9
8
struct EncodedWorldMap {
···
13
12
}
14
13
15
14
impl EncodedWorldMap {
16
-
fn to_rollgrid(self) -> WorldMap {
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
}