Renderables now no longer render if disabled #225
|
@ -440,15 +440,30 @@ namespace SHADE
|
||||||
for (auto rendId : subBatch.Renderables)
|
for (auto rendId : subBatch.Renderables)
|
||||||
{
|
{
|
||||||
// Transform
|
// Transform
|
||||||
auto transform = SHComponentManager::GetComponent_s<SHTransformComponent>(rendId);
|
auto transform = SHComponentManager::GetComponent_s<SHTransformComponent>(rendId);
|
||||||
if (!transform)
|
if (transform)
|
||||||
{
|
{
|
||||||
SHLOG_WARNING("[SHBatch] Entity contianing a SHRenderable with no SHTransformComponent found!");
|
if (SHSceneManager::CheckNodeAndComponentsActive<SHRenderable>(rendId))
|
||||||
transformData.emplace_back();
|
{
|
||||||
|
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
|
||||||
{
|
{
|
||||||
transformData.emplace_back(transform->GetTRS());
|
SHLOG_WARNING("[SHBatch] Entity contianing a SHRenderable with no SHTransformComponent found!");
|
||||||
|
transformData.emplace_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
const SHRenderable* renderable = SHComponentManager::GetComponent<SHRenderable>(rendId);
|
const SHRenderable* renderable = SHComponentManager::GetComponent<SHRenderable>(rendId);
|
||||||
|
|
Loading…
Reference in New Issue