Exemplo n.º 1
0
        public SkinData(BinaryReader reader, bool hasVertexWeights)
        {
            Transform            = new SkinTransform(reader);
            BoundingSphereOffset = reader.Read <Vector3>();
            BoundingSphereRadius = reader.ReadSingle();
            NumVertices          = reader.ReadUInt16();

            if (hasVertexWeights)
            {
                VertexWeights = new SkinWeight[NumVertices];
                for (var i = 0; i < NumVertices; i++)
                {
                    VertexWeights[i] = new SkinWeight(reader);
                }
            }
        }
Exemplo n.º 2
0
        public NiSkinData(NIFReader file, BinaryReader reader) : base(file, reader)
        {
            HasVertexWeights = true;
            Transform        = new SkinTransform(reader);
            var skinCount = reader.ReadUInt32();

            Partition = new NiRef <NiSkinPartition>(reader);

            if (Version >= NifVersion.VER_4_2_1_0)
            {
                HasVertexWeights = reader.ReadBoolean();
            }

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