Fix for MLO Instance rotations

This commit is contained in:
dexy 2019-10-31 19:01:06 +11:00
parent 4834b8c520
commit 96a561798c
2 changed files with 13 additions and 5 deletions

View File

@ -1489,15 +1489,22 @@ namespace CodeWalker.GameFiles
} }
else else
{ {
Quaternion inv = inverse ? ori : Quaternion.Normalize(Quaternion.Invert(ori)); Orientation = inverse ? Quaternion.Normalize(Quaternion.Invert(ori)) : ori;
ori = inverse ? Quaternion.Normalize(Quaternion.Invert(ori)) : ori; if (MloInstance != null)
Orientation = ori; {
_CEntityDef.rotation = inv.ToVector4(); _CEntityDef.rotation = Orientation.ToVector4();
}
else
{
Quaternion inv = inverse ? ori : Quaternion.Normalize(Quaternion.Invert(ori));
_CEntityDef.rotation = inv.ToVector4();
}
} }
if (MloInstance != null) if (MloInstance != null)
{ {
MloInstance.SetOrientation(ori); MloInstance.SetOrientation(ori);
MloInstance.UpdateEntities();
} }
if (Archetype != null) if (Archetype != null)

View File

@ -408,7 +408,8 @@ namespace CodeWalker.Project.Panels
} }
else else
{ {
CurrentEntity.SetOrientation(q, true); bool useInverse = (CurrentEntity.MloInstance == null);
CurrentEntity.SetOrientation(q, useInverse);
} }
ProjectItemChanged(); ProjectItemChanged();