コード例 #1
0
        private void WriteCamera(BinaryWriter writer, uint Type, uint ID)
        {
            switch (Type)
            {
            default:
                throw new NotImplementedException();

            case 0xA19:
                Camera_Boss Camera1 = (Camera_Boss)Cameras[ID];

                writer.Write(Camera1.unkInt);
                writer.Write(Camera1.unkFloat1);
                writer.Write(Camera1.unkFloat2);
                for (int i = 0; i < Camera1.unkMatrix1.Length; ++i)
                {
                    writer.Write(Camera1.unkMatrix1[i].X);
                    writer.Write(Camera1.unkMatrix1[i].Y);
                    writer.Write(Camera1.unkMatrix1[i].Z);
                    writer.Write(Camera1.unkMatrix1[i].W);
                }
                for (int i = 0; i < Camera1.unkMatrix2.Length; ++i)
                {
                    writer.Write(Camera1.unkMatrix2[i].X);
                    writer.Write(Camera1.unkMatrix2[i].Y);
                    writer.Write(Camera1.unkMatrix2[i].Z);
                    writer.Write(Camera1.unkMatrix2[i].W);
                }
                writer.Write(Camera1.unkVector.X);
                writer.Write(Camera1.unkVector.Y);
                writer.Write(Camera1.unkVector.Z);
                writer.Write(Camera1.unkVector.W);
                writer.Write(Camera1.unkByte1);
                writer.Write(Camera1.unkFloat3);
                writer.Write(Camera1.unkFloat4);
                writer.Write(Camera1.unkFloat5);
                writer.Write(Camera1.unkFloat6);
                writer.Write(Camera1.unkByte2);

                break;

            case 0x1C02:
                Camera_Point Camera2 = (Camera_Point)Cameras[ID];

                writer.Write(Camera2.unkInt);
                writer.Write(Camera2.unkFloat1);
                writer.Write(Camera2.unkFloat2);
                writer.Write(Camera2.unkVector.X);
                writer.Write(Camera2.unkVector.Y);
                writer.Write(Camera2.unkVector.Z);
                writer.Write(Camera2.unkVector.W);

                break;

            case 0x1C03:
                Camera_Line Camera3 = (Camera_Line)Cameras[ID];

                writer.Write(Camera3.unkInt);
                writer.Write(Camera3.unkFloat1);
                writer.Write(Camera3.unkFloat2);
                writer.Write(Camera3.unkBoundingBoxVector1.X);
                writer.Write(Camera3.unkBoundingBoxVector1.Y);
                writer.Write(Camera3.unkBoundingBoxVector1.Z);
                writer.Write(Camera3.unkBoundingBoxVector1.W);
                writer.Write(Camera3.unkBoundingBoxVector2.X);
                writer.Write(Camera3.unkBoundingBoxVector2.Y);
                writer.Write(Camera3.unkBoundingBoxVector2.Z);
                writer.Write(Camera3.unkBoundingBoxVector2.W);

                break;

            case 0x1C04:
                Camera_Path Camera4 = (Camera_Path)Cameras[ID];

                writer.Write(Camera4.unkInt);
                writer.Write(Camera4.unkFloat1);
                writer.Write(Camera4.unkFloat2);
                writer.Write(Camera4.unkVectors.Length);
                for (int i = 0; i < Camera4.unkVectors.Length; ++i)
                {
                    writer.Write(Camera4.unkVectors[i].X);
                    writer.Write(Camera4.unkVectors[i].Y);
                    writer.Write(Camera4.unkVectors[i].Z);
                    writer.Write(Camera4.unkVectors[i].W);
                }
                writer.Write(Camera4.unkInt2);
                writer.Write(Camera4.unkData);

                break;

            case 0x1C05:
                break;

            case 0x1C06:
                Camera_Spline Camera6 = (Camera_Spline)Cameras[ID];

                writer.Write(Camera6.unkInt);
                writer.Write(Camera6.unkFloat1);
                writer.Write(Camera6.unkFloat2);
                writer.Write(Camera6.unkUInt);
                writer.Write(Camera6.unkFloat3);
                for (int i = 0; i < Camera6.unkVectors.Length; ++i)
                {
                    writer.Write(Camera6.unkVectors[i].X);
                    writer.Write(Camera6.unkVectors[i].Y);
                    writer.Write(Camera6.unkVectors[i].Z);
                    writer.Write(Camera6.unkVectors[i].W);
                }
                writer.Write(Camera6.unkData);
                writer.Write(Camera6.unkShort);

                break;

            case 0x1C09:
                Camera_0x1C09 Camera7 = (Camera_0x1C09)Cameras[ID];

                writer.Write(Camera7.unkInt);
                writer.Write(Camera7.unkFloat1);
                writer.Write(Camera7.unkFloat2);

                break;

            case 0x1C0B:
                Camera_Point2 Camera8 = (Camera_Point2)Cameras[ID];

                writer.Write(Camera8.unkInt);
                writer.Write(Camera8.unkFloat1);
                writer.Write(Camera8.unkFloat2);
                writer.Write(Camera8.unkVector.X);
                writer.Write(Camera8.unkVector.Y);
                writer.Write(Camera8.unkVector.Z);
                writer.Write(Camera8.unkVector.W);
                writer.Write(Camera8.unkFloat3);
                writer.Write(Camera8.unkByte);

                break;

            case 0x1C0C:
                Camera_0x1C0C Camera9 = (Camera_0x1C0C)Cameras[ID];

                writer.Write(Camera9.unkByte1);
                writer.Write(Camera9.unkByte2);
                writer.Write(Camera9.unkByte3);
                writer.Write(Camera9.unkByte4);

                break;

            case 0x1C0D:
                Camera_Line2 Camera10 = (Camera_Line2)Cameras[ID];

                writer.Write(Camera10.unkInt);
                writer.Write(Camera10.unkFloat1);
                writer.Write(Camera10.unkFloat2);
                writer.Write(Camera10.unkBoundingBoxVector1.X);
                writer.Write(Camera10.unkBoundingBoxVector1.Y);
                writer.Write(Camera10.unkBoundingBoxVector1.Z);
                writer.Write(Camera10.unkBoundingBoxVector1.W);
                writer.Write(Camera10.unkBoundingBoxVector2.X);
                writer.Write(Camera10.unkBoundingBoxVector2.Y);
                writer.Write(Camera10.unkBoundingBoxVector2.Z);
                writer.Write(Camera10.unkBoundingBoxVector2.W);
                writer.Write(Camera10.unkFloat3);
                writer.Write(Camera10.unkFloat4);

                break;

            case 0x1C0E:
                break;

            case 0x1C0F:
                Camera_Zone Camera12 = (Camera_Zone)Cameras[ID];

                for (int i = 0; i < Camera12.Data1_Vectors.Length; i++)
                {
                    writer.Write(Camera12.Data1_Vectors[i].X);
                    writer.Write(Camera12.Data1_Vectors[i].Y);
                    writer.Write(Camera12.Data1_Vectors[i].Z);
                    writer.Write(Camera12.Data1_Vectors[i].W);
                }
                writer.Write(Camera12.Data1_unkInt1);
                writer.Write(Camera12.Data1_unkInt2);
                writer.Write(Camera12.Data1_padding);

                for (int i = 0; i < Camera12.Data2_Vectors.Length; i++)
                {
                    writer.Write(Camera12.Data2_Vectors[i].X);
                    writer.Write(Camera12.Data2_Vectors[i].Y);
                    writer.Write(Camera12.Data2_Vectors[i].Z);
                    writer.Write(Camera12.Data2_Vectors[i].W);
                }
                writer.Write(Camera12.Data2_unkInt1);
                writer.Write(Camera12.Data2_unkInt2);
                writer.Write(Camera12.Data2_padding);

                break;
            }
        }
コード例 #2
0
        private void ReadCamera(BinaryReader reader, uint Type, uint ID)
        {
            switch (Type)
            {
            default:
                throw new NotImplementedException();

            case 0xA19:
                Camera_Boss Camera1 = new Camera_Boss();

                Camera1.unkInt     = reader.ReadUInt32();
                Camera1.unkFloat1  = reader.ReadSingle();
                Camera1.unkFloat2  = reader.ReadSingle();
                Camera1.unkMatrix1 = new Pos[4];
                for (int i = 0; i < Camera1.unkMatrix1.Length; ++i)
                {
                    Camera1.unkMatrix1[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera1.unkMatrix2 = new Pos[4];
                for (int i = 0; i < Camera1.unkMatrix2.Length; ++i)
                {
                    Camera1.unkMatrix2[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera1.unkVector = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Camera1.unkByte1  = reader.ReadByte();
                Camera1.unkFloat3 = reader.ReadSingle();
                Camera1.unkFloat4 = reader.ReadSingle();
                Camera1.unkFloat5 = reader.ReadSingle();
                Camera1.unkFloat6 = reader.ReadSingle();
                Camera1.unkByte2  = reader.ReadByte();

                Cameras[ID] = Camera1;
                break;

            case 0x1C02:
                Camera_Point Camera2 = new Camera_Point();

                Camera2.unkInt    = reader.ReadUInt32();
                Camera2.unkFloat1 = reader.ReadSingle();
                Camera2.unkFloat2 = reader.ReadSingle();
                Camera2.unkVector = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());

                Cameras[ID] = Camera2;
                break;

            case 0x1C03:
                Camera_Line Camera3 = new Camera_Line();

                Camera3.unkInt                = reader.ReadUInt32();
                Camera3.unkFloat1             = reader.ReadSingle();
                Camera3.unkFloat2             = reader.ReadSingle();
                Camera3.unkBoundingBoxVector1 = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Camera3.unkBoundingBoxVector2 = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());

                Cameras[ID] = Camera3;
                break;

            case 0x1C04:
                Camera_Path Camera4 = new Camera_Path();

                Camera4.unkInt    = reader.ReadUInt32();
                Camera4.unkFloat1 = reader.ReadSingle();
                Camera4.unkFloat2 = reader.ReadSingle();
                uint VectorCount = reader.ReadUInt32();
                Camera4.unkVectors = new Pos[VectorCount];
                for (int i = 0; i < VectorCount; ++i)
                {
                    Camera4.unkVectors[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera4.unkInt2 = reader.ReadInt32();
                Camera4.unkData = reader.ReadBytes(Camera4.unkInt2 * 0x8);

                Cameras[ID] = Camera4;
                break;

            case 0x1C05:
                Camera_0x1C05 Camera5 = new Camera_0x1C05();
                Cameras[ID] = Camera5;
                break;

            case 0x1C06:
                Camera_Spline Camera6 = new Camera_Spline();

                Camera6.unkInt     = reader.ReadInt32();
                Camera6.unkFloat1  = reader.ReadSingle();
                Camera6.unkFloat2  = reader.ReadSingle();
                Camera6.unkUInt    = reader.ReadUInt32();
                Camera6.unkFloat3  = reader.ReadSingle();
                Camera6.unkVectors = new Pos[(Camera6.unkUInt + 1) * 2];
                for (int i = 0; i < Camera6.unkVectors.Length; ++i)
                {
                    Camera6.unkVectors[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera6.unkData  = reader.ReadBytes((int)Camera6.unkUInt * 0x8);
                Camera6.unkShort = reader.ReadUInt16();

                Cameras[ID] = Camera6;
                break;

            case 0x1C09:
                Camera_0x1C09 Camera7 = new Camera_0x1C09();

                Camera7.unkInt    = reader.ReadUInt32();
                Camera7.unkFloat1 = reader.ReadSingle();
                Camera7.unkFloat2 = reader.ReadSingle();

                Cameras[ID] = Camera7;
                break;

            case 0x1C0B:
                Camera_Point2 Camera8 = new Camera_Point2();

                Camera8.unkInt    = reader.ReadUInt32();
                Camera8.unkFloat1 = reader.ReadSingle();
                Camera8.unkFloat2 = reader.ReadSingle();
                Camera8.unkVector = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Camera8.unkFloat3 = reader.ReadSingle();
                Camera8.unkByte   = reader.ReadByte();

                Cameras[ID] = Camera8;
                break;

            case 0x1C0C:
                Camera_0x1C0C Camera9 = new Camera_0x1C0C();

                Camera9.unkByte1 = reader.ReadByte();
                Camera9.unkByte2 = reader.ReadByte();
                Camera9.unkByte3 = reader.ReadByte();
                Camera9.unkByte4 = reader.ReadByte();

                Cameras[ID] = Camera9;
                break;

            case 0x1C0D:
                Camera_Line2 Camera10 = new Camera_Line2();

                Camera10.unkInt                = reader.ReadUInt32();
                Camera10.unkFloat1             = reader.ReadSingle();
                Camera10.unkFloat2             = reader.ReadSingle();
                Camera10.unkBoundingBoxVector1 = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Camera10.unkBoundingBoxVector2 = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                Camera10.unkFloat3             = reader.ReadSingle();
                Camera10.unkFloat4             = reader.ReadSingle();

                Cameras[ID] = Camera10;
                break;

            case 0x1C0E:
                Camera_0x1C0E Camera11 = new Camera_0x1C0E();
                Cameras[ID] = Camera11;
                break;

            case 0x1C0F:
                Camera_Zone Camera12 = new Camera_Zone();

                //Camera12.unkData1 = reader.ReadBytes(0x50);
                //Camera12.unkData2 = reader.ReadBytes(0x50);

                Camera12.Data1_Vectors = new Pos[4];
                for (int i = 0; i < Camera12.Data1_Vectors.Length; i++)
                {
                    Camera12.Data1_Vectors[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera12.Data1_unkInt1 = reader.ReadUInt32();
                Camera12.Data1_unkInt2 = reader.ReadUInt32();
                Camera12.Data1_padding = reader.ReadUInt64();

                Camera12.Data2_Vectors = new Pos[4];
                for (int i = 0; i < Camera12.Data2_Vectors.Length; i++)
                {
                    Camera12.Data2_Vectors[i] = new Pos(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
                }
                Camera12.Data2_unkInt1 = reader.ReadUInt32();
                Camera12.Data2_unkInt2 = reader.ReadUInt32();
                Camera12.Data2_padding = reader.ReadUInt64();

                Cameras[ID] = Camera12;
                break;
            }
        }