private void addGimmicksToMapList(String lgbGroupName, LgbGimmickEntry gim) { SgbFile thisFile = gim.Gimmick; LgbGimmickEntry.HeaderData hdr = gim.Header; foreach (var iGroup in thisFile.Data) { SgbGroup eGroup = iGroup as SgbGroup; foreach (var iEntry in eGroup.Entries) { SgbModelEntry eEntry = iEntry as SgbModelEntry; if (eEntry != null) { TransformedModel mdl = eEntry.Model; TransformedModel newMdl; Vector3 pos = new Vector3(); Vector3 rot = new Vector3(); //Scale is not added or multiplied pos.X = mdl.Translation.X + hdr.Translation.X; pos.Y = mdl.Translation.Y + hdr.Translation.Y; pos.Z = mdl.Translation.Z + hdr.Translation.Z; rot.X = mdl.Rotation.X + hdr.Rotation.X; rot.Y = mdl.Rotation.Y + hdr.Rotation.Y; rot.Z = mdl.Rotation.Z + hdr.Rotation.Z; newMdl = new TransformedModel(mdl.Model, pos, rot, mdl.Scale); addToMapList(lgbGroupName, newMdl); } } } }
//Adds gimmick info in the form of a header to the maplist, accepts LgbGimmicks private void addGimmickInfoToMapList(LgbGimmickEntry gim) { StringBuilder sb = new StringBuilder(); Vector3 pos = gim.Header.Translation; Vector3 rot = gim.Header.Rotation; Vector3 scal = gim.Header.Scale; sb.AppendFormat("{0},{1},{2},", pos.X, pos.Y, pos.Z); sb.AppendFormat("{0},{1},{2},", rot.X, rot.Y, rot.Z); sb.AppendFormat("{0},{1},{2}", scal.X, scal.Y, scal.Z); addHeaderToMapList("Gimmick," + sb.ToString()); }
//Retrieves model entries from this gimmick entry private List <String> getGimmickPaths(LgbGimmickEntry entry) { List <String> gimmickFileList = new List <String>(); SgbFile thisFile = entry.Gimmick; foreach (var iGroup in thisFile.Data) { SgbGroup eGroup = iGroup as SgbGroup; foreach (var iEntry in eGroup.Entries) { SgbModelEntry eEntry = iEntry as SgbModelEntry; if (eEntry != null) { gimmickFileList.Add(eEntry.Model.Model.File.Path); } } } return(gimmickFileList); }