This commit is contained in:
CodingJellyfish 2024-04-17 20:09:18 +08:00 committed by GitHub
parent a6cecd2279
commit 6be521fc96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 20 deletions

View File

@ -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)

View File

@ -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++)
{
for (size_t i = 0; i < m_nodes.size(); i++)
{
m_nodes[i]->setVisible(true);
m_nodes[i]->OnAnimate(timeMs);
}
}
else
#endif
{
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)
@ -173,6 +156,8 @@ void LODNode::updateVisibility()
void LODNode::OnRegisterSceneNode()
{
updateVisibility();
#ifndef SERVER_ONLY
if (CVS->isGLSL())
{