diff --git a/Nuake/src/Scene/Systems/TransformSystem.cpp b/Nuake/src/Scene/Systems/TransformSystem.cpp index 479a2327..f87b92df 100644 --- a/Nuake/src/Scene/Systems/TransformSystem.cpp +++ b/Nuake/src/Scene/Systems/TransformSystem.cpp @@ -47,11 +47,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; } @@ -85,10 +84,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();