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); }
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); }
public SceneGeostate(SceneMesh owner, MLOD.GeometryState state, GeometryModel3D model) { Owner = owner; State = state; Model = model; }
bool geosIBUFIsContained(MLOD.GeometryState geoState, int sizePerPrimitive, MLOD.Mesh mesh) { return(geoState.StartIndex + geoState.PrimitiveCount * sizePerPrimitive <= mesh.StartIndex + mesh.PrimitiveCount * sizePerPrimitive); }
bool geosVBUFIsContained(MLOD.GeometryState geoState, MLOD.Mesh mesh) { return(geoState.MinVertexIndex + geoState.VertexCount <= mesh.MinVertexIndex + mesh.VertexCount); }