Пример #1
0
 public JointAnim(
     BCA.ANF1Section.AnimatedJoint Joint,
     float[] Scales,
     short[] Rotations,
     float[] Translations,
     float RotScale)
 {
     this.SetKeysST(out this.scalesX_, Scales, Joint.X.S);
     this.SetKeysST(out this.scalesY_, Scales, Joint.Y.S);
     this.SetKeysST(out this.scalesZ_, Scales, Joint.Z.S);
     this.SetKeysR(out this.rotationsX_, Rotations, RotScale, Joint.X.R);
     this.SetKeysR(out this.rotationsY_, Rotations, RotScale, Joint.Y.R);
     this.SetKeysR(out this.rotationsZ_, Rotations, RotScale, Joint.Z.R);
     this.SetKeysST(out this.translationsX_, Translations, Joint.X.T);
     this.SetKeysST(out this.translationsY_, Translations, Joint.Y.T);
     this.SetKeysST(out this.translationsZ_, Translations, Joint.Z.T);
 }
Пример #2
0
            public ANF1Section(EndianBinaryReader er, out bool OK)
            {
                bool OK1;

                this.Header = new DataBlockHeader(er, "ANF1", out OK1);
                if (!OK1)
                {
                    OK = false;
                }
                else
                {
                    this.LoopFlags       = er.ReadByte();
                    this.AngleMultiplier = er.ReadByte();
                    this.AnimLength      = er.ReadUInt16();
                    this.NrJoints        = er.ReadUInt16();
                    this.NrScale         = er.ReadUInt16();
                    this.NrRot           = er.ReadUInt16();
                    this.NrTrans         = er.ReadUInt16();
                    this.JointOffset     = er.ReadUInt32();
                    this.ScaleOffset     = er.ReadUInt32();
                    this.RotOffset       = er.ReadUInt32();
                    this.TransOffset     = er.ReadUInt32();

                    er.BaseStream.Position = (long)(32U + this.ScaleOffset);
                    this.Scale             = er.ReadSingles((int)this.NrScale);
                    er.BaseStream.Position = (long)(32U + this.RotOffset);
                    this.Rotation          = er.ReadInt16s((int)this.NrRot);
                    er.BaseStream.Position = (long)(32U + this.TransOffset);
                    this.Translation       = er.ReadSingles((int)this.NrTrans);
                    float RotScale = (float)(1 * Math.PI / 32768f);
                    er.BaseStream.Position = (long)(32U + this.JointOffset);
                    this.Joints            = new BCA.ANF1Section.AnimatedJoint[(int)this.NrJoints];
                    for (int index = 0; index < (int)this.NrJoints; ++index)
                    {
                        var animatedJoint = new BCA.ANF1Section.AnimatedJoint(er);
                        animatedJoint.SetValues(this.Scale,
                                                this.Rotation,
                                                this.Translation,
                                                RotScale);
                        this.Joints[index] = animatedJoint;
                    }
                    OK = true;
                }
            }