1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-17 18:35:20 +02: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
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;