示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Morph"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <param name="numVertices">The number vertices.</param>
        public Morph(NiFile file, BinaryReader reader, uint numVertices)
        {
            if (file.Version >= eNifVersion.VER_10_1_0_106)
            {
                this.FrameName = new NiString(file, reader);
            }
            if (file.Version <= eNifVersion.VER_10_1_0_0)
            {
                this.Keys = new KeyGroup <FloatKey>(reader);
            }
            if (file.Version >= eNifVersion.VER_10_1_0_106 && file.Version <= eNifVersion.VER_10_2_0_0)
            {
                this.UnkownInt = reader.ReadUInt32();
            }
            if (file.Version >= eNifVersion.VER_20_0_0_4 && file.Version <= eNifVersion.VER_20_1_0_3)
            {
                this.UnkownInt = reader.ReadUInt32();
            }
            this.Vectors = new Vector3[numVertices];
            int num = 0;

            while ((long)num < (long)((ulong)numVertices))
            {
                this.Vectors[num] = reader.ReadVector3();
                num++;
            }
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiKeyframeData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiKeyframeData(NiFile file, BinaryReader reader) : base(file, reader)
        {
            uint num = reader.ReadUInt32();

            if (num != 0u)
            {
                this.KeyType = (eKeyType)reader.ReadUInt32();
            }
            if (this.KeyType != eKeyType.XYZ_ROTATION_KEY)
            {
                this.QuaternionKeys = new QuatKey[num];
                int num2 = 0;
                while ((long)num2 < (long)((ulong)num))
                {
                    this.QuaternionKeys[num2] = new QuatKey(reader, this.KeyType);
                    num2++;
                }
            }
            if (base.Version <= eNifVersion.VER_10_1_0_0 && this.KeyType == eKeyType.XYZ_ROTATION_KEY)
            {
                this.UnkownFloat = reader.ReadSingle();
            }
            if (this.KeyType == eKeyType.XYZ_ROTATION_KEY)
            {
                this.Rotations = new KeyGroup <FloatKey> [3];
                for (int i = 0; i < 3; i++)
                {
                    this.Rotations[i] = new KeyGroup <FloatKey>(reader);
                }
            }
            this.Translations = new KeyGroup <VecKey>(reader);
            this.Scales       = new KeyGroup <FloatKey>(reader);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiUVData"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiUVData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.UTranslation      = new KeyGroup <FloatKey>(reader);
     this.VTranslation      = new KeyGroup <FloatKey>(reader);
     this.UScalingAndTiling = new KeyGroup <FloatKey>(reader);
     this.VScalingAndTiling = new KeyGroup <FloatKey>(reader);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiPosData"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiPosData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Data = new KeyGroup <VecKey>(reader);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiColorData" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiColorData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Data = new KeyGroup <Color4Key>(reader);
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiFloatData" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiFloatData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Data = new KeyGroup <FloatKey>(reader);
 }