public AnimSet(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Sequences = new List<int>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "PreviewSkelMeshName": PreviewSkelMeshName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; if (pcc.isExport(m_pBioAnimSetData - 1) && pcc.Exports[m_pBioAnimSetData - 1].ClassName == "BioAnimSetData") SetData = new BioAnimSetData(pcc, m_pBioAnimSetData - 1); break; case "Sequences": ReadSequences(p.raw); break; } }
public BioPlaypenVolumeAdditive(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } MyMatrix = Matrix.Translation(location); }
public AnimSet(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Sequences = new List <int>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "PreviewSkelMeshName": PreviewSkelMeshName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; if (pcc.isExport(m_pBioAnimSetData - 1) && pcc.Exports[m_pBioAnimSetData - 1].ClassName == "BioAnimSetData") { SetData = new BioAnimSetData(pcc, m_pBioAnimSetData - 1); } break; case "Sequences": ReadSequences(p.raw); break; } } }
public LightVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bColored": if (p.raw[p.raw.Length - 1] == 1) { bColored = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); }
public StaticMeshCollectionActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "Tag": Tag = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } ReadObjects(); ReadMatrices(); }
public WwiseAmbientSound(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bAutoPlay": if (p.raw[p.raw.Length - 1] == 1) bAutoPlay = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public BioAnimSetData(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); TrackBoneNames = new List<string>(); UseTranslationBoneNames = new List<string>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bAnimRotationOnly": if (p.raw[p.raw.Length - 1] == 1) bAnimRotationOnly = true; break; case "TrackBoneNames": ReadTBN(p.raw); break; case "UseTranslationBoneNames": ReadUTBN(p.raw); break; } }
public BioAnimSetData(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); TrackBoneNames = new List <string>(); UseTranslationBoneNames = new List <string>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bAnimRotationOnly": if (p.raw[p.raw.Length - 1] == 1) { bAnimRotationOnly = true; } break; case "TrackBoneNames": ReadTBN(p.raw); break; case "UseTranslationBoneNames": ReadUTBN(p.raw); break; } } }
public AnimTree(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); AnimGroups = new List<AnimGroupEntry>(); ComposePrePassBoneNames = new List<string>(); SkelControlLists = new List<SkelControlListEntry>(); Children = new List<ChildrenEntry>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AnimGroups": ReadAnimGroups(p.raw); break; case "ComposePrePassBoneNames": ReadPrePassBoneNames(p.raw); break; case "SkelControlLists": ReadSkelControlLists(p.raw); break; case "Children": ReadChildren(p.raw); break; } }
public StaticMeshCollectionActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } ReadObjects(); ReadMatrices(); }
public TreeNode ChildrenToTree() { TreeNode res = new TreeNode("Children"); for (int i = 0; i < Children.Count; i++) { int idx = Children[i].Anim; TreeNode t = new TreeNode(i.ToString()); t.Nodes.Add("Name : " + Children[i].Name); t.Nodes.Add("Weight : " + Children[i].Weight); t.Nodes.Add("Anim : " + Children[i].Anim); if (pcc.isExport(idx)) { switch (pcc.Exports[idx].ClassName) { case "AnimNodeSlot": AnimNodeSlot ans = new AnimNodeSlot(pcc, idx); t.Nodes.Add(ans.ToTree()); break; } } t.Nodes.Add("bIsMirrorSkeleton : " + Children[i].bMirrorSkeleton); t.Nodes.Add("bIsAdditive : " + Children[i].bIsAdditive); res.Nodes.Add(t); } return(res); }
public AnimNodeSlot(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Children = new List<ChildrenEntry>(); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bSkipTickWhenZeroWeight": if (p.raw[p.raw.Length - 1] == 1) bSkipTickWhenZeroWeight = true; break; case "NodeName": NodeName = p.Value.IntValue; break; case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Children": ReadChildren(p.raw); break; } }
public MantleMarker(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) bHasCrossLevelPaths = true; break; case "Tag": Tag = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Owner": Owner = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public BioPlaypenVolumeAdditive(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } MyMatrix = Matrix.Translation(location); }
public LightVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bColored": if (p.raw[p.raw.Length - 1] == 1) bColored = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); }
public DecalActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Decal": Decal = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } if (pcc.isExport(Decal - 1) && pcc.Exports[Decal - 1].ClassName == "DecalComponent") DC = new DecalComponent(pcc, Decal - 1); MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public void ReadObjects() { int entry = -1; for (int i = 0; i < Props.Count; i++) { if (pcc.getNameEntry(Props[i].Name) == "StaticMeshComponents") { entry = i; } } if (entry == -1) { return; } int count = BitConverter.ToInt32(Props[entry].raw, 24); DebugOutput.PrintLn("#" + MyIndex + " StaticMeshCollectionActor : reading " + count + " objects..."); Entries = new List <int>(); for (int i = 0; i < count; i++) { Entries.Add(BitConverter.ToInt32(Props[entry].raw, i * 4 + 28) - 1); } STMC = new List <StaticMeshComponent>(); foreach (int idx in Entries) { if (pcc.isExport(idx) && pcc.Exports[idx].ClassName == "StaticMeshComponent") { STMC.Add(new StaticMeshComponent(pcc, idx)); } else { STMC.Add(null); } DebugOutput.Print(".", false); } DebugOutput.PrintLn(""); }
public WwiseEnvironmentVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Settings": Settings = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Priority": Priority = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } MyMatrix = Matrix.Translation(location); }
public AnimSequence(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Unknown = BitConverter.ToInt32(data, 0); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "RotationCompressionFormat": RotationCompressionFormat = p.Value.IntValue; break; case "KeyEncodingFormat": KeyEncodingFormat = p.Value.IntValue; break; case "bIsAdditive": if (p.raw[p.raw.Length - 1] == 1) bIsAdditive = true; break; case "bNoLoopingInterpolation": if (p.raw[p.raw.Length - 1] == 1) bNoLoopingInterpolation = true; break; case "SequenceName": SequenceName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; break; case "SequenceLength": SequenceLength = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "RateScale": RateScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NumFrames": NumFrames = p.Value.IntValue; break; case "CompressedTrackOffsets": ReadTrackOffsets(p.raw); break; } ReadCompressedBlob(); }
public SplineActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "Physics": Physics = p.Value.IntValue; break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) bEdShouldSnap = true; break; case "bDisableDestination": if (p.raw[p.raw.Length - 1] == 1) bDisableDestination = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); if(to == new Vector3()) to = location; break; case "Connections" : Connections = p.raw; break; } ProcessConnections(); }
public static Vector3 GetLocation(ME3Package Pcc, int Index) { Vector3 r = new Vector3(); if (!Pcc.isExport(Index)) return new Vector3(); List<PropertyReader.Property> pp = PropertyReader.getPropList(Pcc.Exports[Index]); foreach (PropertyReader.Property p in pp) switch (Pcc.getNameEntry(p.Name)) { case "location": r = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } return r; }
public TreeNode SequencesToTree() { TreeNode res = new TreeNode("Sequences"); foreach (int idx in Sequences) { if (pcc.isExport(idx) && pcc.Exports[idx].ClassName == "AnimSequence") { AnimSequence ans = new AnimSequence(pcc, idx); res.Nodes.Add(ans.ToTree()); } else { res.Nodes.Add(idx.ToString()); } } return(res); }
public void ProcessConnections() { if (Connections.Length == 0) { return; } byte[] buff = GetArrayContent(Connections); List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, buff, 0); int f = -1; toIdx = -1; foreach (PropertyReader.Property p in pp) { if (pcc.getNameEntry(p.Name) == "ConnectTo") { f = p.Value.IntValue - 1; } } if (pcc.isExport(f) && pcc.Exports[f].ClassName == "SplineActor") { to = SplineActor.GetLocation(pcc, f); toIdx = f; } from = new List <Vector3>(); fromIdx = new List <int>(); buff = new byte[0]; foreach (PropertyReader.Property p in Props) { if (pcc.getNameEntry(p.Name) == "LinksFrom") { buff = GetArrayContent(p.raw); } } for (int i = 0; i < buff.Length / 4; i++) { int Idx = BitConverter.ToInt32(buff, i * 4) - 1; fromIdx.Add(Idx); from.Add(SplineActor.GetLocation(pcc, Idx)); } }
public AnimTree(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); AnimGroups = new List <AnimGroupEntry>(); ComposePrePassBoneNames = new List <string>(); SkelControlLists = new List <SkelControlListEntry>(); Children = new List <ChildrenEntry>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AnimGroups": ReadAnimGroups(p.raw); break; case "ComposePrePassBoneNames": ReadPrePassBoneNames(p.raw); break; case "SkelControlLists": ReadSkelControlLists(p.raw); break; case "Children": ReadChildren(p.raw); break; } } }
public WwiseAmbientSound(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bAutoPlay": if (p.raw[p.raw.Length - 1] == 1) { bAutoPlay = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public static Vector3 GetLocation(ME3Package Pcc, int Index) { Vector3 r = new Vector3(); if (!Pcc.isExport(Index)) { return(new Vector3()); } List <PropertyReader.Property> pp = PropertyReader.getPropList(Pcc.Exports[Index]); foreach (PropertyReader.Property p in pp) { switch (Pcc.getNameEntry(p.Name)) { case "location": r = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } return(r); }
public AnimNodeSlot(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Children = new List <ChildrenEntry>(); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bSkipTickWhenZeroWeight": if (p.raw[p.raw.Length - 1] == 1) { bSkipTickWhenZeroWeight = true; } break; case "NodeName": NodeName = p.Value.IntValue; break; case "NodeTotalWeight": NodeTotalWeight = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Children": ReadChildren(p.raw); break; } } }
public BioPathPoint(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) bHasCrossLevelPaths = true; break; case "bEnabled": if (p.raw[p.raw.Length - 1] == 1) bEnabled = true; break; case "bBlocked": if (p.raw[p.raw.Length - 1] == 1) bBlocked = true; break; case "bPathsChanged": if (p.raw[p.raw.Length - 1] == 1) bPathsChanged = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "bMakeSourceOnly": if (p.raw[p.raw.Length - 1] == 1) bMakeSourceOnly = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public DecalComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) #region { case "FilterMode": FilterMode = p.Value.IntValue; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bFlipBackfaceDirection": if (p.raw[p.raw.Length - 1] == 1) bFlipBackfaceDirection = true; break; case "bProjectOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) bProjectOnBackfaces = true; break; case "bNoClip": if (p.raw[p.raw.Length - 1] == 1) bNoClip = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bProjectOnBSP": if (p.raw[p.raw.Length - 1] == 1) bProjectOnBSP = true; break; case "bProjectOnSkeletalMeshes": if (p.raw[p.raw.Length - 1] == 1) bProjectOnSkeletalMeshes = true; break; case "bProjectOnTerrain": if (p.raw[p.raw.Length - 1] == 1) bProjectOnTerrain = true; break; case "DecalMaterial": DecalMaterial = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "Width": Width = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Height": Height = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "FarPlane": FarPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileX": TileX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileY": TileY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NearPlane": NearPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DecalRotation": DecalRotation = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetX": OffsetX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DepthBias": DepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SlopeScaleDepthBias": SlopeScaleDepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetY": OffsetY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SortOrder": SortOrder = p.Value.IntValue; break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; } #endregion }
public DecalComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) #region { case "FilterMode": FilterMode = p.Value.IntValue; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDecals = true; } break; case "bFlipBackfaceDirection": if (p.raw[p.raw.Length - 1] == 1) { bFlipBackfaceDirection = true; } break; case "bProjectOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnBackfaces = true; } break; case "bNoClip": if (p.raw[p.raw.Length - 1] == 1) { bNoClip = true; } break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsLights = true; } break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) { bAllowCullDistanceVolume = true; } break; case "bProjectOnBSP": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnBSP = true; } break; case "bProjectOnSkeletalMeshes": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnSkeletalMeshes = true; } break; case "bProjectOnTerrain": if (p.raw[p.raw.Length - 1] == 1) { bProjectOnTerrain = true; } break; case "DecalMaterial": DecalMaterial = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "Width": Width = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Height": Height = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "FarPlane": FarPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileX": TileX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TileY": TileY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NearPlane": NearPlane = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DecalRotation": DecalRotation = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetX": OffsetX = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DepthBias": DepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SlopeScaleDepthBias": SlopeScaleDepthBias = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OffsetY": OffsetY = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "SortOrder": SortOrder = p.Value.IntValue; break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; } } #endregion }
public MantleMarker(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) { bHasCrossLevelPaths = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Owner": Owner = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public StaticMeshActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { string s = pcc.getNameEntry(p.Name); switch (s) { #region case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) { bPathColliding = true; } break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) { bLockLocation = true; } break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) { OverridePhysMat = true; } break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) { bHidden = true; } break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) { bShadowParented = true; } break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) { bCollideComplex = true; } break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEd = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") { STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public InterpActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "RemoteRole": RemoteRole = p.Value.IntValue; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) { bShadowParented = true; } break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) { bHidden = true; } break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) { bPathColliding = true; } break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) { bHardAttach = true; } break; case "bStopOnEncroach": if (p.raw[p.raw.Length - 1] == 1) { bStopOnEncroach = true; } break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "bNoEncroachCheck": if (p.raw[p.raw.Length - 1] == 1) { bNoEncroachCheck = true; } break; case "bPawnCanBaseOn": if (p.raw[p.raw.Length - 1] == 1) { bPawnCanBaseOn = true; } break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) { bLockLocation = true; } break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) { bCollideComplex = true; } break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) { bBlockActors = true; } break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEd = true; } break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) { bBioSnapToBase = true; } break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreBaseRotation = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") { STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); } break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NetUpdateFrequency": NetUpdateFrequency = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public void ReadObjects(int off) { int pos = off; int count = BitConverter.ToInt32(memory, pos); pos += 4; Objects = new List <int>(); STM_CA = new List <StaticMeshCollectionActor>(); STM_A = new List <StaticMeshActor>(); DA = new List <DecalActor>(); BV = new List <BlockingVolume>(); IA = new List <InterpActor>(); SPA = new List <SplineActor>(); TP = new List <TargetPoint>(); LV = new List <LightVolume>(); MM = new List <MantleMarker>(); PN = new List <PathNode>(); CL = new List <CoverLink>(); CSM = new List <CoverSlotMarker>(); EM = new List <Emitter>(); BPVA = new List <BioPlaypenVolumeAdditive>(); BTV = new List <BioTriggerVolume>(); BPP = new List <BioPathPoint>(); WAS = new List <WwiseAmbientSound>(); WAV = new List <WwiseAudioVolume>(); WEV = new List <WwiseEnvironmentVolume>(); for (int i = 0; i < count; i++) { int idx = BitConverter.ToInt32(memory, pos) - 1; if (pcc.isExport(idx)) { Objects.Add(idx); IExportEntry e = pcc.Exports[idx]; switch (e.ClassName) { case "SplineActor": SPA.Add(new SplineActor(pcc, idx)); break; case "Emitter": EM.Add(new Emitter(pcc, idx)); break; case "MantleMarker": MM.Add(new MantleMarker(pcc, idx)); break; case "PathNode": PN.Add(new PathNode(pcc, idx)); break; case "CoverLink": CL.Add(new CoverLink(pcc, idx)); break; case "CoverSlotMarker": CSM.Add(new CoverSlotMarker(pcc, idx)); break; case "TargetPoint": TP.Add(new TargetPoint(pcc, idx)); break; case "InterpActor": IA.Add(new InterpActor(pcc, idx)); break; case "DecalActor": DA.Add(new DecalActor(pcc, idx)); break; case "StaticMeshCollectionActor": STM_CA.Add(new StaticMeshCollectionActor(pcc, idx)); break; case "StaticMeshActor": STM_A.Add(new StaticMeshActor(pcc, idx)); break; case "BlockingVolume": BV.Add(new BlockingVolume(pcc, idx)); break; case "LightVolume": LV.Add(new LightVolume(pcc, idx)); break; case "BioPlaypenVolumeAdditive": BPVA.Add(new BioPlaypenVolumeAdditive(pcc, idx)); break; case "BioTriggerVolume": BTV.Add(new BioTriggerVolume(pcc, idx)); break; case "BioPathPoint": BPP.Add(new BioPathPoint(pcc, idx)); break; case "WwiseAmbientSound": WAS.Add(new WwiseAmbientSound(pcc, idx)); break; case "WwiseAudioVolume": WAV.Add(new WwiseAudioVolume(pcc, idx)); break; case "WwiseEnvironmentVolume": WEV.Add(new WwiseEnvironmentVolume(pcc, idx)); break; } } pos += 4; } }
public Emitter(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bNoVFXSound": if (p.raw[p.raw.Length - 1] == 1) bNoVFXSound = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) bBioSnapToBase = true; break; case "bCurrentlyActive": if (p.raw[p.raw.Length - 1] == 1) bCurrentlyActive = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bPostUpdateTickGroup": if (p.raw[p.raw.Length - 1] == 1) bPostUpdateTickGroup = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "ParticleSystemComponent": ParticleSystemComponent = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public StaticMeshComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "LightMapEncoding": LightMapEncoding = p.Value.IntValue; break; case "RBChannel": RBChannel = p.Value.IntValue; break; case "DepthPriorityGroup": DepthPriorityGroup = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bIgnoreInstanceForTextureStreaming": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreInstanceForTextureStreaming = true; } break; case "CastShadow": if (p.raw[p.raw.Length - 1] == 1) { CastShadow = true; } break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) { CollideActors = true; } break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) { BlockRigidBody = true; } break; case "bForceDirectLightMap": if (p.raw[p.raw.Length - 1] == 1) { bForceDirectLightMap = true; } break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) { bCastDynamicShadow = true; } break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDominantLightShadows = true; } break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsLights = true; } break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicLights = true; } break; case "bCullModulatedShadowOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) { bCullModulatedShadowOnBackfaces = true; } break; case "bCullModulatedShadowOnEmissive": if (p.raw[p.raw.Length - 1] == 1) { bCullModulatedShadowOnEmissive = true; } break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) { bAllowAmbientOcclusion = true; } break; case "bUsePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) { bUsePrecomputedShadows = true; } break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) { CanBlockCamera = true; } break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) { bAllowShadowFade = true; } break; case "bBioIsReceivingDecals": if (p.raw[p.raw.Length - 1] == 1) { bBioIsReceivingDecals = true; } break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) { BlockNonZeroExtent = true; } break; case "bAcceptsStaticDecals": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsStaticDecals = true; } break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDecals = true; } break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsFoliage = true; } break; case "HiddenGame": if (p.raw[p.raw.Length - 1] == 1) { HiddenGame = true; } break; case "bBioForcePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) { bBioForcePrecomputedShadows = true; } break; case "bCastHiddenShadow": if (p.raw[p.raw.Length - 1] == 1) { bCastHiddenShadow = true; } break; case "bUseAsOccluder": if (p.raw[p.raw.Length - 1] == 1) { bUseAsOccluder = true; } break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) { BlockZeroExtent = true; } break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) { bAllowCullDistanceVolume = true; } break; case "bAllowApproximateOcclusion": if (p.raw[p.raw.Length - 1] == 1) { bAllowApproximateOcclusion = true; } break; case "bSelfShadowOnly": if (p.raw[p.raw.Length - 1] == 1) { bSelfShadowOnly = true; } break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) { OverridePhysMat = true; } break; case "bUseOnePassLightingOnTranslucency": if (p.raw[p.raw.Length - 1] == 1) { bUseOnePassLightingOnTranslucency = true; } break; case "bLockLightingCache": if (p.raw[p.raw.Length - 1] == 1) { bLockLightingCache = true; } break; case "bDisableAllRigidBody": if (p.raw[p.raw.Length - 1] == 1) { bDisableAllRigidBody = true; } break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) { BlockActors = true; } break; case "bNotifyRigidBodyCollision": if (p.raw[p.raw.Length - 1] == 1) { bNotifyRigidBodyCollision = true; } break; case "bIgnoreRadialImpulse": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreRadialImpulse = true; } break; case "bIgnoreRadialForce": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreRadialForce = true; } break; case "HiddenEditor": if (p.raw[p.raw.Length - 1] == 1) { HiddenEditor = true; } break; case "StaticMesh": StaticMesh_ = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "ShadowParent": ShadowParent = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MinDrawDistance": MinDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioObstruction": AudioObstruction = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OverriddenLODMaxRange": OverriddenLODMaxRange = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale": Scale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale3D": Scale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotation = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "Translation": Translation = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "MassiveLODDistance": MassiveLODDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MotionBlurScale": MotionBlurScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; case "ForcedLodModel": ForcedLodModel = p.Value.IntValue; break; #endregion } } if (StaticMesh_ - 1 >= 0 && StaticMesh_ - 1 < pcc.Exports.Count) { if (pcc.Exports[StaticMesh_ - 1].ClassName == "StaticMesh") { STM = new StaticMesh(pcc, StaticMesh_ - 1); STM.Mesh.Bounds.t = null;//save memory STM.Mesh.Edges.t = null; STM.Mesh.Buffers.t = null; STM.Mesh.IdxBuf.t = null; STM.Mesh.kDOPTree.t = null; STM.Mesh.Mat.t = null; STM.Mesh.RawTris.t = null; STM.Mesh.UnknownPart.t = null; STM.Mesh.Vertices.t = null; } } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(Scale3D); MyMatrix *= Matrix.Scaling(Scale, Scale, Scale); Vector3 rot = RotatorToDX(Rotation); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(Translation); }
public InterpActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "RemoteRole": RemoteRole = p.Value.IntValue; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bStopOnEncroach": if (p.raw[p.raw.Length - 1] == 1) bStopOnEncroach = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "bNoEncroachCheck": if (p.raw[p.raw.Length - 1] == 1) bNoEncroachCheck = true; break; case "bPawnCanBaseOn": if (p.raw[p.raw.Length - 1] == 1) bPawnCanBaseOn = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) bCollideComplex = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) bHiddenEd = true; break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) bBioSnapToBase = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NetUpdateFrequency": NetUpdateFrequency = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public SplineActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "Physics": Physics = p.Value.IntValue; break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) { bEdShouldSnap = true; } break; case "bDisableDestination": if (p.raw[p.raw.Length - 1] == 1) { bDisableDestination = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); if (to == new Vector3()) { to = location; } break; case "Connections": Connections = p.raw; break; } } ProcessConnections(); }
public AnimSequence(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Unknown = BitConverter.ToInt32(data, 0); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "RotationCompressionFormat": RotationCompressionFormat = p.Value.IntValue; break; case "KeyEncodingFormat": KeyEncodingFormat = p.Value.IntValue; break; case "bIsAdditive": if (p.raw[p.raw.Length - 1] == 1) { bIsAdditive = true; } break; case "bNoLoopingInterpolation": if (p.raw[p.raw.Length - 1] == 1) { bNoLoopingInterpolation = true; } break; case "SequenceName": SequenceName = p.Value.IntValue; break; case "m_pBioAnimSetData": m_pBioAnimSetData = p.Value.IntValue; break; case "SequenceLength": SequenceLength = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "RateScale": RateScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "NumFrames": NumFrames = p.Value.IntValue; break; case "CompressedTrackOffsets": ReadTrackOffsets(p.raw); break; } } ReadCompressedBlob(); }
public void ProcessConnections() { List <CustomVertex.PositionColored> list = new List <CustomVertex.PositionColored>(); if (Connections.Length == 0) { return; } byte[] buff = GetArrayContent(Connections); List <PropertyReader.Property> pp = PropertyReader.ReadProp(pcc, buff, 0); int f = -1; toIdx = -1; foreach (PropertyReader.Property p in pp) { if (pcc.getNameEntry(p.Name) == "ConnectTo") { f = p.Value.IntValue - 1; } } if (pcc.isExport(f) && pcc.Exports[f].ClassName == "SplineActor") { to = SplineActor.GetLocation(pcc, f); toIdx = f; } from = new List <Vector3>(); fromIdx = new List <int>(); buff = new byte[0]; foreach (PropertyReader.Property p in Props) { if (pcc.getNameEntry(p.Name) == "LinksFrom") { buff = GetArrayContent(p.raw); } } for (int i = 0; i < buff.Length / 4; i++) { int Idx = BitConverter.ToInt32(buff, i * 4) - 1; fromIdx.Add(Idx); from.Add(SplineActor.GetLocation(pcc, Idx)); } list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(to, Color.GreenYellow.ToArgb())); foreach (Vector3 v in from) { list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(v, Color.GreenYellow.ToArgb())); } float w = 20; list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, -w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, -w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location, Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, -w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, -w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, -w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, w, 100), Color.GreenYellow.ToArgb())); list.Add(new CustomVertex.PositionColored(location + new Vector3(-w, -w, 100), Color.GreenYellow.ToArgb())); points = list.ToArray(); points_sel = list.ToArray(); for (int i = 0; i < points_sel.Length; i++) { points_sel[i].Color = Color.Red.ToArgb(); } }
public DecalActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Decal": Decal = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } if (pcc.isExport(Decal - 1) && pcc.Exports[Decal - 1].ClassName == "DecalComponent") { DC = new DecalComponent(pcc, Decal - 1); } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public BrushComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { case "RBChannel": RBChannel = p.Value.IntValue; break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) BlockRigidBody = true; break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) CollideActors = true; break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) CanBlockCamera = true; break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockZeroExtent = true; break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockNonZeroExtent = true; break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) BlockActors = true; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) bCastDynamicShadow = true; break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDominantLightShadows = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicLights = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) bAcceptsFoliage = true; break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowAmbientOcclusion = true; break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) bAllowShadowFade = true; break; case "Brush": Brush = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "CachedPhysBrushDataVersion": CachedPhysBrushDataVersion = p.Value.IntValue; break; case "BrushAggGeom": ReadMesh(p.raw); break; } }
public TargetPoint(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) { bHardAttach = true; } break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) { bShadowParented = true; } break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) { bLockLocation = true; } break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreBaseRotation = true; } break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) { bHidden = true; } break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) { bEdShouldSnap = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public BlockingVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); Vector3 v; Tag = -1; Group = -1; foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region Props case "bAllowFluidSurfaceInteraction": if (p.raw[p.raw.Length - 1] == 1) { bAllowFluidSurfaceInteraction = true; } break; case "bBlockCamera": if (p.raw[p.raw.Length - 1] == 1) { bBlockCamera = true; } break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "bInclusionaryList": if (p.raw[p.raw.Length - 1] == 1) { bInclusionaryList = true; } break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) { bPathColliding = true; } break; case "bSafeFall": if (p.raw[p.raw.Length - 1] == 1) { bSafeFall = true; } break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) { OverridePhysMat = true; } break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "location": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); location = v; break; case "DrawScale3D": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); DrawScale3D = v; break; #endregion } } MyMatrix = Matrix.Scaling(DrawScale3D) * Matrix.Translation(location); }
public CoverLink(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "LocationDescription": LocationDescription = p.Value.IntValue; break; case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) bHasCrossLevelPaths = true; break; case "bAutoAdjust": if (p.raw[p.raw.Length - 1] == 1) bAutoAdjust = true; break; case "bDisabled": if (p.raw[p.raw.Length - 1] == 1) bDisabled = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPlayerOnly": if (p.raw[p.raw.Length - 1] == 1) bPlayerOnly = true; break; case "bLooped": if (p.raw[p.raw.Length - 1] == 1) bLooped = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bPathsChanged": if (p.raw[p.raw.Length - 1] == 1) bPathsChanged = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "NextCoverLink": NextCoverLink = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CircularRadius": CircularRadius = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MaxFireLinkDist": MaxFireLinkDist = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "Cost": Cost = p.Value.IntValue; break; case "ExtraCost": ExtraCost = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public List<ImageInfo> imgList { get; private set; } // showable image list public Texture2D(ME3Package pccObj, int texIdx) { pccRef = pccObj; // check if texIdx is an Export index and a Texture2D class if (pccObj.isExport(texIdx) && (pccObj.Exports[texIdx].ClassName == className)) { IExportEntry expEntry = pccObj.Exports[texIdx]; properties = new Dictionary<string, PropertyReader.Property>(); byte[] rawData = expEntry.Data; int propertiesOffset = PropertyReader.detectStart(pccObj, rawData, expEntry.ObjectFlags); headerData = new byte[propertiesOffset]; Buffer.BlockCopy(rawData, 0, headerData, 0, propertiesOffset); pccOffset = (uint)expEntry.DataOffset; List<PropertyReader.Property> tempProperties = PropertyReader.getPropList(expEntry); texName = expEntry.ObjectName; for (int i = 0; i < tempProperties.Count; i++) { PropertyReader.Property property = tempProperties[i]; if (!properties.ContainsKey(pccObj.Names[property.Name])) properties.Add(pccObj.Names[property.Name], property); switch (pccObj.Names[property.Name]) { case "Format": texFormat = pccObj.Names[property.Value.IntValue].Substring(3); break; case "TextureFileCacheName": arcName = pccObj.Names[property.Value.IntValue]; break; case "LODGroup": LODGroup = pccObj.Names[property.Value.IntValue]; break; case "None": dataOffset = (uint)(property.offsetval + property.Size); break; } } // if "None" property isn't found throws an exception if (dataOffset == 0) throw new Exception("\"None\" property not found"); else { imageData = new byte[rawData.Length - dataOffset]; Buffer.BlockCopy(rawData, (int)dataOffset, imageData, 0, (int)(rawData.Length - dataOffset)); } } else throw new Exception("Texture2D " + texIdx + " not found"); pccExpIdx = texIdx; MemoryStream dataStream = new MemoryStream(imageData); numMipMaps = dataStream.ReadValueU32(); uint count = numMipMaps; imgList = new List<ImageInfo>(); while (dataStream.Position < dataStream.Length && count > 0) { ImageInfo imgInfo = new ImageInfo(); imgInfo.storageType = (storage)dataStream.ReadValueS32(); imgInfo.uncSize = dataStream.ReadValueS32(); imgInfo.cprSize = dataStream.ReadValueS32(); imgInfo.offset = dataStream.ReadValueS32(); if (imgInfo.storageType == storage.pccSto) { //imgInfo.offset = (int)(pccOffset + dataOffset); // saving pcc offset as relative to exportdata offset, not absolute imgInfo.offset = (int)dataStream.Position; // saving pcc offset as relative to exportdata offset, not absolute //MessageBox.Show("Pcc class offset: " + pccOffset + "\nimages data offset: " + imgInfo.offset.ToString()); dataStream.Seek(imgInfo.uncSize, SeekOrigin.Current); } imgInfo.imgSize = new ImageSize(dataStream.ReadValueU32(), dataStream.ReadValueU32()); imgList.Add(imgInfo); count--; } // save what remains /*int remainingBytes = (int)(dataStream.Length - dataStream.Position); footerData = new byte[remainingBytes]; dataStream.Read(footerData, 0, footerData.Length);*/ }
public BioTriggerVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bProcessAllActors": if (p.raw[p.raw.Length - 1] == 1) bProcessAllActors = true; break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) bBlockActors = true; break; case "Enabled": if (p.raw[p.raw.Length - 1] == 1) Enabled = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "OneShot": if (p.raw[p.raw.Length - 1] == 1) OneShot = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "LocationPriority": LocationPriority = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion } MyMatrix = Matrix.Translation(location); }
public StaticMeshActor(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { string s =pcc.getNameEntry(p.Name); switch (s) { #region case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bCollideComplex": if (p.raw[p.raw.Length - 1] == 1) bCollideComplex = true; break; case "bHiddenEd": if (p.raw[p.raw.Length - 1] == 1) bHiddenEd = true; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "StaticMeshComponent": StaticMeshComponent = p.Value.IntValue; if (pcc.isExport(StaticMeshComponent - 1) && pcc.Exports[StaticMeshComponent - 1].ClassName == "StaticMeshComponent") STMC = new StaticMeshComponent(pcc, StaticMeshComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion case "DrawScale3D": DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; } } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(DrawScale3D); MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale)); Vector3 rot = RotatorToDX(Rotator); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(location); }
public BioTriggerVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bProcessAllActors": if (p.raw[p.raw.Length - 1] == 1) { bProcessAllActors = true; } break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) { bBlockActors = true; } break; case "Enabled": if (p.raw[p.raw.Length - 1] == 1) { Enabled = true; } break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "OneShot": if (p.raw[p.raw.Length - 1] == 1) { OneShot = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "LocationPriority": LocationPriority = p.Value.IntValue; break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; #endregion } } MyMatrix = Matrix.Translation(location); }
public StaticMeshComponent (ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "LightMapEncoding": LightMapEncoding = p.Value.IntValue; break; case "RBChannel": RBChannel = p.Value.IntValue; break; case "DepthPriorityGroup": DepthPriorityGroup = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bIgnoreInstanceForTextureStreaming": if (p.raw[p.raw.Length - 1] == 1) bIgnoreInstanceForTextureStreaming = true; break; case "CastShadow": if (p.raw[p.raw.Length - 1] == 1) CastShadow = true; break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) CollideActors = true; break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) BlockRigidBody = true; break; case "bForceDirectLightMap": if (p.raw[p.raw.Length - 1] == 1) bForceDirectLightMap = true; break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) bCastDynamicShadow = true; break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDominantLightShadows = true; break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsLights = true; break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicLights = true; break; case "bCullModulatedShadowOnBackfaces": if (p.raw[p.raw.Length - 1] == 1) bCullModulatedShadowOnBackfaces = true; break; case "bCullModulatedShadowOnEmissive": if (p.raw[p.raw.Length - 1] == 1) bCullModulatedShadowOnEmissive = true; break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowAmbientOcclusion = true; break; case "bUsePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) bUsePrecomputedShadows = true; break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) CanBlockCamera = true; break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) bAllowShadowFade = true; break; case "bBioIsReceivingDecals": if (p.raw[p.raw.Length - 1] == 1) bBioIsReceivingDecals = true; break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockNonZeroExtent = true; break; case "bAcceptsStaticDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsStaticDecals = true; break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) bAcceptsDynamicDecals = true; break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) bAcceptsFoliage = true; break; case "HiddenGame": if (p.raw[p.raw.Length - 1] == 1) HiddenGame = true; break; case "bBioForcePrecomputedShadows": if (p.raw[p.raw.Length - 1] == 1) bBioForcePrecomputedShadows = true; break; case "bCastHiddenShadow": if (p.raw[p.raw.Length - 1] == 1) bCastHiddenShadow = true; break; case "bUseAsOccluder": if (p.raw[p.raw.Length - 1] == 1) bUseAsOccluder = true; break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) BlockZeroExtent = true; break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) bAllowCullDistanceVolume = true; break; case "bAllowApproximateOcclusion": if (p.raw[p.raw.Length - 1] == 1) bAllowApproximateOcclusion = true; break; case "bSelfShadowOnly": if (p.raw[p.raw.Length - 1] == 1) bSelfShadowOnly = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "bUseOnePassLightingOnTranslucency": if (p.raw[p.raw.Length - 1] == 1) bUseOnePassLightingOnTranslucency = true; break; case "bLockLightingCache": if (p.raw[p.raw.Length - 1] == 1) bLockLightingCache = true; break; case "bDisableAllRigidBody": if (p.raw[p.raw.Length - 1] == 1) bDisableAllRigidBody = true; break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) BlockActors = true; break; case "bNotifyRigidBodyCollision": if (p.raw[p.raw.Length - 1] == 1) bNotifyRigidBodyCollision = true; break; case "bIgnoreRadialImpulse": if (p.raw[p.raw.Length - 1] == 1) bIgnoreRadialImpulse = true; break; case "bIgnoreRadialForce": if (p.raw[p.raw.Length - 1] == 1) bIgnoreRadialForce = true; break; case "HiddenEditor": if (p.raw[p.raw.Length - 1] == 1) HiddenEditor = true; break; case "StaticMesh": StaticMesh_ = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "ShadowParent": ShadowParent = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "MaxDrawDistance": MaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CachedMaxDrawDistance": CachedMaxDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MinDrawDistance": MinDrawDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioObstruction": AudioObstruction = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "AudioOcclusion": AudioOcclusion = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "OverriddenLODMaxRange": OverriddenLODMaxRange = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale": Scale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "Scale3D": Scale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "Rotation": Rotation = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12), BitConverter.ToInt32(p.raw, p.raw.Length - 8), BitConverter.ToInt32(p.raw, p.raw.Length - 4)); break; case "Translation": Translation = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; case "MassiveLODDistance": MassiveLODDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "MotionBlurScale": MotionBlurScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TranslucencySortPriority": TranslucencySortPriority = p.Value.IntValue; break; case "LocalTranslucencySortPriority": LocalTranslucencySortPriority = p.Value.IntValue; break; case "ForcedLodModel": ForcedLodModel = p.Value.IntValue; break; #endregion } if (StaticMesh_ - 1 >= 0 && StaticMesh_ - 1 < pcc.Exports.Count) if (pcc.Exports[StaticMesh_ - 1].ClassName == "StaticMesh") { STM = new StaticMesh(pcc, StaticMesh_ - 1); STM.Mesh.Bounds.t = null;//save memory STM.Mesh.Edges.t = null; STM.Mesh.Buffers.t = null; STM.Mesh.IdxBuf.t = null; STM.Mesh.kDOPTree.t = null; STM.Mesh.Mat.t = null; STM.Mesh.RawTris.t = null; STM.Mesh.UnknownPart.t = null; STM.Mesh.Vertices.t = null; } MyMatrix = Matrix.Identity; MyMatrix *= Matrix.Scaling(Scale3D); MyMatrix *= Matrix.Scaling(Scale, Scale, Scale); Vector3 rot = RotatorToDX(Rotation); MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z); MyMatrix *= Matrix.Translation(Translation); }
public TargetPoint(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) bHardAttach = true; break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) bShadowParented = true; break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) bLockLocation = true; break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) bIgnoreBaseRotation = true; break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) bHidden = true; break; case "bEdShouldSnap": if (p.raw[p.raw.Length - 1] == 1) bEdShouldSnap = true; break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "TickFrequencyAtEndDistance": TickFrequencyAtEndDistance = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public WwiseEnvironmentVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "Settings": Settings = p.Value.IntValue; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") { brush = new BrushComponent(pcc, BrushComponent - 1); } break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Priority": Priority = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); location.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); location.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; } } MyMatrix = Matrix.Translation(location); }
public BrushComponent(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { case "RBChannel": RBChannel = p.Value.IntValue; break; case "BlockRigidBody": if (p.raw[p.raw.Length - 1] == 1) { BlockRigidBody = true; } break; case "CollideActors": if (p.raw[p.raw.Length - 1] == 1) { CollideActors = true; } break; case "CanBlockCamera": if (p.raw[p.raw.Length - 1] == 1) { CanBlockCamera = true; } break; case "BlockZeroExtent": if (p.raw[p.raw.Length - 1] == 1) { BlockZeroExtent = true; } break; case "BlockNonZeroExtent": if (p.raw[p.raw.Length - 1] == 1) { BlockNonZeroExtent = true; } break; case "BlockActors": if (p.raw[p.raw.Length - 1] == 1) { BlockActors = true; } break; case "bAcceptsDynamicDecals": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDecals = true; } break; case "bCastDynamicShadow": if (p.raw[p.raw.Length - 1] == 1) { bCastDynamicShadow = true; } break; case "bAcceptsDynamicDominantLightShadows": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicDominantLightShadows = true; } break; case "bAcceptsLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsLights = true; } break; case "bAcceptsDynamicLights": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsDynamicLights = true; } break; case "bAllowCullDistanceVolume": if (p.raw[p.raw.Length - 1] == 1) { bAllowCullDistanceVolume = true; } break; case "bAcceptsFoliage": if (p.raw[p.raw.Length - 1] == 1) { bAcceptsFoliage = true; } break; case "bAllowAmbientOcclusion": if (p.raw[p.raw.Length - 1] == 1) { bAllowAmbientOcclusion = true; } break; case "bAllowShadowFade": if (p.raw[p.raw.Length - 1] == 1) { bAllowShadowFade = true; } break; case "Brush": Brush = p.Value.IntValue; break; case "ReplacementPrimitive": ReplacementPrimitive = p.Value.IntValue; break; case "PhysMaterialOverride": PhysMaterialOverride = p.Value.IntValue; break; case "CachedPhysBrushDataVersion": CachedPhysBrushDataVersion = p.Value.IntValue; break; case "BrushAggGeom": ReadMesh(p.raw); break; } } }
public BioPathPoint(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "bHasCrossLevelPaths": if (p.raw[p.raw.Length - 1] == 1) { bHasCrossLevelPaths = true; } break; case "bEnabled": if (p.raw[p.raw.Length - 1] == 1) { bEnabled = true; } break; case "bBlocked": if (p.raw[p.raw.Length - 1] == 1) { bBlocked = true; } break; case "bPathsChanged": if (p.raw[p.raw.Length - 1] == 1) { bPathsChanged = true; } break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) { bHiddenEdGroup = true; } break; case "bMakeSourceOnly": if (p.raw[p.raw.Length - 1] == 1) { bMakeSourceOnly = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "CylinderComponent": CylinderComponent = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "nextNavigationPoint": nextNavigationPoint = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "visitedWeight": visitedWeight = p.Value.IntValue; break; case "bestPathWeight": bestPathWeight = p.Value.IntValue; break; case "NetworkID": NetworkID = p.Value.IntValue; break; case "ApproximateLineOfFire": ApproximateLineOfFire = p.Value.IntValue; break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public Emitter(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc.Exports[Index]); foreach (PropertyReader.Property p in Props) { switch (pcc.getNameEntry(p.Name)) { #region case "Physics": Physics = p.Value.IntValue; break; case "TickGroup": TickGroup = p.Value.IntValue; break; case "bNoVFXSound": if (p.raw[p.raw.Length - 1] == 1) { bNoVFXSound = true; } break; case "bHidden": if (p.raw[p.raw.Length - 1] == 1) { bHidden = true; } break; case "bShadowParented": if (p.raw[p.raw.Length - 1] == 1) { bShadowParented = true; } break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) { bCanStepUpOn = true; } break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) { bPathColliding = true; } break; case "bHardAttach": if (p.raw[p.raw.Length - 1] == 1) { bHardAttach = true; } break; case "bBioSnapToBase": if (p.raw[p.raw.Length - 1] == 1) { bBioSnapToBase = true; } break; case "bCurrentlyActive": if (p.raw[p.raw.Length - 1] == 1) { bCurrentlyActive = true; } break; case "bIgnoreBaseRotation": if (p.raw[p.raw.Length - 1] == 1) { bIgnoreBaseRotation = true; } break; case "bLockLocation": if (p.raw[p.raw.Length - 1] == 1) { bLockLocation = true; } break; case "bPostUpdateTickGroup": if (p.raw[p.raw.Length - 1] == 1) { bPostUpdateTickGroup = true; } break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "BaseBoneName": BaseBoneName = p.Value.IntValue; break; case "UniqueTag": UniqueTag = p.Value.IntValue; break; case "ParticleSystemComponent": ParticleSystemComponent = p.Value.IntValue; break; case "LightEnvironment": LightEnvironment = p.Value.IntValue; break; case "Base": Base = p.Value.IntValue; break; case "BaseSkelComponent": BaseSkelComponent = p.Value.IntValue; break; case "DrawScale": DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "CreationTime": CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4); break; case "location": location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12), BitConverter.ToSingle(p.raw, p.raw.Length - 8), BitConverter.ToSingle(p.raw, p.raw.Length - 4)); break; #endregion } } MyMatrix = Matrix.Translation(location); GenerateMesh(); }
public BlockingVolume(ME3Package Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) data = pcc.Exports[Index].Data; Props = PropertyReader.getPropList(pcc.Exports[Index]); Vector3 v; Tag = -1; Group = -1; foreach (PropertyReader.Property p in Props) switch (pcc.getNameEntry(p.Name)) { #region Props case "bAllowFluidSurfaceInteraction": if (p.raw[p.raw.Length - 1] == 1) bAllowFluidSurfaceInteraction = true; break; case "bBlockCamera": if (p.raw[p.raw.Length - 1] == 1) bBlockCamera = true; break; case "bCanStepUpOn": if (p.raw[p.raw.Length - 1] == 1) bCanStepUpOn = true; break; case "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) bCollideActors = true; break; case "bHiddenEdGroup": if (p.raw[p.raw.Length - 1] == 1) bHiddenEdGroup = true; break; case "bInclusionaryList": if (p.raw[p.raw.Length - 1] == 1) bInclusionaryList = true; break; case "bPathColliding": if (p.raw[p.raw.Length - 1] == 1) bPathColliding = true; break; case "bSafeFall": if (p.raw[p.raw.Length - 1] == 1) bSafeFall = true; break; case "OverridePhysMat": if (p.raw[p.raw.Length - 1] == 1) OverridePhysMat = true; break; case "Brush": Brush = p.Value.IntValue; break; case "BrushComponent": BrushComponent = p.Value.IntValue; if (pcc.isExport(BrushComponent - 1) && pcc.Exports[BrushComponent - 1].ClassName == "BrushComponent") brush = new BrushComponent(pcc, BrushComponent - 1); break; case "CollisionComponent": CollisionComponent = p.Value.IntValue; break; case "Tag": Tag = p.Value.IntValue; break; case "Group": Group = p.Value.IntValue; break; case "location": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); location = v; break; case "DrawScale3D": v.X = BitConverter.ToSingle(p.raw, p.raw.Length - 12); v.Y = BitConverter.ToSingle(p.raw, p.raw.Length - 8); v.Z = BitConverter.ToSingle(p.raw, p.raw.Length - 4); DrawScale3D = v; break; #endregion } MyMatrix = Matrix.Scaling(DrawScale3D) * Matrix.Translation(location); }