Ejemplo n.º 1
0
 public NiLight(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Dimmer        = reader.ReadSingle();
     AmbientColor  = reader.ReadColor3();
     DiffuseColor  = reader.ReadColor3();
     SpecularColor = reader.ReadColor3();
 }
Ejemplo n.º 2
0
 public NiUVData(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     UTranslation      = new KeyGroup <FloatKey>(reader);
     VTranslation      = new KeyGroup <FloatKey>(reader);
     UScalingAndTiling = new KeyGroup <FloatKey>(reader);
     VScalingAndTiling = new KeyGroup <FloatKey>(reader);
 }
Ejemplo n.º 3
0
        public NiOutlineData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            EdgeCount     = reader.ReadUInt32();
            TrisCount     = reader.ReadUInt32();
            VerticesCount = reader.ReadUInt32();

            Edges = new ushort[EdgeCount][];
            for (var i = 0; i < EdgeCount; i++)
            {
                Edges[i] = reader.ReadArray <ushort>(4);
            }

            Tris = new ushort[TrisCount][];
            for (var i = 0; i < TrisCount; i++)
            {
                Tris[i] = reader.ReadArray <ushort>(7);
            }

            VerticesGroups = reader.ReadArray <uint>((int)VerticesCount);

            Vertices = new ushort[VerticesCount][];
            for (var i = 0; i < VerticesCount; i++)
            {
                Vertices[i] = reader.ReadArray <ushort>((int)VerticesGroups[i]);
            }
        }
Ejemplo n.º 4
0
        public NiGeometryData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            NumVertices = reader.ReadUInt16();
            HasVertices = reader.ReadBoolean();

            if (HasVertices)
            {
                Vertices = reader.ReadArray <Vector3>(NumVertices);
            }

            HasNormals = reader.ReadBoolean();
            if (HasNormals)
            {
                Normals = reader.ReadArray <Vector3>(NumVertices);
            }

            Center = reader.Read <Vector3>();
            Radius = reader.ReadSingle();

            HasVertexColors = reader.ReadBoolean();
            if (HasVertexColors)
            {
                VertexColors = reader.ReadArray <Color4>(NumVertices);
            }

            var numUvSets = reader.ReadByte();

            TSpaceFlag = reader.ReadByte();

            UVSets = new Vector2[numUvSets][];
            for (var i = 0; i < numUvSets; i++)
            {
                UVSets[i] = reader.ReadArray <Vector2>(NumVertices);
            }
        }
 public NiTextureTransformController(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Unknown2    = reader.ReadByte();
     TextureSlot = (TexType)reader.ReadUInt32();
     Operation   = (TexTransform)reader.ReadUInt32();
     Data        = new NiRef <NiFloatData>(reader);
 }
Ejemplo n.º 6
0
        public NiKeyframeData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            var count = reader.ReadUInt32();

            if (count != 0u)
            {
                KeyType = (KeyType)reader.ReadUInt32();
            }

            if (KeyType == KeyType.XYZ_ROTATION_KEY)
            {
                UnknownFloat = reader.ReadSingle();

                Rotations = new KeyGroup <FloatKey>[]
                {
                    new KeyGroup <FloatKey>(reader),
                    new KeyGroup <FloatKey>(reader),
                    new KeyGroup <FloatKey>(reader)
                };
            }
            else
            {
                QuaternionKeys = new QuatKey[count];
                for (var i = 0; i < QuaternionKeys.Length; i++)
                {
                    QuaternionKeys[i] = new QuatKey(reader, KeyType);
                }
            }

            Translations = new KeyGroup <VecKey>(reader);
            Scales       = new KeyGroup <FloatKey>(reader);
        }
Ejemplo n.º 7
0
        public NiRoom(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            Walls = new NiRef <NiWall> [reader.ReadInt32()];
            for (var i = 0; i < Walls.Length; i++)
            {
                Walls[i] = new NiRef <NiWall>(reader);
            }

            InteriorPortals = new NiRef <NiPortal> [reader.ReadInt32()];
            for (var i = 0; i < InteriorPortals.Length; i++)
            {
                InteriorPortals[i] = new NiRef <NiPortal>(reader);
            }

            ExteriorPortals = new NiRef <NiPortal> [reader.ReadInt32()];
            for (var i = 0; i < ExteriorPortals.Length; i++)
            {
                ExteriorPortals[i] = new NiRef <NiPortal>(reader);
            }

            Fixtures = new NiRef <NiAVObject> [reader.ReadInt32()];
            for (var i = 0; i < Fixtures.Length; i++)
            {
                Fixtures[i] = new NiRef <NiAVObject>(reader);
            }
        }
Ejemplo n.º 8
0
 public void SetRef(NIFReader file)
 {
     if (IsValid)
     {
         Object = (T)file.ObjectsByRef[RefId];
     }
 }
Ejemplo n.º 9
0
 public NiGravity(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     UnknownFloat1 = reader.ReadSingle();
     Force         = reader.ReadSingle();
     Type          = reader.ReadUInt32();
     Position      = reader.Read <Vector3>();
     Direction     = reader.Read <Vector3>();
 }
Ejemplo n.º 10
0
 public NiStringsExtraData(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     ExtraStringData = new NiString[reader.ReadUInt32()];
     for (var i = 0; i < ExtraStringData.Length; i++)
     {
         ExtraStringData[i] = new NiString(reader);
     }
 }
Ejemplo n.º 11
0
 public NiVisData(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Keys = new ByteKey[reader.ReadUInt32()];
     for (var i = 0; i < Keys.Length; i++)
     {
         Keys[i] = new ByteKey(reader, KeyType.LINEAR_KEY);
     }
 }
Ejemplo n.º 12
0
 public NiSkinPartition(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Partitions = new SkinPartition[reader.ReadUInt32()];
     for (var i = 0; i < Partitions.Length; i++)
     {
         Partitions[i] = new SkinPartition(reader);
     }
 }
Ejemplo n.º 13
0
 public NiParticleMeshModifier(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     ParticleMeshes = new NiRef <NiAVObject> [reader.ReadUInt32()];
     for (var i = 0; i < ParticleMeshes.Length; i++)
     {
         ParticleMeshes[i] = new NiRef <NiAVObject>(reader);
     }
 }
Ejemplo n.º 14
0
 public NiScreenLODData(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     BoundCenter      = reader.Read <Vector3>();
     BoundRadius      = reader.ReadSingle();
     WorldCenter      = reader.Read <Vector3>();
     WorldRadius      = reader.ReadSingle();
     ProportionLevels = reader.ReadArray <float>(reader.ReadInt32());
 }
Ejemplo n.º 15
0
 public NiPathController(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Unknown2  = reader.ReadUInt32();
     Unknown3  = reader.ReadSingle();
     Unknown4  = reader.ReadSingle();
     Unknown5  = reader.ReadUInt16();
     PosData   = new NiRef <NiPosData>(reader);
     FloatData = new NiRef <NiFloatData>(reader);
 }
Ejemplo n.º 16
0
 public NiRoomGroup(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Shell = new NiRef <NiNode>(reader);
     Rooms = new NiRef <NiRoom> [reader.ReadInt32()];
     for (var i = 0; i < Rooms.Length; i++)
     {
         Rooms[i] = new NiRef <NiRoom>(reader);
     }
 }
Ejemplo n.º 17
0
 public NiObjectNET(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Name      = new NiString(reader);
     ExtraData = new NiRef <NiExtraData>[]
     {
         new NiRef <NiExtraData>(reader.ReadUInt32())
     };
     Controller = new NiRef <NiTimeController>(reader.ReadUInt32());
 }
Ejemplo n.º 18
0
        public NiExtraData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            NextExtraData = new NiRef <NiExtraData>(reader.ReadUInt32());

            if (GetType() == typeof(NiExtraData))
            {
                ExtraData = reader.ReadBytes(reader.ReadInt32());
            }
        }
Ejemplo n.º 19
0
        public NiLODNode(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            LODCenter = reader.Read <Vector3>();

            LODLevels = new LODRange[reader.ReadUInt32()];
            for (var i = 0; i < LODLevels.Length; i++)
            {
                LODLevels[i] = new LODRange(reader);
            }
        }
Ejemplo n.º 20
0
 public NiMaterialProperty(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Flags         = reader.ReadUInt16();
     AmbientColor  = reader.ReadColor3();
     DiffuseColor  = reader.ReadColor3();
     SpecularColor = reader.ReadColor3();
     EmissiveColor = reader.ReadColor3();
     Glossiness    = reader.ReadSingle();
     Alpha         = reader.ReadSingle();
 }
Ejemplo n.º 21
0
        public NiPixelData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            NumPixels = reader.ReadUInt32();
            PixelData = reader.ReadBytes((int)NumPixels);

            if (Version >= NifVersion.VER_4_2_1_1)
            {
                Unknown = reader.ReadUInt32();
            }
        }
Ejemplo n.º 22
0
 public NiSkinInstance(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Data         = new NiRef <NiSkinData>(reader);
     SkeletonRoot = new NiRef <NiNode>(reader);
     Bones        = new NiRef <NiNode> [reader.ReadUInt32()];
     for (var i = 0; i < Bones.Length; i++)
     {
         Bones[i] = new NiRef <NiNode>(reader);
     }
 }
Ejemplo n.º 23
0
 public NiTimeController(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     NextController = new NiRef <NiTimeController>(reader);
     Flags          = reader.ReadUInt16();
     Frequency      = reader.ReadSingle();
     Phase          = reader.ReadSingle();
     StartTime      = reader.ReadSingle();
     StopTime       = reader.ReadSingle();
     Target         = new NiRef <NiObjectNET>(reader);
 }
Ejemplo n.º 24
0
        public NiTextKeyExtraData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            UnknownInt1 = reader.ReadUInt32();

            TextKeys = new StringKey[reader.ReadUInt32()];
            for (var i = 0; i < TextKeys.Length; i++)
            {
                TextKeys[i] = new StringKey(reader, KeyType.LINEAR_KEY);
            }
        }
Ejemplo n.º 25
0
        public NiTriStripsData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            var array = reader.ReadArray <ushort>(reader.ReadUInt16());

            Points = new ushort[array.Length][];
            for (var i = 0; i < array.Length; i++)
            {
                Points[i] = reader.ReadArray <ushort>(array[i]);
            }
        }
Ejemplo n.º 26
0
        public NiParticlesData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            ParticleRadius = reader.ReadSingle();
            NumActive      = reader.ReadUInt16();
            HasSizes       = reader.ReadBoolean();

            if (HasSizes)
            {
                Sizes = reader.ReadArray <float>((int)NumVertices);
            }
        }
Ejemplo n.º 27
0
        public NiTriShapeData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            NumTrianglePoints = reader.ReadUInt32();
            Triangles         = reader.ReadArray <Triangle>(NumTriangles);

            MatchGroups = new ushort[reader.ReadUInt16()][];
            for (var i = 0; i < MatchGroups.Length; i++)
            {
                MatchGroups[i] = reader.ReadArray <ushort>(reader.ReadUInt16());
            }
        }
Ejemplo n.º 28
0
 public NiParticleBomb(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Decay        = reader.ReadSingle();
     Duration     = reader.ReadSingle();
     DeltaV       = reader.ReadSingle();
     Start        = reader.ReadSingle();
     DecayType    = (DecayType)reader.ReadUInt32();
     SymmetryType = (SymmetryType)reader.ReadUInt32();
     Position     = reader.Read <Vector3>();
     Direction    = reader.Read <Vector3>();
 }
Ejemplo n.º 29
0
        public NiFlipController(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            TextureSlot = reader.ReadUInt32();
            Delta       = reader.ReadSingle();
            Unknown     = reader.ReadUInt32();

            Textures = new NiRef <NiSourceTexture> [reader.ReadInt32()];
            for (var i = 0; i < Textures.Length; i++)
            {
                Textures[i] = new NiRef <NiSourceTexture>(reader);
            }
        }
Ejemplo n.º 30
0
        public NiMorphData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            NumMorphs       = reader.ReadUInt32();
            NumVertices     = reader.ReadUInt32();
            RelativeTargets = reader.ReadByte();

            Morphs = new Morph[NumMorphs];
            for (var i = 0; i < NumMorphs; i++)
            {
                Morphs[i] = new Morph(reader, NumVertices);
            }
        }