Simplify OnRegisterSceneNode of vulkan mesh nodes

This commit is contained in:
Benau 2022-07-22 08:18:18 +08:00
parent 3d0d666e09
commit bf77863c53
4 changed files with 26 additions and 0 deletions

View File

@ -2,6 +2,8 @@
#include "ge_spm.hpp"
#include "ISceneManager.h"
namespace GE
{
GEVulkanAnimatedMeshSceneNode::GEVulkanAnimatedMeshSceneNode(irr::scene::IAnimatedMesh* mesh,
@ -20,4 +22,13 @@ GESPM* GEVulkanAnimatedMeshSceneNode::getSPM() const
return static_cast<GESPM*>(Mesh);
} // getSPM
// ----------------------------------------------------------------------------
void GEVulkanAnimatedMeshSceneNode::OnRegisterSceneNode()
{
if (!IsVisible)
return;
SceneManager->registerNodeForRendering(this, scene::ESNRP_SOLID);
ISceneNode::OnRegisterSceneNode();
} // OnRegisterSceneNode
}

View File

@ -18,6 +18,8 @@ public:
const irr::core::vector3df& scale = irr::core::vector3df(1.0f, 1.0f, 1.0f));
// ------------------------------------------------------------------------
GESPM* getSPM() const;
// ------------------------------------------------------------------------
virtual void OnRegisterSceneNode();
}; // GEVulkanAnimatedMeshSceneNode
}

View File

@ -2,6 +2,8 @@
#include "ge_spm.hpp"
#include "ISceneManager.h"
namespace GE
{
GEVulkanMeshSceneNode::GEVulkanMeshSceneNode(irr::scene::IMesh* mesh,
@ -20,4 +22,13 @@ GESPM* GEVulkanMeshSceneNode::getSPM() const
return static_cast<GESPM*>(Mesh);
} // getSPM
// ----------------------------------------------------------------------------
void GEVulkanMeshSceneNode::OnRegisterSceneNode()
{
if (!IsVisible)
return;
SceneManager->registerNodeForRendering(this, scene::ESNRP_SOLID);
ISceneNode::OnRegisterSceneNode();
} // OnRegisterSceneNode
}

View File

@ -18,6 +18,8 @@ public:
const irr::core::vector3df& scale = irr::core::vector3df(1.0f, 1.0f, 1.0f));
// ------------------------------------------------------------------------
GESPM* getSPM() const;
// ------------------------------------------------------------------------
virtual void OnRegisterSceneNode();
}; // GEVulkanMeshSceneNode
}