pub fn enqueue_chunks_for_meshing(&mut self, player_chunk: ChunkPos, render_distance: &RenderDistance) {
        self.close_chunks.update(render_distance);
        for pos in self.close_chunks.get_close_chunks() {
            let pos = pos.offset_by_pos(player_chunk);
            if let Some(client_chunk) = self.chunks.get(&pos) {
                if client_chunk.needs_remesh && !client_chunk.is_in_meshing_queue {
                    let res = self.meshing_worker.enqueue(self.create_chunk_mesh_data(pos));
                    match res {
                        // If the meshing queue is not full, update chunk status
                        Ok(()) => {
                            let client_chunk = self.chunks.get_mut(&pos).expect("Logic error");
                            client_chunk.needs_remesh = false;
                            client_chunk.is_in_meshing_queue = true;
                        },
                        // If the meshing queue is full, stop
                        Err(_) => break,
                    }
                }
            }
        }
    }
/// Start the meshing of a few chunks
Start the meshing of a few chunks
Start the meshing of a few chunks
pub fn enqueue_chunks_for_meshing(&mut self, player_chunk: ChunkPos, render_distance: &RenderDistance) {
        self.close_chunks.update(render_distance);
        for pos in self.close_chunks.get_close_chunks() {
            let pos = pos.offset_by_pos(player_chunk);
            if let Some(client_chunk) = self.chunks.get(&pos) {
                if client_chunk.needs_remesh && !client_chunk.is_in_meshing_queue {
                    let res = self.meshing_worker.enqueue(self.create_chunk_mesh_data(pos));
                    match res {
                        // If the meshing queue is not full, update chunk status
                        Ok(()) => {
                            let client_chunk = self.chunks.get_mut(&pos).expect("Logic error");
                            client_chunk.needs_remesh = false;
                            client_chunk.is_in_meshing_queue = true;
                        },
                        // If the meshing queue is full, stop
                        Err(_) => break,
                    }
                }
            }
        }
    }
pub fn enqueue_chunks_for_meshing ( & mut self , player_chunk : ChunkPos , render_distance : & RenderDistance ) { self . close_chunks . update ( render_distance ) ; for pos in self . close_chunks . get_close_chunks ( ) { let pos = pos . offset_by_pos ( player_chunk ) ; if let Some ( client_chunk ) = self . chunks . get ( & pos ) { if client_chunk . needs_remesh && ! client_chunk . is_in_meshing_queue { let res = self . meshing_worker . enqueue ( self . create_chunk_mesh_data ( pos ) ) ; match res { // If the meshing queue is not full, update chunk status Ok ( ( ) ) => { let client_chunk = self . chunks . get_mut ( & pos ) . expect ( " " ) ; client_chunk . needs_remesh = false ; client_chunk . is_in_meshing_queue = true ; } , // If the meshing queue is full, stop Err ( _ ) => break , } } } } }
Start the meshing of a few chunks
Start the meshing of a few chunks
&mut self
player_chunk
ChunkPos
render_distance
&RenderDistance
&mut self
player_chunk
ChunkPos
render_distance
&RenderDistance