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:
parent
ba63c1505a
commit
f7a695c212
4 changed files with 25 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue