Beispiel #1
0
        void Export_VBUF_Geos(StreamWriter w, VBUF vbuf, VRTF vrtf, float[] uvScales, MLOD.Mesh mesh, int geoStateIndex)
        {
            if (vbuf == null)
            {
                w.WriteLine("; vbuf is null for geoState"); w.WriteLine(string.Format("vbuf {0} 0 0", geoStateIndex)); return;
            }

            MLOD.GeometryState geoState = mesh.GeometryStates[geoStateIndex];

            if (geosVBUFIsContained(geoState, mesh))
            {
                w.WriteLine("; vbuf is contained within main mesh");
            }
            w.WriteLine(string.Format("vbuf {0} {1} {2}", geoStateIndex, geoState.MinVertexIndex, geoState.VertexCount));
            if (geosVBUFIsContained(geoState, mesh))
            {
                return;
            }

            w.Export_VBUF(mpb, vbuf.GetVertices(mesh, vrtf, geoState, uvScales), vrtf);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public SceneGeostate(SceneMesh owner, MLOD.GeometryState state, GeometryModel3D model)
 {
     Owner = owner;
     State = state;
     Model = model;
 }
Beispiel #4
0
 bool geosIBUFIsContained(MLOD.GeometryState geoState, int sizePerPrimitive, MLOD.Mesh mesh)
 {
     return(geoState.StartIndex + geoState.PrimitiveCount * sizePerPrimitive <= mesh.StartIndex + mesh.PrimitiveCount * sizePerPrimitive);
 }
Beispiel #5
0
 bool geosVBUFIsContained(MLOD.GeometryState geoState, MLOD.Mesh mesh)
 {
     return(geoState.MinVertexIndex + geoState.VertexCount <= mesh.MinVertexIndex + mesh.VertexCount);
 }