Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiAlphaController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiAlphaController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version <= eNifVersion.VER_10_1_0_0)
			{
				this.Data = new NiRef<NiFloatData>(reader);
			}
		}
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiVisController"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiVisController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version <= eNifVersion.VER_10_1_0_0)
			{
				this.Data = new NiRef<NiVisData>(reader);
			}
		}
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiObjectNET" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <exception cref="Exception">Unsupported Version!</exception>
        public NiObjectNET(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Name = new NiString(file, reader);
			if (this.File.Header.Version <= eNifVersion.VER_2_3)
			{
				throw new Exception("Unsupported Version!");
			}
			if (this.File.Header.Version >= eNifVersion.VER_3_0 && this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
			{
				this.ExtraData = new NiRef<NiExtraData>[1];
				this.ExtraData[0] = new NiRef<NiExtraData>(reader.ReadUInt32());
			}
			if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
			{
				uint num = reader.ReadUInt32();
				this.ExtraData = new NiRef<NiExtraData>[num];
				int num2 = 0;
				while ((long)num2 < (long)((ulong)num))
				{
					this.ExtraData[num2] = new NiRef<NiExtraData>(reader.ReadUInt32());
					num2++;
				}
			}
			if (this.File.Header.Version >= eNifVersion.VER_3_0)
			{
				this.Controller = new NiRef<NiTimeController>(reader.ReadUInt32());
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiGeomMorpherController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <exception cref="Exception">Version too new!</exception>
        public NiGeomMorpherController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version >= eNifVersion.VER_10_0_1_2)
			{
				this.ExtraFlags = reader.ReadUInt16();
			}
			if (base.Version == eNifVersion.VER_10_1_0_106)
			{
				this.Unknown2 = reader.ReadByte();
			}
			this.Data = new NiRef<NiMorphData>(reader);
			this.AlwaysUpdate = reader.ReadBoolean(Version);
			if (base.Version >= eNifVersion.VER_10_1_0_106)
			{
				this.NumInterpolators = reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_10_1_0_106 && base.Version < eNifVersion.VER_20_2_0_7)
			{
				this.Interpolators = new NiRef<NiInterpolator>[this.NumInterpolators];
				int num = 0;
				while ((long)num < (long)((ulong)this.NumInterpolators))
				{
					this.Interpolators[num] = new NiRef<NiInterpolator>(reader);
					num++;
				}
			}
			if (base.Version >= eNifVersion.VER_20_0_0_4)
			{
				throw new Exception("Version too new!");
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiSingleInterpController"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiSingleInterpController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version >= eNifVersion.VER_10_2_0_0)
			{
				this.Interpolator = new NiRef<NiInterpolator>(reader);
			}
		}
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiParticleModifier"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiParticleModifier(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Next = new NiRef<NiParticleModifier>(reader);
			if (this.File.Header.Version >= eNifVersion.VER_4_0_0_2)
			{
				this.Controller = new NiRef<NiParticleSystemController>(reader);
			}
		}
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiLookAtController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiLookAtController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.Unknown1 = reader.ReadUInt16();
			}
			this.CameraTargetNode = new NiRef<NiNode>(reader);
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiParticleMeshModifier" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiParticleMeshModifier(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.ParticleMeshes = new NiRef<NiAVObject>[reader.ReadUInt32()];
			for (int i = 0; i < this.ParticleMeshes.Length; i++)
			{
				this.ParticleMeshes[i] = new NiRef<NiAVObject>(reader);
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiTextureTransformController"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiTextureTransformController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Unkown2 = reader.ReadByte();
			this.TextureSlot = (eTexType)reader.ReadUInt32();
			this.Operation = (eTexTransform)reader.ReadUInt32();
			if (base.Version <= eNifVersion.VER_10_1_0_0)
			{
				this.Data = new NiRef<NiFloatData>(reader);
			}
		}
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiExtraData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiExtraData(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
			{
				this.Name = new NiString(file, reader);
			}
			if (this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
			{
				this.NextExtraData = new NiRef<NiExtraData>(reader.ReadUInt32());
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiPoint3InterpController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiPoint3InterpController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.TargetColor = (eTargetColor)reader.ReadUInt16();
			}
			if (base.Version <= eNifVersion.VER_10_1_0_0)
			{
				this.Data = new NiRef<NiPosData>(reader);
			}
		}
Exemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiPathController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiPathController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.Unknown1 = reader.ReadUInt16();
			}
			this.Unknown2 = reader.ReadUInt32();
			this.Unknown3 = reader.ReadSingle();
			this.Unknown4 = reader.ReadSingle();
			this.Unknown5 = reader.ReadUInt16();
			this.PosData = new NiRef<NiPosData>(reader);
			this.FloatData = new NiRef<NiFloatData>(reader);
		}
Exemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiNode"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiNode(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Children = new NiRef<NiAVObject>[reader.ReadUInt32()];
			for (int i = 0; i < this.Children.Length; i++)
			{
				this.Children[i] = new NiRef<NiAVObject>(reader.ReadUInt32());
			}
			this.Effects = new NiRef<NiDynamicEffect>[reader.ReadUInt32()];
			for (int j = 0; j < this.Effects.Length; j++)
			{
				this.Effects[j] = new NiRef<NiDynamicEffect>(reader.ReadUInt32());
			}
		}
Exemplo n.º 14
0
        public override void Deserialize(BitReader reader)
        {
            Name = reader.Read <NiStringRef>(File);

            ExtraData = new NiRef <NiExtraData> [reader.Read <uint>()];

            for (var i = 0; i < ExtraData.Length; i++)
            {
                ExtraData[i] = reader.Read <NiRef <NiExtraData> >(File);
            }

            Controller = reader.Read <NiRef <NiTimeController> >(File);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiFooter"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiFooter(NiFile file, BinaryReader reader)
		{
			if (file.Header.Version >= eNifVersion.VER_3_3_0_13)
			{
				uint num = reader.ReadUInt32();
				this.RootNodes = new NiRef<NiObject>[num];
				int num2 = 0;
				while ((long)num2 < (long)((ulong)num))
				{
					this.RootNodes[num2] = new NiRef<NiObject>(reader.ReadUInt32());
					num2++;
				}
			}
		}
Exemplo n.º 16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiDynamicEffect"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiDynamicEffect(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.SwitchState = true;
			if (base.Version >= eNifVersion.VER_10_1_0_106)
			{
				this.SwitchState = reader.ReadBoolean(Version);
			}
			if (base.Version <= eNifVersion.VER_4_0_0_2 || base.Version >= eNifVersion.VER_10_0_1_0)
			{
				this.AffectedNodes = new NiRef<NiAVObject>[reader.ReadUInt32()];
				for (int i = 0; i < this.AffectedNodes.Length; i++)
				{
					this.AffectedNodes[i] = new NiRef<NiAVObject>(reader);
				}
			}
		}
Exemplo n.º 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiSkinInstance"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiSkinInstance(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Data = new NiRef<NiSkinData>(reader);
			if (base.Version >= eNifVersion.VER_10_2_0_0)
			{
				this.Partition = new NiRef<NiSkinPartition>(reader);
			}
			this.SkeletonRoot = new NiRef<NiNode>(reader);
			uint num = reader.ReadUInt32();
			this.Bones = new NiRef<NiNode>[num];
			int num2 = 0;
			while ((long)num2 < (long)((ulong)num))
			{
				this.Bones[num2] = new NiRef<NiNode>(reader);
				num2++;
			}
		}
Exemplo n.º 18
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiTimeController"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiTimeController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.NextController = new NiRef<NiTimeController>(reader);
			this.Flags = reader.ReadUInt16();
			this.Frequency = reader.ReadSingle();
			this.Phase = reader.ReadSingle();
			this.StartTime = reader.ReadSingle();
			this.StopTime = reader.ReadSingle();
			if (file.Header.Version >= eNifVersion.VER_3_3_0_13)
			{
				this.Target = new NiRef<NiObjectNET>(reader);
			}
			if (file.Header.Version <= eNifVersion.VER_3_1)
			{
				this.UnkownInt = reader.ReadUInt32();
			}
		}
Exemplo n.º 19
0
        public override void Deserialize(BitReader reader)
        {
            base.Deserialize(reader);

            Children = new NiRef <NiAvObject> [reader.Read <uint>()];

            for (var i = 0; i < Children.Length; i++)
            {
                Children[i] = reader.Read <NiRef <NiAvObject> >(File);
            }

            Effects = new NiRef <NiDynamicEffect> [reader.Read <uint>()];

            for (var i = 0; i < Effects.Length; i++)
            {
                Effects[i] = reader.Read <NiRef <NiDynamicEffect> >(File);
            }
        }
Exemplo n.º 20
0
        public override void Deserialize(BitReader reader)
        {
            base.Deserialize(reader);

            Flags = reader.Read <ushort>();

            Position = reader.Read <Vector3>();

            Rotation = reader.Read <Matrix3X3>();

            Scale = reader.Read <float>();

            Properties = new NiRef <NiProperty> [reader.Read <uint>()];

            for (var i = 0; i < Properties.Length; i++)
            {
                Properties[i] = reader.Read <NiRef <NiProperty> >(File);
            }

            CollisionObject = reader.Read <NiRef <NiCollisionObject> >(File);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiLODNode" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiLODNode(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version >= eNifVersion.VER_4_0_0_2 && base.Version <= eNifVersion.VER_10_0_1_0)
			{
				this.LODCenter = reader.ReadVector3();
			}
			if (base.Version <= eNifVersion.VER_10_0_1_0)
			{
				uint num = reader.ReadUInt32();
				this.LODLevels = new LODRange[num];
				int num2 = 0;
				while ((long)num2 < (long)((ulong)num))
				{
					this.LODLevels[num2] = new LODRange(file, reader);
					num2++;
				}
			}
			if (base.Version >= eNifVersion.VER_10_0_1_0)
			{
				this.LODLevelData = new NiRef<NiLODData>(reader);
			}
		}
Exemplo n.º 22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiGeometry"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <exception cref="Exception">unsupported data</exception>
        public NiGeometry(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Data = new NiRef<NiGeometryData>(reader);
			if (base.Version >= eNifVersion.VER_3_3_0_13)
			{
				this.SkinInstance = new NiRef<NiSkinInstance>(reader);
			}
			if (base.Version >= eNifVersion.VER_20_2_0_7)
			{
				this.MaterialNames = new NiString[reader.ReadUInt32()];
				for (int i = 0; i < this.MaterialNames.Length; i++)
				{
					this.MaterialNames[i] = new NiString(file, reader);
				}
				this.MaterialExtraData = new int[this.MaterialNames.Length];
				for (int j = 0; j < this.MaterialNames.Length; j++)
				{
					this.MaterialExtraData[j] = reader.ReadInt32();
				}
				this.ActiveMaterial = reader.ReadInt32();
			}
			if (base.Version >= eNifVersion.VER_10_0_1_0 && base.Version <= eNifVersion.VER_20_1_0_3)
			{
				this.HasShader = reader.ReadBoolean(Version);
				if (this.HasShader)
				{
					this.ShaderName = new NiString(file, reader).Value;
					this.UnkownInteger = reader.ReadUInt32();
				}
			}
			if (base.Version == eNifVersion.VER_10_4_0_1)
			{
				reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_20_2_0_7)
			{
				throw new Exception("unsupported data");
			}
		}
Exemplo n.º 23
0
        public override void Deserialize(BitReader reader)
        {
            base.Deserialize(reader);

            Data = reader.Read <NiRef <NiGeometryData> >(File);

            Skin = reader.Read <NiRef <NiSkinInstance> >(File);

            Materials = new string[reader.Read <uint>()];

            MaterialExtraData = new NiRef <NiExtraData> [Materials.Length];

            for (var i = 0; i < Materials.Length; i++)
            {
                Materials[i] = reader.ReadNiString();

                MaterialExtraData[i] = reader.Read <NiRef <NiExtraData> >(File);
            }

            ActiveMaterial = reader.Read <int>();

            Dirty = reader.Read <byte>() != 0;
        }
Exemplo n.º 24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiSkinData"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiSkinData(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.HasVertexWeights = true;
			this.Transform = new SkinTransform(file, reader);
			uint num = reader.ReadUInt32();
			if (base.Version >= eNifVersion.VER_4_0_0_2 && base.Version <= eNifVersion.VER_10_1_0_0)
			{
				this.Partition = new NiRef<NiSkinPartition>(reader);
			}
			if (base.Version >= eNifVersion.VER_4_2_1_0)
			{
				this.HasVertexWeights = reader.ReadBoolean(Version);
			}
			if (this.HasVertexWeights)
			{
				this.BoneList = new SkinData[num];
				int num2 = 0;
				while ((long)num2 < (long)((ulong)num))
				{
					this.BoneList[num2] = new SkinData(file, reader, this.HasVertexWeights);
					num2++;
				}
			}
		}
Exemplo n.º 25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiParticleMeshesData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiParticleMeshesData(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.UnkownLink = new NiRef<NiAVObject>(reader);
		}
Exemplo n.º 26
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ATextureRenderData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public ATextureRenderData(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.PixelFormat = (ePixelFormat)reader.ReadUInt32();
			if (base.Version <= eNifVersion.VER_10_2_0_0)
			{
				this.RedMask = reader.ReadUInt32();
				this.GreenMask = reader.ReadUInt32();
				this.BlueMask = reader.ReadUInt32();
				this.AlphaMask = reader.ReadUInt32();
				this.BitsPerPixel = reader.ReadByte();
				this.Unkown3Bytes = new byte[3];
				for (int i = 0; i < this.Unkown3Bytes.Length; i++)
				{
					this.Unkown3Bytes[i] = reader.ReadByte();
				}
				this.Unkown8Bytes = new byte[8];
				for (int j = 0; j < this.Unkown8Bytes.Length; j++)
				{
					this.Unkown8Bytes[j] = reader.ReadByte();
				}
			}
			if (base.Version >= eNifVersion.VER_10_0_1_0 && base.Version <= eNifVersion.VER_10_2_0_0)
			{
				this.UnkownInt = reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_20_0_0_4)
			{
				this.BitsPerPixel = reader.ReadByte();
				this.UnkownInt2 = reader.ReadUInt32();
				this.UnkownInt3 = reader.ReadUInt32();
				this.Flags = reader.ReadByte();
				this.UnkownInt4 = reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_20_3_0_6)
			{
				this.UnkownByte1 = reader.ReadByte();
			}
			if (base.Version >= eNifVersion.VER_20_0_0_4)
			{
				this.ChannelData = new ChannelData[4];
				for (int k = 0; k < 4; k++)
				{
					this.ChannelData[k] = new ChannelData(file, reader);
				}
			}
			this.Palette = new NiRef<NiPalette>(reader);
			this.NumMipMaps = reader.ReadUInt32();
			this.BytesPerPixel = reader.ReadUInt32();
			this.MipMaps = new MipMap[this.NumMipMaps];
			int num = 0;
			while ((long)num < (long)((ulong)this.NumMipMaps))
			{
				this.MipMaps[num] = new MipMap(file, reader);
				num++;
			}
		}
Exemplo n.º 27
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiAVObject" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <exception cref="Exception">Cannot read BoundingBoxes yet</exception>
        public NiAVObject(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version >= eNifVersion.VER_3_0)
			{
				this.Flags = reader.ReadUInt16();
			}
			if (this.File.Header.Version >= eNifVersion.VER_20_2_0_7 && this.File.Header.UserVersion == 11u && this.File.Header.UserVersion2 > 26u)
			{
				this.UnkownShort1 = reader.ReadUInt16();
			}
			this.Translation = reader.ReadVector3();
			this.Rotation = reader.ReadMatrix33();
			this.Scale = reader.ReadSingle();
			if (this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
			{
				this.Velocity = reader.ReadVector3();
			}
			if (this.File.Header.Version <= eNifVersion.VER_20_2_0_7 || this.File.Header.UserVersion <= 11u)
			{
				uint num = reader.ReadUInt32();
				this.Properties = new NiRef<NiProperty>[num];
				int num2 = 0;
				while ((long)num2 < (long)((ulong)num))
				{
					this.Properties[num2] = new NiRef<NiProperty>(reader.ReadUInt32());
					num2++;
				}
			}
			if (this.File.Header.Version <= eNifVersion.VER_2_3)
			{
				this.UnkownInts1 = new uint[4];
				for (int i = 0; i < 4; i++)
				{
					this.UnkownInts1[i] = reader.ReadUInt32();
				}
				this.UnkownByte = reader.ReadByte();
			}
			if (this.File.Header.Version >= eNifVersion.VER_3_0 && this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
			{
				this.HasBoundingBox = reader.ReadBoolean(Version);
				if (this.HasBoundingBox)
				{
					throw new Exception("Cannot read BoundingBoxes yet");
				}
			}
			if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
			{
				this.CollisionObject = new NiRef<NiCollisionObject>(reader.ReadUInt32());
			}
		}
Exemplo n.º 28
0
 public override void Deserialize(BitReader reader)
 {
     Target = reader.Read <NiRef <NiAvObject> >(File);
 }
Exemplo n.º 29
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiTextureEffect"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        /// <exception cref="Exception">NOT SUPPORTED!</exception>
        public NiTextureEffect(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.ModelProjectionMatrix = reader.ReadMatrix33();
			this.ModelProjectionTransform = reader.ReadVector3();
			this.TextureFiltering = (eTexFilterMode)reader.ReadUInt32();
			this.TextureClamping = (eTexClampMode)reader.ReadUInt32();
			this.EffectType = (eEffectType)reader.ReadUInt32();
			this.CoordGenType = (eCoordGenType)reader.ReadUInt32();
			if (base.Version <= eNifVersion.VER_3_1)
			{
				throw new Exception("NOT SUPPORTED!");
			}
			if (base.Version >= eNifVersion.VER_4_0_0_0)
			{
				this.SourceTexture = new NiRef<NiSourceTexture>(reader);
			}
			this.ClippingPlane = reader.ReadBoolean(Version);
			this.unknownVector = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
			this.Unknown2 = reader.ReadSingle();
			if (this.File.Header.Version <= eNifVersion.VER_10_2_0_0)
			{
				this.PS2L = reader.ReadInt16();
				this.PS2K = reader.ReadInt16();
			}
			if (this.File.Header.Version <= eNifVersion.VER_4_1_0_12)
			{
				this.Unknown3 = reader.ReadUInt16();
			}
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="NiParticleColorModifier" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiParticleColorModifier(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Data = new NiRef<NiColorData>(reader);
		}
Exemplo n.º 31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TexDesc"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public TexDesc(NiFile file, BinaryReader reader)
		{
			this.Source = new NiRef<NiSourceTexture>(reader);
			if (file.Version <= eNifVersion.VER_20_0_0_5)
			{
				this.ClampMode = (eTexClampMode)reader.ReadUInt32();
				this.FilterMode = (eTexFilterMode)reader.ReadUInt32();
			}
			if (file.Version >= eNifVersion.VER_20_1_0_3)
			{
				this.Flags = reader.ReadUInt16();
			}
			if (file.Version <= eNifVersion.VER_20_0_0_5)
			{
				this.UVSetIndex = reader.ReadUInt32();
			}
			if (file.Version <= eNifVersion.VER_10_4_0_1)
			{
				this.PS2L = reader.ReadInt16();
				this.PS2K = reader.ReadInt16();
			}
			if (file.Version <= eNifVersion.VER_4_1_0_12)
			{
				reader.ReadUInt16();
			}
			if (file.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.HasTextureTransform = reader.ReadBoolean(file.Version);
				if (this.HasTextureTransform)
				{
					this.Translation = reader.ReadVector2();
					this.Tiling = reader.ReadVector2();
					this.WRotation = reader.ReadSingle();
					this.TransformType = reader.ReadUInt32();
					this.CenterOffset = reader.ReadVector2();
				}
			}
		}
Exemplo n.º 32
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiCollisionObject" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiCollisionObject(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.Target = new NiRef<NiAVObject>(reader);
		}
Exemplo n.º 33
0
        public override void Deserialize(BitReader reader)
        {
            base.Deserialize(reader);

            Data = reader.Read <NiRef <NiLODData> >(File);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="NiParticleSystemController" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiParticleSystemController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version <= eNifVersion.VER_3_1)
			{
				this.OldSpeed = reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_3_3_0_13)
			{
				this.Speed = reader.ReadSingle();
			}
			this.RandomSpeed = reader.ReadSingle();
			this.VerticalDirection = reader.ReadSingle();
			this.VerticalAngle = reader.ReadSingle();
			this.HorizontalDirection = reader.ReadSingle();
			this.HorizontalAngle = reader.ReadSingle();
			this.UnkownNormal = reader.ReadVector3();
			this.UnkownColor = reader.ReadColor4();
			this.Size = reader.ReadSingle();
			this.EmitStartTime = reader.ReadSingle();
			this.EmitStopTime = reader.ReadSingle();
			if (base.Version >= eNifVersion.VER_4_0_0_2)
			{
				this.UnkownByte = reader.ReadByte();
			}
			if (base.Version <= eNifVersion.VER_3_1)
			{
				this.OldEmitRate = reader.ReadUInt32();
			}
			if (base.Version >= eNifVersion.VER_3_3_0_13)
			{
				this.EmitRate = reader.ReadSingle();
			}
			this.Lifetime = reader.ReadSingle();
			this.LifetimeRandom = reader.ReadSingle();
			if (base.Version >= eNifVersion.VER_4_0_0_2)
			{
				this.EmitFlags = reader.ReadUInt16();
			}
			this.StartRandom = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
			this.Emitter = new NiRef<NiObject>(reader);
			if (base.Version >= eNifVersion.VER_4_0_0_2)
			{
				reader.ReadUInt16();
				reader.ReadSingle();
				reader.ReadUInt32();
				reader.ReadUInt32();
				reader.ReadUInt16();
			}
			if (base.Version <= eNifVersion.VER_3_1)
			{
				this.ParticleVelocity = reader.ReadVector3();
				this.ParticleUnkownVector = reader.ReadVector3();
				this.ParticleLifeTime = reader.ReadSingle();
				this.ParticleLink = new NiRef<NiObject>(reader);
				this.ParticleTimestamp = reader.ReadUInt32();
				this.ParticleUnkownShort = reader.ReadUInt16();
				this.ParticleVertexId = reader.ReadUInt16();
			}
			if (base.Version >= eNifVersion.VER_4_0_0_2)
			{
				this.NumParticles = reader.ReadUInt16();
				this.NumValid = reader.ReadUInt16();
				this.Particles = new Particle[(int)this.NumParticles];
				for (int i = 0; i < (int)this.NumParticles; i++)
				{
					this.Particles[i] = new Particle(file, reader);
				}
				this.UnkownRef = new NiRef<NiObject>(reader);
			}
			this.ParticleExtra = new NiRef<NiParticleModifier>(reader);
			this.UnkownRef2 = new NiRef<NiObject>(reader);
			if (base.Version >= eNifVersion.VER_4_0_0_2)
			{
				this.Trailer = reader.ReadByte();
			}
			if (base.Version <= eNifVersion.VER_3_1)
			{
				this.ColorData = new NiRef<NiColorData>(reader);
				this.UnkownFloat1 = reader.ReadSingle();
				this.UnkownFloats2 = reader.ReadFloatArray((int)this.ParticleUnkownShort);
			}
		}
Exemplo n.º 35
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiCamera"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiCamera(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.Unkown1 = reader.ReadUInt16();
			}
			this.FrustrumLeft = reader.ReadSingle();
			this.FrustrumRight = reader.ReadSingle();
			this.FrustrumTop = reader.ReadSingle();
			this.FrustrumBottom = reader.ReadSingle();
			this.FrustrumNear = reader.ReadSingle();
			this.FrustrumFar = reader.ReadSingle();
			if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.UseOrthographicsProjection = reader.ReadBoolean(Version);
			}
			this.ViewportLeft = reader.ReadSingle();
			this.ViewportRight = reader.ReadSingle();
			this.ViewportTop = reader.ReadSingle();
			this.ViewportBottom = reader.ReadSingle();
			this.LODAdjust = reader.ReadSingle();
			this.UnkownLink = new NiRef<NiObject>(reader);
			this.Unkown2 = reader.ReadUInt32();
			if (this.File.Header.Version >= eNifVersion.VER_4_2_1_0)
			{
				this.Unkown3 = reader.ReadUInt32();
			}
			if (this.File.Header.Version <= eNifVersion.VER_3_1)
			{
				this.Unkown4 = reader.ReadUInt32();
			}
		}
Exemplo n.º 36
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiUVController"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiUVController(NiFile file, BinaryReader reader) : base(file, reader)
		{
			this.UnkownShort1 = reader.ReadUInt16();
			this.Data = new NiRef<NiUVData>(reader);
		}