//methods...
        /// <summary>
        /// Read関数
        /// </summary>
        /// <remarks>この関数はMotionManagerから呼び出される。呼び出し時にはマジック文字とバージョン番号が読まれた状態で渡される</remarks>
        /// <param name="reader">ヘッダ読み込み済みのBinaryReader</param>
        /// <param name="coordinate">変換先座標系</param>
        /// <param name="scale">スケーリング値</param>
        public void Read(BinaryReader reader, CoordinateType coordinate, float scale)
        {
            Coordinate = coordinate;//座標系セット
            //モデル名読み込み
            ModelName = GetString(reader.ReadBytes(20));
            //ボーンモーションデータ読み込み
            DWORD motion_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            Motions = new MotionData[motion_count];
            for (long i = 0; i < Motions.LongLength; i++)
            {
                Motions[i] = new MotionData();
                Motions[i].Read(reader, CoordZ, scale);
            }
            //フェイスモーションデータ読み込み
            DWORD face_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            FaceMotions = new FaceMotionData[face_count];
            for (long i = 0; i < FaceMotions.LongLength; i++)
            {
                FaceMotions[i] = new FaceMotionData();
                FaceMotions[i].Read(reader);
            }
            //カメラモーション読み込み
            DWORD camera_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            CameraMotions = new CameraMotionData[camera_count];
            for (long i = 0; i < CameraMotions.LongLength; i++)
            {
                CameraMotions[i] = new CameraMotionData();
                CameraMotions[i].Read(reader, CoordZ);
            }
            //ライトモーション読み込み
            DWORD light_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);

            LightMotions = new LightMotionData[light_count];
            for (long i = 0; i < LightMotions.LongLength; i++)
            {
                LightMotions[i] = new LightMotionData();
                LightMotions[i].Read(reader, CoordZ);
            }
        }
Example #2
0
 //methods...
 /// <summary>
 /// Read関数
 /// </summary>
 /// <remarks>この関数はMotionManagerから呼び出される。呼び出し時にはマジック文字とバージョン番号が読まれた状態で渡される</remarks>
 /// <param name="reader">ヘッダ読み込み済みのBinaryReader</param>
 /// <param name="coordinate">変換先座標系</param>
 /// <param name="scale">スケーリング値</param>
 public void Read(BinaryReader reader, CoordinateType coordinate, float scale)
 {
     Coordinate = coordinate;//座標系セット
     //モデル名読み込み
     ModelName = GetString(reader.ReadBytes(20));
     //ボーンモーションデータ読み込み
     DWORD motion_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     Motions = new MotionData[motion_count];
     for (long i = 0; i < Motions.LongLength; i++)
     {
         Motions[i] = new MotionData();
         Motions[i].Read(reader, CoordZ, scale);
     }
     //フェイスモーションデータ読み込み
     DWORD face_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     FaceMotions = new FaceMotionData[face_count];
     for (long i = 0; i < FaceMotions.LongLength; i++)
     {
         FaceMotions[i] = new FaceMotionData();
         FaceMotions[i].Read(reader);
     }
     //カメラモーション読み込み
     DWORD camera_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     CameraMotions = new CameraMotionData[camera_count];
     for (long i = 0; i < CameraMotions.LongLength; i++)
     {
         CameraMotions[i] = new CameraMotionData();
         CameraMotions[i].Read(reader, CoordZ);
     }
     //ライトモーション読み込み
     DWORD light_count = BitConverter.ToUInt32(reader.ReadBytes(4), 0);
     LightMotions = new LightMotionData[light_count];
     for (long i = 0; i < LightMotions.LongLength; i++)
     {
         LightMotions[i] = new LightMotionData();
         LightMotions[i].Read(reader, CoordZ);
     }
 }