コード例 #1
0
ファイル: Export.cs プロジェクト: dd-dk/sims3tools
        void Export_IBUF_Main(StreamWriter w, IBUF ibuf, MLOD.Mesh mesh)
        {
            if (ibuf == null) { w.WriteLine("; ibuf is null"); w.WriteLine("ibuf 0"); return; }

            w.WriteLine(string.Format("ibuf {0}", mesh.PrimitiveCount));
            w.Export_IBUF(mpb, ibuf.GetIndices(mesh), IBUF.IndexCountFromPrimitiveType(mesh.PrimitiveType), mesh.PrimitiveCount);
        }
コード例 #2
0
ファイル: Export.cs プロジェクト: dd-dk/sims3tools
        void Export_IBUF_Geos(StreamWriter w, IBUF ibuf, MLOD.Mesh mesh, int geoStateIndex)
        {
            if (ibuf == null) { w.WriteLine("; ibuf is null for geoState"); w.WriteLine(string.Format("ibuf {0} 0 0", geoStateIndex)); return; }

            int sizePerPrimitive = IBUF.IndexCountFromPrimitiveType(mesh.PrimitiveType);
            MLOD.GeometryState geoState = mesh.GeometryStates[geoStateIndex];

            if (geosIBUFIsContained(geoState, sizePerPrimitive, mesh)) w.WriteLine("; ibuf is contained within main mesh");
            w.WriteLine(string.Format("ibuf {0} {1} {2}", geoStateIndex, geoState.StartIndex, geoState.PrimitiveCount));
            if (geosIBUFIsContained(geoState, sizePerPrimitive, mesh)) return;

            w.Export_IBUF(mpb, ibuf.GetIndices(mesh, geoStateIndex), sizePerPrimitive, geoState.PrimitiveCount);
        }