WriteVmdString() static private method

static private WriteVmdString ( BinaryWriter bw, string s, int count, VmdVersion version ) : void
bw System.IO.BinaryWriter
s string
count int
version VmdVersion
return void
Exemplo n.º 1
0
 public void Write(BinaryWriter bw)
 {
     bw.Write(this.FrameTime);
     bw.Write(this.IsVisible ? (byte)1 : (byte)0);
     bw.Write(this.IKEnabled.Count);
     this.IKEnabled.ForEach(_ =>
     {
         VmdDocument.WriteVmdString(bw, _.Key, 20, VmdVersion.MMDVer2);
         bw.Write(_.Value ? (byte)1 : (byte)0);
     });
 }
Exemplo n.º 2
0
        public void Write(BinaryWriter bw, VmdVersion version)
        {
            VmdDocument.WriteVmdString(bw, this.Name, 15, version);
            bw.Write(this.FrameTime);
            this.Position.ForEach(bw.Write);
            this.Quaternion.ForEach(bw.Write);

            var x = this.XInterpolation;
            var y = this.YInterpolation;
            var z = this.ZInterpolation;
            var r = this.RotationInterpolation;

            var X_x1 = x[0].X;
            var X_y1 = x[0].Y;
            var Y_x1 = y[0].X;
            var Y_y1 = y[0].Y;
            var Z_x1 = z[0].X;
            var Z_y1 = z[0].Y;
            var R_x1 = r[0].X;
            var R_y1 = r[0].Y;
            var X_x2 = x[1].X;
            var X_y2 = x[1].Y;
            var Y_x2 = y[1].X;
            var Y_y2 = y[1].Y;
            var Z_x2 = z[1].X;
            var Z_y2 = z[1].Y;
            var R_x2 = r[1].X;
            var R_y2 = r[1].Y;

            bw.Write(new byte[]
            {
                X_x1, Y_x1, Z_x1, R_x1, X_y1, Y_y1, Z_y1, R_y1,
                X_x2, Y_x2, Z_x2, R_x2, X_y2, Y_y2, Z_y2, R_y2,
                Y_x1, Z_x1, R_x1, X_y1, Y_y1, Z_y1, R_y1, X_x2,
                Y_x2, Z_x2, R_x2, X_y2, Y_y2, Z_y2, R_y2, 01,
                Z_x1, R_x1, X_y1, Y_y1, Z_y1, R_y1, X_x2, Y_x2,
                Z_x2, R_x2, X_y2, Y_y2, Z_y2, R_y2, 01, 00,
                R_x1, X_y1, Y_y1, Z_y1, R_y1, X_x2, Y_x2, Z_x2,
                R_x2, X_y2, Y_y2, Z_y2, R_y2, 01, 00, 00
            });
        }
Exemplo n.º 3
0
 public void Write(BinaryWriter bw, VmdVersion version)
 {
     VmdDocument.WriteVmdString(bw, this.Name, 15, version);
     bw.Write(this.FrameTime);
     bw.Write(this.Weight);
 }