Example #1
0
        public override void parse(NIFFile file, NIFObject baseo, BinaryReader ds)
        {
            base.parse(file, baseo, ds);

            this.flags          = ds.readUnsignedShort();
            this.rootBoneLinkID = loadLinkID(ds);

            m_kRootBoneParentToSkinTransform = NITransform.parse(ds);

            this.m_uiBoneCount = ds.readInt();
            for (int i = 0; i < m_uiBoneCount; i++)
            {
                boneLinkIDs.Add(loadLinkID(ds));
            }
            for (int i = 0; i < m_uiBoneCount; i++)
            {
                m_pkSkinToBoneTransforms.Add(NITransform.parse(ds));
            }
            if ((flags & 2) == 0)
            {
                for (int i = 0; i < m_uiBoneCount; i++)
                {
                    Vector3 center = new Vector3(ds.readFloat(), ds.readFloat(), ds.readFloat());
                    float   rad    = ds.readFloat();
                }
            }
        }
Example #2
0
        public static NITransform parse(BinaryReader ds)
        {
            NITransform trans = new NITransform();
            Point3f     _1    = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
            Point3f     _2    = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
            Point3f     _3    = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
            Point3f     _4    = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());

            trans.matrix = new Matrix4f(_1.x, _2.x, _3.x, 0,
                                        _1.y, _2.y, _3.y, 0,
                                        _1.z, _2.z, _3.z, 0,
                                        _4.x, _4.y, _4.z, 1
                                        );
            trans.scale = ds.readFloat();
            return(trans);
        }