Пример #1
0
        public DecalActor(ME3Package Pcc, int Index)
        {
            pcc = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
                data = pcc.Exports[Index].Data;
            Props = PropertyReader.getPropList(pcc.Exports[Index]);
            
            foreach (PropertyReader.Property p in Props)
                switch (pcc.getNameEntry(p.Name))
                {

                    case "bCanStepUpOn":
                        if (p.raw[p.raw.Length - 1] == 1)
                            bCanStepUpOn = true;
                        break;
                    case "Tag":
                        Tag = p.Value.IntValue;
                        break;
                    case "Group":
                        Group = p.Value.IntValue;
                        break;
                    case "Decal":
                        Decal = p.Value.IntValue;
                        break;
                    case "DrawScale":
                        DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                        break;
                    case "DrawScale3D":
                        DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                        break;
                    case "Rotation":
                        Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                              BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                              BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                        break;
                    case "location":
                        location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                        break;
                }
            if (pcc.isExport(Decal - 1) && pcc.Exports[Decal - 1].ClassName == "DecalComponent")
                DC = new DecalComponent(pcc, Decal - 1);
            MyMatrix = Matrix.Identity;
            MyMatrix *= Matrix.Scaling(DrawScale3D);
            MyMatrix *= Matrix.Scaling(new Vector3(DrawScale, DrawScale, DrawScale));
            Vector3 rot = RotatorToDX(Rotator);
            MyMatrix *= Matrix.RotationYawPitchRoll(rot.X, rot.Y, rot.Z);
            MyMatrix *= Matrix.Translation(location);
        }
Пример #2
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);
        }
Пример #3
0
        public DecalActor(ME3Package Pcc, int Index)
        {
            pcc     = Pcc;
            MyIndex = Index;
            if (pcc.isExport(Index))
            {
                data = pcc.Exports[Index].Data;
            }
            Props = PropertyReader.getPropList(pcc.Exports[Index]);

            foreach (PropertyReader.Property p in Props)
            {
                switch (pcc.getNameEntry(p.Name))
                {
                case "bCanStepUpOn":
                    if (p.raw[p.raw.Length - 1] == 1)
                    {
                        bCanStepUpOn = true;
                    }
                    break;

                case "Tag":
                    Tag = p.Value.IntValue;
                    break;

                case "Group":
                    Group = p.Value.IntValue;
                    break;

                case "Decal":
                    Decal = p.Value.IntValue;
                    break;

                case "DrawScale":
                    DrawScale = BitConverter.ToSingle(p.raw, p.raw.Length - 4);
                    break;

                case "DrawScale3D":
                    DrawScale3D = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                              BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;

                case "Rotation":
                    Rotator = new Vector3(BitConverter.ToInt32(p.raw, p.raw.Length - 12),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 8),
                                          BitConverter.ToInt32(p.raw, p.raw.Length - 4));
                    break;

                case "location":
                    location = new Vector3(BitConverter.ToSingle(p.raw, p.raw.Length - 12),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 8),
                                           BitConverter.ToSingle(p.raw, p.raw.Length - 4));
                    break;
                }
            }
            if (pcc.isExport(Decal - 1) && pcc.Exports[Decal - 1].ClassName == "DecalComponent")
            {
                DC = new DecalComponent(pcc, Decal - 1);
            }
        }