Ejemplo n.º 1
0
 public ベジェ回転アニメ遷移(Quaternion 目標値, double 持続時間sec, VMDFormat.ベジェ曲線 ベジェ曲線)
 {
     this.開始値     = Quaternion.Identity;
     this.終了値     = 目標値;
     this.持続時間sec = 持続時間sec;
     this._ベジェ曲線  = ベジェ曲線;
 }
 public ベジェ移動アニメ遷移(Vector3 目標値, double 持続時間sec, VMDFormat.ベジェ曲線 ベジェ曲線X, VMDFormat.ベジェ曲線 ベジェ曲線Y, VMDFormat.ベジェ曲線 ベジェ曲線Z)
 {
     this.終了値     = 目標値;
     this.持続時間sec = 持続時間sec;
     this._ベジェ曲線X = ベジェ曲線X;
     this._ベジェ曲線Y = ベジェ曲線Y;
     this._ベジェ曲線Z = ベジェ曲線Z;
 }
Ejemplo n.º 3
0
        /// <summary>
        ///     指定されたストリームから読み込む。
        /// </summary>
        internal ボーンフレーム(Stream fs)
        {
            this.ボーン名   = ParserHelper.get_Shift_JISString(fs, 15);
            this.フレーム番号 = ParserHelper.get_DWORD(fs);
            this.ボーンの位置 = ParserHelper.get_Float3(fs);
            this.ボーンの回転 = ParserHelper.get_Quaternion(fs);

            // 補間データ[4][4][4]
            this.補間データ = new byte[4][][];
            for (int i = 0; i < 4; i++)
            {
                this.補間データ[i] = new byte[4][];
                for (int j = 0; j < 4; j++)
                {
                    this.補間データ[i][j] = new byte[4];
                    for (int k = 0; k < 4; k++)
                    {
                        this.補間データ[i][j][k] = ParserHelper.get_Byte(fs);
                    }
                }
            }

            // 補間データからベジェ曲線を生成する。
            // 補間データは、[0][0~3][0~4] のみ使用。
            this.ベジェ曲線 = new ベジェ曲線[4];
            for (int i = 0; i < 4; i++)
            {
                var curve = new ベジェ曲線()
                {
                    //v0 = new Vector2( 0, 0 ),
                    v1 = new Vector2((float)this.補間データ[0][0][i] / 128f, (float)this.補間データ[0][1][i] / 128f),                   // (0,0)側の方向点
                    v2 = new Vector2((float)this.補間データ[0][2][i] / 128f, (float)this.補間データ[0][3][i] / 128f),                   // (1,1)側の方向点
                    //v3 = new Vector2( 1, 1 ),
                };
                this.ベジェ曲線[i] = curve;
            }
        }
        /// <summary>
        ///     指定されたストリームから読み込む。
        /// </summary>
        internal カメラフレーム(Stream fs)
        {
            this.フレーム番号 = ParserHelper.get_DWORD(fs);
            this.距離     = ParserHelper.get_Float(fs);
            this.位置     = ParserHelper.get_Float3(fs);
            this.回転     = ParserHelper.get_Float3(fs);
            this.回転.X   = -this.回転.X; // カメラの回転量は正負が逆であるため、ここで符号を反転しておく。
            this.回転.Y   = -this.回転.Y;
            this.回転.Z   = -this.回転.Z;

            this.補間データ = new byte[6][];
            for (int i = 0; i < 6; i++)
            {
                this.補間データ[i] = new byte[4];
                for (int j = 0; j < 4; j++)
                {
                    this.補間データ[i][j] = ParserHelper.get_Byte(fs);
                }
            }

            this.視野角      = ParserHelper.get_DWORD(fs);
            this.パースペクティブ = (0 == ParserHelper.get_Byte(fs)) ? true : false;        // 0 が ON で 1 が OFF なので注意

            // 補間データからベジェ曲線を生成する。
            this.ベジェ曲線 = new ベジェ曲線[6];
            for (int i = 0; i < 6; i++)
            {
                var curve = new ベジェ曲線 {
                    //v0 = new Vector2( 0, 0 ),
                    v1 = new Vector2(this.補間データ[i][0] / 128f, this.補間データ[i][1] / 128f),
                    v2 = new Vector2(this.補間データ[i][2] / 128f, this.補間データ[i][3] / 128f),
                    //v3 = new Vector2( 1, 1 ),
                };
                this.ベジェ曲線[i] = curve;
            }
        }
 public ベジェ実数アニメ遷移(float 目標値, double 持続時間sec, VMDFormat.ベジェ曲線 ベジェ曲線)
 {
     this.終了値     = 目標値;
     this.持続時間sec = 持続時間sec;
     this._ベジェ曲線  = ベジェ曲線;
 }