예제 #1
0
 public NiLight(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Dimmer        = reader.ReadSingle();
     AmbientColor  = reader.ReadColor3();
     DiffuseColor  = reader.ReadColor3();
     SpecularColor = reader.ReadColor3();
 }
예제 #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);
 }
예제 #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]);
            }
        }
예제 #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);
 }
예제 #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);
        }
예제 #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);
            }
        }
예제 #8
0
 public void SetRef(NIFReader file)
 {
     if (IsValid)
     {
         Object = (T)file.ObjectsByRef[RefId];
     }
 }
예제 #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>();
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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());
 }
예제 #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);
 }
예제 #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);
     }
 }
예제 #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());
 }
예제 #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());
            }
        }
예제 #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);
            }
        }
예제 #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();
 }
예제 #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();
            }
        }
예제 #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);
     }
 }
예제 #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);
 }
예제 #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);
            }
        }
예제 #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]);
            }
        }
예제 #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);
            }
        }
예제 #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());
            }
        }
예제 #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>();
 }
예제 #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);
            }
        }
예제 #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);
            }
        }