From 494f0fa4e7d5df3dee34aa61338b7c2010477bb5 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Tue, 14 Apr 2009 20:54:04 +0000 Subject: [PATCH] BGE bug #18522 fixed: Dupligroup offsets don't work in BGE. --- source/gameengine/Ketsji/KX_Scene.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 98c129ebca5..2bfa767dc3b 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -717,9 +717,9 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) MT_Matrix3x3 newori = groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldOrientation(); replica->NodeSetLocalOrientation(newori); - + MT_Point3 offset(group->dupli_ofs); MT_Point3 newpos = groupobj->NodeGetWorldPosition() + - newscale*(groupobj->NodeGetWorldOrientation() * gameobj->NodeGetWorldPosition()); + newscale*(groupobj->NodeGetWorldOrientation() * (gameobj->NodeGetWorldPosition()-offset)); replica->NodeSetLocalPosition(newpos); replica->GetSGNode()->UpdateWorldData(0);