diff --git a/Nuake/src/Scene/Systems/TransformSystem.cpp b/Nuake/src/Scene/Systems/TransformSystem.cpp index 5ea67f1f..86d9ceb8 100644 --- a/Nuake/src/Scene/Systems/TransformSystem.cpp +++ b/Nuake/src/Scene/Systems/TransformSystem.cpp @@ -56,11 +56,10 @@ namespace Nuake { auto& localTranslate = transform.GetLocalPosition(); auto& localRot = transform.GetLocalRotation(); auto& localScale = transform.GetLocalScale(); - + localRot.w *= -1.0; localTransform = glm::translate(localTransform, localTranslate); localTransform = localTransform * glm::toMat4(localRot); localTransform = glm::scale(localTransform, localScale); - transform.SetLocalTransform(localTransform); transform.Dirty = false; } @@ -94,10 +93,10 @@ namespace Nuake { { TransformComponent& transformComponent = parentComponent.Parent.GetComponent(); + globalPosition = transformComponent.GetLocalPosition() + (transformComponent.GetLocalRotation() * globalPosition); globalTransform = transformComponent.GetLocalTransform() * globalTransform; - globalPosition += transformComponent.GetLocalPosition(); - globalOrientation *= transformComponent.GetLocalRotation(); + globalOrientation = transformComponent.GetLocalRotation() * globalOrientation; globalScale *= transformComponent.GetLocalScale(); NameComponent& nameComponent = parentComponent.Parent.GetComponent();