public ColladaHalo2BSPInfo(int internal_index, string name, int vertex_count, int face_count, BSPObjectType type) : base(internal_index, name, vertex_count, face_count) { Type = type; }
public static int GetTriangleCount(TagManager manager, BSPObjectType type) { var definition = manager.TagDefinition as Blam.Halo1.Tags.structure_bsp_group; int count = 0; switch (type) { case BSPObjectType.RenderMesh: foreach (var lightmap in definition.Lightmaps) { foreach (var material in lightmap.Materials) { count += material.SurfaceCount; } } break; case BSPObjectType.Portals: foreach (var portal in definition.ClusterPortals) { count += portal.Vertices.Count - 2; } break; case BSPObjectType.FogPlanes: foreach (var fogplane in definition.FogPlanes) { count += fogplane.Vertices.Count - 2; } break; } ; return(count); }
//private ColladaHalo1BSPInfo() { } public ColladaHalo1BSPInfo(int internal_index, string name, int vertex_count, int face_count, BSPObjectType bsp_type) : base(internal_index, name, vertex_count, face_count) { Type = bsp_type; }
void ExportBSP(string file_name) { BSPInfoInternal bsp_info = new BSPInfoInternal(); BSPObjectType bsp_type = BSPObjectType.None; // create an info object with all of the registered infos combined foreach (int index in registeredInfos) { BSPInfoInternal info = internalInfoList[index] as BSPInfoInternal; if (info.IncludeRenderMesh()) { bsp_type |= BSPObjectType.RenderMesh; } if (info.IncludePortalsMesh()) { bsp_type |= BSPObjectType.Portals; } if (info.IncludeFogPlanesMesh()) { bsp_type |= BSPObjectType.FogPlanes; } for (int i = 0; i < info.GetShaderCount(); i++) { bsp_info.AddShaderDatum(info.GetShaderDatum(i), info.GetShaderName(i)); } } bsp_info.SetType(bsp_type); ColladaExportArgs arguments = new ColladaExportArgs(Overwrite, RelativeFilePath, BitmapFormat); var exporter = new Halo1.ColladaBSPExporter(arguments, bsp_info, tagIndex, tagManager); ExportSave(exporter, RelativeFilePath + file_name + ".dae"); }
public static int GetTriangleCount(TagManager manager, BSPObjectType type) { var definition = manager.TagDefinition as Blam.Halo2.Tags.scenario_structure_bsp_group; int count = 0; switch (type) { case BSPObjectType.RenderMesh: foreach (var cluster in definition.Clusters) { count += cluster.SectionInfo.Value.TotalTriangleCount; } break; case BSPObjectType.Portals: foreach (var portal in definition.ClusterPortals) { count += portal.Vertices.Count - 2; } break; } return(count); }
/// <summary> /// Sets the bsp object type /// </summary> /// <param name="bsp_type"></param> public void SetType(BSPObjectType bsp_type) { type = bsp_type; }
public static int GetTriangleCount(TagManager manager, BSPObjectType type) { var definition = manager.TagDefinition as Blam.Halo1.Tags.structure_bsp_group; int count = 0; switch (type) { case BSPObjectType.RenderMesh: foreach (var lightmap in definition.Lightmaps) { foreach (var material in lightmap.Materials) count += material.SurfaceCount; } break; case BSPObjectType.Portals: foreach (var portal in definition.ClusterPortals) count += portal.Vertices.Count - 2; break; case BSPObjectType.FogPlanes: foreach (var fogplane in definition.FogPlanes) count += fogplane.Vertices.Count - 2; break; }; return count; }
public static int GetTriangleCount(TagManager manager, BSPObjectType type) { var definition = manager.TagDefinition as Blam.Halo2.Tags.scenario_structure_bsp_group; int count = 0; switch (type) { case BSPObjectType.RenderMesh: foreach (var cluster in definition.Clusters) count += cluster.SectionInfo.Value.TotalTriangleCount; break; case BSPObjectType.Portals: foreach (var portal in definition.ClusterPortals) count += portal.Vertices.Count - 2; break; } return count; }