Renderables now no longer render if disabled #225
|
@ -27,6 +27,7 @@ of DigiPen Institute of Technology is prohibited.
|
||||||
#include "Math/Transform/SHTransformComponent.h"
|
#include "Math/Transform/SHTransformComponent.h"
|
||||||
#include "Graphics/MiddleEnd/GlobalData/SHGraphicsGlobalData.h"
|
#include "Graphics/MiddleEnd/GlobalData/SHGraphicsGlobalData.h"
|
||||||
#include "Graphics/Descriptors/SHVkDescriptorPool.h"
|
#include "Graphics/Descriptors/SHVkDescriptorPool.h"
|
||||||
|
#include "Scene/SHSceneManager.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
|
@ -223,7 +224,22 @@ namespace SHADE
|
||||||
auto transform = SHComponentManager::GetComponent<SHTransformComponent>(rendId);
|
auto transform = SHComponentManager::GetComponent<SHTransformComponent>(rendId);
|
||||||
if (transform)
|
if (transform)
|
||||||
{
|
{
|
||||||
transformData.emplace_back(transform->GetTRS());
|
if (SHSceneManager::CheckNodeAndComponentsActive<SHRenderable>(rendId))
|
||||||
|
{
|
||||||
|
transformData.emplace_back(transform->GetTRS());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Should be deactivated
|
||||||
|
static const SHMatrix ZERO_MTX =
|
||||||
|
{
|
||||||
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 0.0f, 0.0f
|
||||||
|
};
|
||||||
|
transformData.emplace_back(ZERO_MTX);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue