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); } } } }
/// <summary> /// Returns a compatible Transform from header data from SGBs. /// </summary> /// <param name="hdr"></param> /// <returns></returns> public static Transform TransformFromGimmickHeader(LgbGimmickEntry.HeaderData hdr) { return(new Transform(hdr.Translation.ToLibVector3(), hdr.Rotation.ToLibVector3().ToQuaternion(), hdr.Scale.ToLibVector3())); }