feat: bounds-based mesh reloading

This commit is contained in:
Sara Gerretsen 2026-02-25 22:02:02 +01:00
parent 953e4abe5b
commit 226c821454
7 changed files with 93 additions and 38 deletions

View file

@ -60,8 +60,10 @@ void TerrainChunkMesh::_notification(int what) {
default:
return;
case NOTIFICATION_READY:
set_process_thread_group(ProcessThreadGroup::PROCESS_THREAD_GROUP_SUB_THREAD);
this->safe_position = get_global_position();
float const sizef{ (float)get_size() };
this->bounds.position = { this->safe_position.x - sizef / 2.f, this->safe_position.z - sizef / 2.f };
this->bounds.size = { sizef, sizef };
return;
}
}