Пример #1
0
        public AnimSet(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;
            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;
                }
        }
Пример #2
0
        public WwiseAudioVolume(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 "bLockLocation":
                        if (p.raw[p.raw.Length - 1] == 1)
                            bLockLocation = true;
                        break;
                    case "Tag":
                        Tag = p.Value.IntValue;
                        break;
                    case "UniqueTag":
                        UniqueTag = 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 "AudioComponent":
                        AudioComponent = 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 StaticMeshCollectionActor(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 "CreationTime":
                        CreationTime = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                        break;
                }
            ReadObjects();
            ReadMatrices();
        }
Пример #4
0
        public AnimTree(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;
            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;
                }
        }
Пример #5
0
        public BioAnimSetData(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;
            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;
                }
        }
Пример #6
0
        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();
        }
Пример #7
0
        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;
                }
        }
Пример #8
0
        public MantleMarker(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 "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();
        }
Пример #9
0
 public LightVolume(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 "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);
 }
Пример #10
0
        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);
        }
Пример #11
0
        public AnimSequence(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;
            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();
        }
Пример #12
0
        public SplineActor(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 "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();
        }
Пример #13
0
 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].Data);
     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;
 }
Пример #14
0
 public BioTriggerVolume(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 "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);
 }
Пример #15
0
 public BioPathPoint(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 "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();
 }
Пример #16
0
        public StaticMeshComponent (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 "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);
        }
Пример #17
0
 public InterpActor(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 "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);
 }
Пример #18
0
 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();
 }
Пример #19
0
 public StaticMeshActor(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)
     {
         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);
 }
Пример #20
0
        public TargetPoint(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 "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();
        }
Пример #21
0
 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                
 }
Пример #22
0
        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;
                        
                }
        }        
Пример #23
0
        public List<ImageInfo> imgList { get; private set; } // 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);*/
        }
Пример #24
0
 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);
 }
Пример #25
0
 public CoverLink(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 "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();
 }