Пример #1
0
            public BckANK1(UInt32 size, Stream stream)
            {
                long secptr = stream.Position - 8;//section pointer

                this.magic = "ANK1";
                this.size  = size;

                hdr = Header.Read(stream);                                        //get header

                stream.Seek(secptr + hdr.jointanimationoffset, SeekOrigin.Begin); //go to the animations
                for (int i = 0; i < hdr.jointanimationcount; i++)
                {
                    jointanims.Add(JointAnimation.Read(stream));         //read animations
                }
                stream.Seek(secptr + hdr.scaleoffset, SeekOrigin.Begin); //go to the scales
                for (int i = 0; i < hdr.scalecount; i++)
                {
                    scales.Add(Data.ReadSingle(stream));               //read scales
                }
                stream.Seek(secptr + hdr.rotoffset, SeekOrigin.Begin); //go to rotations
                for (int i = 0; i < hdr.rotcount; i++)
                {
                    rotations.Add(Data.ReadInt16(stream));                     //read rotations
                }
                stream.Seek(secptr + hdr.translationoffset, SeekOrigin.Begin); //go to translations
                for (int i = 0; i < hdr.translationcount; i++)
                {
                    translations.Add(Data.ReadSingle(stream));                         //read translations
                }
                anglescale = (float)Math.Pow(2f, hdr.anglescaleexp) * (180f / 32767f); //some kind of float shenanigans

                stream.Seek(secptr + this.size, SeekOrigin.Begin);                     //seek the next section
            }