Skip to content

Commit

Permalink
Fix #5054 (#5055)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingJellyfish authored Apr 17, 2024
1 parent a6cecd2 commit 6be521f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/graphics/draw_calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void DrawCalls::parseSceneManager(core::array<scene::ISceneNode*> &List,
if (List[i]->getType() == ESNT_LOD_NODE)
{
LODNode *node = static_cast<LODNode *>(List[i]);
node->updateVisibility();

core::array<scene::ISceneNode*> child;
if (node->getLevel() >= 0)
Expand Down
25 changes: 5 additions & 20 deletions src/graphics/lod_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,15 @@ void LODNode::forceLevelOfDetail(int n)
// ----------------------------------------------------------------------------
void LODNode::OnAnimate(u32 timeMs)
{
updateVisibility();

if (isVisible() && m_nodes.size() > 0)
{
// update absolute position
updateAbsolutePosition();

#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
for (size_t i = 0; i < m_nodes.size(); i++)
{
m_nodes[i]->setVisible(true);
m_nodes[i]->OnAnimate(timeMs);
}
}
else
#endif
for (size_t i = 0; i < m_nodes.size(); i++)
{
int level = getLevel();
// Assume all the scene node have the same bouding box
if(level >= 0)
{
m_nodes[level]->setVisible(true);
m_nodes[level]->OnAnimate(timeMs);
}
m_nodes[i]->setVisible(true);
m_nodes[i]->OnAnimate(timeMs);
}

if (m_update_box_every_frame)
Expand Down Expand Up @@ -173,6 +156,8 @@ void LODNode::updateVisibility()

void LODNode::OnRegisterSceneNode()
{
updateVisibility();

#ifndef SERVER_ONLY
if (CVS->isGLSL())
{
Expand Down

0 comments on commit 6be521f

Please sign in to comment.