Example #1
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);
        }
Example #2
0
        public void parse(NIFFile file, NIFObject baseo, BinaryReader ds)
        {
            sourceTexLinkID = ds.readInt();
            flags           = ds.readUnsignedShort();
            maxAniso        = ds.readUnsignedShort();
            hasTransform    = ds.readUnsignedByte() > 0;
            if (hasTransform)

            {
                translation = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
                scale       = ds.readFloat();
                rotate      = ds.readFloat();
                method      = ds.readInt();
                center      = new Point2f(ds.readFloat(), ds.readFloat());
            }
        }
Example #3
0
        protected void loadAVObject(NIFFile file, BinaryReader ds)
        {
            loadObjectNET(file, ds);


            int flags = ds.readUnsignedShort();

            // if hack readUShort
            translation = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
            matrix      = new Matrix4f(ds.readFloat(), ds.readFloat(), ds.readFloat(), 0,
                                       ds.readFloat(), ds.readFloat(), ds.readFloat(), 0,
                                       ds.readFloat(), ds.readFloat(), ds.readFloat(), 0,
                                       translation.x, translation.y, translation.z, 0);
            scale           = ds.readFloat();
            nodePropertyIDs = loadLinkIDs(ds);

            loadLinkID(ds); // collision node?
            isBone = true;
        }
Example #4
0
        public override void parse(NIFFile file, NIFObject baseo, BinaryReader ds)
        {
            base.parse(file, baseo, ds);

            loadRenderable(file, ds);
            meshPrimType  = ds.readInt();
            numSubMeshes  = ds.readUnsignedShort();
            isInstanced   = ds.readUnsignedByte() > 0;
            boundsCenter  = new Point3f(ds.readFloat(), ds.readFloat(), ds.readFloat());
            boundsRad     = ds.readFloat();
            numStreamRefs = ds.readInt();
            streamRefs    = new List <NifMeshStream>();

            for (int i = 0; i < numStreamRefs; i++)
            {
                NifMeshStream meshStream = new NifMeshStream();
                meshStream.parse(file, baseo, ds);
                streamRefs.Add(meshStream);
            }

            modLinks = loadLinkIDs(ds);
            file.addMesh(this);
        }