Fixed bug where objects without transform causes a crash on reparenting

This commit is contained in:
Diren D Bharwani 2022-10-30 15:10:39 +08:00
parent 605ff9710d
commit 03c0d10014
1 changed files with 3 additions and 0 deletions

View File

@ -263,6 +263,9 @@ namespace SHADE
auto* node = EVENT_DATA->data->node;
auto* tf = SHComponentManager::GetComponent_s<SHTransformComponent>(node->GetEntityID());
if (tf == nullptr)
return EVENT_DATA->handle;
// Recompute local transform and store localToWorld Matrix
SHMatrix localToWorld = SHMatrix::Identity;
SHMatrix worldToLocal = SHMatrix::Identity;