public AnimSet(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 BioAnimSetData(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 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 StaticMeshCollectionActor(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 BioPlaypenVolumeAdditive(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 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 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 AnimTree(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; AnimGroups = new List <AnimGroupEntry>(); ComposePrePassBoneNames = new List <string>(); SkelControlLists = new List <SkelControlListEntry>(); Children = new List <ChildrenEntry>(); BitConverter.IsLittleEndian = true; 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(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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(PCCObject Pcc, int Index) { Vector3 r = new Vector3(); if (!Pcc.isExport(Index)) { return(new Vector3()); } List <PropertyReader.Property> pp = PropertyReader.getPropList(Pcc, 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(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 StaticMeshComponent(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 void ReadObjects(int off) { BitConverter.IsLittleEndian = true; 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); PCCObject.ExportEntry 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 InterpActor(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 BioTriggerVolume(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 WwiseEnvironmentVolume(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 CoverSlotMarker(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 "bCollideActors": if (p.raw[p.raw.Length - 1] == 1) { bCollideActors = true; } break; case "bBlockActors": if (p.raw[p.raw.Length - 1] == 1) { bBlockActors = 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 "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 "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 StaticMeshActor(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 TargetPoint(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 DecalComponent(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 TreeNode ReadToken() { if (memory[GlobalPointer] == 0x53) { foundEnd = true; } bool isNative = ((memory[GlobalPointer] & 0xF0) == 0x70); string temp = "GlPtr: 0x" + GlobalPointer.ToString("X4") + " VirtPtr: 0x" + VirtualPointer.ToString("X4") + " OPC: 0x"; int index; if (isNative) { index = ((memory[GlobalPointer] - 0x70) << 8) + memory[GlobalPointer + 1]; } else { index = memory[GlobalPointer]; } temp += index.ToString("X4"); TreeNode t = new TreeNode(temp); string pat = OPCodes.GetPattern(memory, GlobalPointer); if (!isNative) { GlobalPointer += 1; } else { GlobalPointer += 2; } VirtualPointer += 4; int pos = 0; string s = ""; while (pos < pat.Length) { if (pat[pos] != '%') { s += pat[pos]; pos++; } else { if (s != "") { t.Nodes.Add(s); } s = ""; char c = pat[pos + 1]; pos += 2; int n; float f; switch (c) { case 'o': case 'O': n = BitConverter.ToInt32(memory, GlobalPointer); if (n > 0) { n--; if (pcc.isExport(n)) { t.Nodes.Add(pcc.Exports[n].ObjectName); } } else if (n < 0) { n++; if (pcc.isImport(n)) { t.Nodes.Add(pcc.Imports[n].ObjectName); } } GlobalPointer += 4; VirtualPointer += 4; break; case '1': n = BitConverter.ToInt32(memory, GlobalPointer); if (n > 0) { n--; if (pcc.isExport(n)) { t.Nodes.Add(pcc.Exports[n].ClassName); t.Nodes.Add(pcc.Exports[n].ObjectName); } } else if (n < 0) { n++; if (pcc.isImport(n)) { t.Nodes.Add(pcc.Imports[n].ClassName); t.Nodes.Add(pcc.Imports[n].ObjectName); } } GlobalPointer += 4; VirtualPointer += 4; break; case 's': case 'S': n = BitConverter.ToInt16(memory, GlobalPointer); t.Nodes.Add(n.ToString("X4")); GlobalPointer += 2; VirtualPointer += 2; break; case 'f': case 'F': f = BitConverter.ToSingle(memory, GlobalPointer); t.Nodes.Add(f.ToString() + "f"); GlobalPointer += 4; VirtualPointer += 4; break; case 'b': case 'B': t.Nodes.Add(memory[GlobalPointer].ToString("X")); GlobalPointer += 1; VirtualPointer += 1; break; case 'i': case 'I': n = BitConverter.ToInt32(memory, GlobalPointer); t.Nodes.Add(n.ToString("X8")); GlobalPointer += 4; VirtualPointer += 4; break; case 't': case 'T': t.Nodes.Add(ReadToken()); break; case 'n': case 'N': int count = 0; while (memory[GlobalPointer] != 0x16) { if (count++ == 0) { t.Nodes.Add(ReadToken()); } else { t.Nodes.Add(","); t.Nodes.Add(ReadToken()); } } GlobalPointer += 1; VirtualPointer += 4; break; } } } if (s != "") { t.Nodes.Add(s); } return(t); }
public DecalActor(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 PathNode(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 "bPathsChanged": if (p.raw[p.raw.Length - 1] == 1) { bPathsChanged = true; } break; case "bOneWayPath": if (p.raw[p.raw.Length - 1] == 1) { bOneWayPath = 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 "Base": Base = p.Value.IntValue; break; case "CollisionComponent": CollisionComponent = 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 "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(); }
} // showable image list public Texture2D(PCCObject 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)) { PCCObject.ExportEntry expEntry = pccObj.Exports[texIdx]; properties = new Dictionary <string, PropertyReader.Property>(); byte[] rawData = (byte[])expEntry.Data.Clone(); int propertiesOffset = PropertyReader.detectStart(pccObj, rawData); headerData = new byte[propertiesOffset]; Buffer.BlockCopy(rawData, 0, headerData, 0, propertiesOffset); pccOffset = (uint)expEntry.DataOffset; List <PropertyReader.Property> tempProperties = PropertyReader.getPropList(pccObj, rawData); 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 BrushComponent(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 AnimSequence(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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 BlockingVolume(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 Emitter(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, data); BitConverter.IsLittleEndian = true; 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 SplineActor(PCCObject Pcc, int Index) { pcc = Pcc; MyIndex = Index; if (pcc.isExport(Index)) { data = pcc.Exports[Index].Data; } Props = PropertyReader.getPropList(pcc, pcc.Exports[Index]); BitConverter.IsLittleEndian = true; 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(); }