This commit is contained in:
Brandon Mak 2023-03-02 11:53:52 +08:00
parent 1e59b6436c
commit 848123c138
1 changed files with 6 additions and 1 deletions

View File

@ -84,6 +84,12 @@ namespace SHADE
// If has positions, feed data to buffer. // If has positions, feed data to buffer.
if (comp.HasPositions()) if (comp.HasPositions())
{ {
auto meshHandle = comp.GetMesh();
// dont do anything if no mesh
if (!meshHandle)
continue;
SHTransformComponent* transform = SHComponentManager::GetComponent_s<SHTransformComponent>(comp.GetEID()); SHTransformComponent* transform = SHComponentManager::GetComponent_s<SHTransformComponent>(comp.GetEID());
if (transform) if (transform)
{ {
@ -104,7 +110,6 @@ namespace SHADE
// Will be used for baseInstance later // Will be used for baseInstance later
uint32_t oldTransformDataSize = transformData.size(); uint32_t oldTransformDataSize = transformData.size();
auto meshHandle = comp.GetMesh();
auto const& positions = comp.GetPositions(); auto const& positions = comp.GetPositions();
for (auto& pos : positions) for (auto& pos : positions)