Ejemplo n.º 1
0
 public void WriteBytesToStream(BinaryWriter iostream, float InPoint, float OutPoint, float min, float max)
 {
     iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(time, InPoint, OutPoint))));
     iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(key_element.X, min, max))));
     iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(key_element.Y, min, max))));
     iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(BinBVHUtil.FloatToUInt16(key_element.Z, min, max))));
 }
Ejemplo n.º 2
0
        public byte[] ToBytes()
        {
            byte[] outputbytes = new byte[0];

            BinaryWriter iostream = new BinaryWriter(new MemoryStream());

            iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(unknown0)));
            iostream.Write(BinBVHUtil.ES(Utils.UInt16ToBytes(unknown1)));
            iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(Priority)));
            iostream.Write(BinBVHUtil.ES(Utils.FloatToBytes(Length)));
            iostream.Write(BinBVHUtil.WriteNullTerminatedString(ExpressionName));
            iostream.Write(BinBVHUtil.ES(Utils.FloatToBytes(InPoint)));
            iostream.Write(BinBVHUtil.ES(Utils.FloatToBytes(OutPoint)));
            iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(Loop ? 1 : 0)));
            iostream.Write(BinBVHUtil.ES(Utils.FloatToBytes(EaseInTime)));
            iostream.Write(BinBVHUtil.ES(Utils.FloatToBytes(EaseOutTime)));
            iostream.Write(BinBVHUtil.ES(Utils.UIntToBytes(HandPose)));
            iostream.Write(BinBVHUtil.ES(Utils.UIntToBytes((uint)(Joints.Length))));

            for (int i = 0; i < Joints.Length; i++)
            {
                Joints[i].WriteBytesToStream(iostream, InPoint, OutPoint);
            }
            iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(0)));
            MemoryStream ms = (MemoryStream)iostream.BaseStream;

            outputbytes = ms.ToArray();
            ms.Close();
            iostream.Close();
            return(outputbytes);
        }
Ejemplo n.º 3
0
 public void WriteBytesToStream(BinaryWriter iostream, float InPoint, float OutPoint)
 {
     iostream.Write(BinBVHUtil.WriteNullTerminatedString(Name));
     iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(Priority)));
     iostream.Write(BinBVHUtil.ES(Utils.IntToBytes(rotationkeys.Length)));
     for (int i = 0; i < rotationkeys.Length; i++)
     {
         rotationkeys[i].WriteBytesToStream(iostream, InPoint, OutPoint, -1f, 1f);
     }
     iostream.Write(BinBVHUtil.ES(Utils.IntToBytes((positionkeys.Length))));
     for (int i = 0; i < positionkeys.Length; i++)
     {
         positionkeys[i].WriteBytesToStream(iostream, InPoint, OutPoint, -256f, 256f);
     }
 }