BGE bug #18522 fixed: Dupligroup offsets don't work in BGE.
authorBenoit Bolsee <benoit.bolsee@online.be>
Tue, 14 Apr 2009 20:54:04 +0000 (20:54 +0000)
committerBenoit Bolsee <benoit.bolsee@online.be>
Tue, 14 Apr 2009 20:54:04 +0000 (20:54 +0000)
source/gameengine/Ketsji/KX_Scene.cpp

index 98c129ebca5ae66fbee9cc0c1ce369e26239b7e2..2bfa767dc3b70ab1f8479261e32cb28d57e9259d 100644 (file)
@@ -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);