@@ -77,7 +77,7 @@ impl ChunkManager {
77
77
}
78
78
}
79
79
80
- pub fn instantiate_chunks_vec ( position : Vec3 , render_distance : Vec3 ) -> Vec < Chunk > {
80
+ pub fn instantiate_chunks ( position : Vec3 , render_distance : Vec3 ) -> Vec < Chunk > {
81
81
let render_distance_x = render_distance. x as i32 ;
82
82
let render_distance_y = render_distance. y as i32 ;
83
83
let render_distance_z = render_distance. z as i32 ;
@@ -101,18 +101,7 @@ impl ChunkManager {
101
101
chunks
102
102
}
103
103
104
- pub fn instantiate_chunks ( position : Vec3 , render_distance : i32 ) -> Vec < Chunk > {
105
- Self :: instantiate_chunks_vec (
106
- position,
107
- Vec3 :: new (
108
- render_distance as f32 ,
109
- render_distance as f32 ,
110
- render_distance as f32 ,
111
- ) ,
112
- )
113
- }
114
-
115
- pub fn instantiate_new_chunks ( & mut self , position : Vec3 , render_distance : i32 ) -> Vec < Chunk > {
104
+ pub fn instantiate_new_chunks ( & mut self , position : Vec3 , render_distance : Vec3 ) -> Vec < Chunk > {
116
105
let chunks = Self :: instantiate_chunks ( position, render_distance) ;
117
106
118
107
chunks
@@ -228,7 +217,7 @@ mod tests {
228
217
229
218
let render_distance = Vec3 :: new ( width as f32 , height as f32 , depth as f32 ) ;
230
219
231
- let chunks = ChunkManager :: instantiate_chunks_vec ( position, render_distance) ;
220
+ let chunks = ChunkManager :: instantiate_chunks ( position, render_distance) ;
232
221
assert_eq ! ( chunks. len( ) , ( 2 * width * 2 * height * 2 * depth) as usize , ) ;
233
222
}
234
223
@@ -237,7 +226,14 @@ mod tests {
237
226
let mut chunk_manager = ChunkManager :: new ( ) ;
238
227
let position = Vec3 :: new ( 0.0 , 0.0 , 0.0 ) ;
239
228
let render_distance = 2 ;
240
- let chunks = ChunkManager :: instantiate_chunks ( position, render_distance) ;
229
+ let chunks = ChunkManager :: instantiate_chunks (
230
+ position,
231
+ Vec3 :: new (
232
+ render_distance as f32 ,
233
+ render_distance as f32 ,
234
+ render_distance as f32 ,
235
+ ) ,
236
+ ) ;
241
237
242
238
let render_diameter = render_distance * 2 ;
243
239
0 commit comments