From 7bb65ca063711b8187cf83d1e73f6e015d00230b Mon Sep 17 00:00:00 2001 From: dexy Date: Thu, 6 Jan 2022 19:52:18 +1100 Subject: [PATCH] Changed BoundComposite XML to use CompositeTransform Matrix instead of Position/Orientation/Scale --- CodeWalker.Core/GameFiles/Resources/Bounds.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CodeWalker.Core/GameFiles/Resources/Bounds.cs b/CodeWalker.Core/GameFiles/Resources/Bounds.cs index 201ccf9..003f3f5 100644 --- a/CodeWalker.Core/GameFiles/Resources/Bounds.cs +++ b/CodeWalker.Core/GameFiles/Resources/Bounds.cs @@ -422,9 +422,7 @@ namespace CodeWalker.GameFiles YbnXml.ValueTag(sb, indent, "UnkType", Unknown_3Ch.ToString()); if (Parent != null) { - YbnXml.SelfClosingTag(sb, indent, "CompositePosition " + FloatUtil.GetVector3XmlString(Position)); - YbnXml.SelfClosingTag(sb, indent, "CompositeRotation " + FloatUtil.GetVector4XmlString(Orientation.ToVector4())); - YbnXml.SelfClosingTag(sb, indent, "CompositeScale " + FloatUtil.GetVector3XmlString(Scale)); + YbnXml.WriteRawArray(sb, Transform.ToArray(), indent, "CompositeTransform", "", FloatUtil.ToString, 4); if (!Parent.OwnerIsFragment) { YbnXml.StringTag(sb, indent, "CompositeFlags1", CompositeFlags1.Flags1.ToString()); @@ -452,9 +450,8 @@ namespace CodeWalker.GameFiles Unknown_3Ch = (byte)Xml.GetChildUIntAttribute(node, "UnkType", "value"); if (Parent != null) { - Position = Xml.GetChildVector3Attributes(node, "CompositePosition"); - Orientation = Xml.GetChildVector4Attributes(node, "CompositeRotation").ToQuaternion(); - Scale = Xml.GetChildVector3Attributes(node, "CompositeScale"); + Transform = new Matrix(Xml.GetChildRawFloatArray(node, "CompositeTransform")); + TransformInv = Matrix.Invert(Transform); if (!Parent.OwnerIsFragment) { var f = new BoundCompositeChildrenFlags();