Tracing and Performance improvements

tracing
chunk rebuild testing
speed up world gen by moving collider creation to thread pool
This commit is contained in:
2024-05-07 23:26:13 -04:00
parent 58a9f62dca
commit 4e9a35adc6
11 changed files with 206 additions and 46 deletions

View File

@@ -120,6 +120,12 @@ impl HexCoord {
return true;
}
pub fn is_on_chunk_edge(&self) -> bool {
let offset = self.to_offset().rem_euclid(IVec2::splat(Chunk::SIZE as i32));
let e = (Chunk::SIZE - 1) as i32;
return offset.x == 0 || offset.y == 0 || offset.x == e || offset.y == e;
}
pub fn to_chunk_pos(&self) -> IVec2 {
let off = self.to_offset();