1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Optimize raycast performance (#15233)

by skipping nodes not on the ray with selection boxes smaller than 1x1x1 early on
This commit is contained in:
sfence 2024-12-14 17:01:06 +01:00 committed by GitHub
parent ba63c1505a
commit f7a695c212
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 0 deletions

View file

@ -425,6 +425,8 @@ struct ContentFeatures
NodeBox node_box;
NodeBox selection_box;
NodeBox collision_box;
//! Whether any selection box extent is > BS/2.
bool has_big_selection_box;
// --- SOUND PROPERTIES ---
@ -774,6 +776,9 @@ private:
*/
void fixSelectionBoxIntUnion();
//! Calculates ContentFeatures::&has_big_selection_box
void calcBigSelectionBox(content_t id, const ContentFeatures &def);
//! Features indexed by ID.
std::vector<ContentFeatures> m_content_features;