From 92e9fd10495b121eaea2fd1e43f65d979c6b56a9 Mon Sep 17 00:00:00 2001 From: ViktorLjung Date: Mon, 12 May 2014 22:24:53 +0200 Subject: [PATCH] fixup! Fixed relative transform rotations (For real this time?) --- src/Systems/TransformSystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Systems/TransformSystem.cpp b/src/Systems/TransformSystem.cpp index ba9bbb1..3eccc26 100755 --- a/src/Systems/TransformSystem.cpp +++ b/src/Systems/TransformSystem.cpp @@ -24,10 +24,10 @@ glm::vec3 Systems::TransformSystem::AbsolutePosition(EntityID entity) //absPosition += transform->Position; entity = m_World->GetEntityParent(entity); auto transform2 = m_World->GetComponent(entity, "Transform"); - if (entity != 0) - absPosition += transform2->Orientation * transform->Position; - else + if (entity == 0) absPosition += transform->Position; + else + absPosition = transform2->Orientation * (absPosition + transform->Position); } while (entity != 0); return absPosition * accumulativeOrientation;