protected static XElement GetTAGLEntry(SubStream data, int index, string name) { int ofs = index * 84; string tagname = data.GetString(ofs + 0, 48); Vector4 attachpos = RootTransform * new Vector4(data.GetSingle(ofs + 48), data.GetSingle(ofs + 52), data.GetSingle(ofs + 56), 1.0); Vector4 fwdvector = RootTransform * new Vector4(data.GetSingle(ofs + 60), data.GetSingle(ofs + 64), data.GetSingle(ofs + 68), 0.0); Vector4 upvector = RootTransform * new Vector4(data.GetSingle(ofs + 72), data.GetSingle(ofs + 76), data.GetSingle(ofs + 80), 0.0); return(new XElement("IMDL_TAG", new XAttribute("name", tagname), new XElement("Position", String.Format("{0,12:F6} {1,12:F6} {2,12:F6}", attachpos.X, attachpos.Y, attachpos.Z)), new XElement("Forward", String.Format("{0,12:F6} {1,12:F6} {2,12:F6}", fwdvector.X, fwdvector.Y, fwdvector.Z)), new XElement("Up", String.Format("{0,12:F6} {1,12:F6} {2,12:F6}", upvector.X, upvector.Y, upvector.Z)) )); }