示例#1
0
        public SkinData(NiFile file, BinaryReader reader, bool hasVertexWeights)
        {
            Transform            = new SkinTransform(file, reader);
            BoundingSphereOffset = reader.ReadVector3();
            BoundingSphereRadius = reader.ReadSingle();

            if (file.Version == eNifVersion.VER_20_3_0_9 &&
                file.Header.UserVersion == 131072)
            {
                Unkown13Shorts = new ushort[13];
                for (var i = 0; i < 13; i++)
                {
                    Unkown13Shorts[i] = reader.ReadUInt16();
                }
            }

            NumVertices = reader.ReadUInt16();
            if (hasVertexWeights)
            {
                VertexWeights = new SkinWeight[NumVertices];
                for (var i = 0; i < NumVertices; i++)
                {
                    VertexWeights[i] = new SkinWeight(file, reader);
                }
            }
        }
示例#2
0
        public NiSkinData(NiFile file, BinaryReader reader)
            : base(file, reader)
        {
            HasVertexWeights = true;
            Transform        = new SkinTransform(file, reader);
            var numBones = reader.ReadUInt32();

            if (Version >= eNifVersion.VER_4_0_0_2 && Version <= eNifVersion.VER_10_1_0_0)
            {
                Partition = new NiRef <NiSkinPartition>(reader);
            }
            if (Version >= eNifVersion.VER_4_2_1_0)
            {
                HasVertexWeights = reader.ReadBoolean();
            }

            if (HasVertexWeights)
            {
                BoneList = new SkinData[numBones];
                for (var i = 0; i < numBones; i++)
                {
                    BoneList[i] = new SkinData(file, reader, HasVertexWeights);
                }
            }
        }